CEdit does not get WM_CHAR in a DLL when the main application is minimized
Hi,
I have a simple application that lunch a DLL. The DLL opens a window
with a splitter of 2 CFormView and each one of the forms there is an
edit.
The code is as following:
void CTest002View::OnBnClickedButton2()
{
HINSTANCE hDLL; // Handle to DLL
hDLL = LoadLibrary("SessionWindow.dll");
if (hDLL == NULL)
FreeLibrary(hDLL);
else
{
typedef BOOL (CreateObject3)();
CreateObject3* pCreateObject3 = (CreateObject3
*)GetProcAddress(hDLL, "CreateObject3");
BOOL bRet = (pCreateObject3)();
}
}
The method in the DLL is as following:
extern "C" __declspec(dllexport) BOOL CreateObject3()
{
//AFX_MANAGE_STATE(AfxGetStaticModuleState());
SessionFrame2* pSessionFrame2 = new SessionFrame2;
pSessionFrame2->Create(NULL, _T("Session Frame"),
WS_OVERLAPPEDWINDOW , CRect(20, 20, 400, 400), NULL, NULL,
WS_EX_TOPMOST);
pSessionFrame2->ShowWindow(SW_SHOWNORMAL);
return TRUE;
}
Everything works fine, and when I minimized the main application I
still can type on the edits in the dll.
But, when I'm adding the method
AFX_MANAGE_STATE(AfxGetStaticModuleState());
I can not type on the edits in the DLL when I minimized the
application.
Any idea ?
-- Dani