when the form is activated:
case WM_ACTIVATE:
{
if (wParam==WA_INACTIVE)
{
SetWindowText(inst->hwnd,"unactivated");
FormActivated = NULL;
}
else
{
SetWindowText(inst->hwnd,"activated");
FormActivated = inst->hwnd;
}
return 0;
}
break;
when i create the timer:
case WM_CREATE:
{
if(WindowMain == NULL || WindowMain ==GetDesktopWindow())
{
WindowMain = HandleWindow;
}
SetTimer(inst->hwnd,JoystickTimer,150,NULL);
SetTimer(inst->hwnd,KeyBoardTimer,150,NULL);
SendMessage((HWND)lParam , WM_CREATE, wParam, lParam);
}
break;
so why the WM_TIMER isn't activated? why i get invalid handle?
WPARAM MessageLoop()
{
MSG msgEvents;
while(GetMessage(&msgEvents, NULL, 0, 0) > 0)
{
if (!IsDialogMessage(FormActivated, &msgEvents))
{
TranslateMessage(&msgEvents);
DispatchMessage(&msgEvents);
}
}
return msgEvents.wParam;
}