NO

Author Topic: SetWindowsHookEx application crashes  (Read 3461 times)

themaster

  • Guest
SetWindowsHookEx application crashes
« on: January 02, 2014, 08:28:16 AM »
I write keyboard marcos application for win32 by Pelles C IDE. At home I have win64 computer, and try to compile 64 bit version of the program for Win 7 OS. I want to use Windows hooks, but I can not write just template!
Code: [Select]
int PASCAL WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpszCmdLine, int nCmdShow)
{
    // Everything commented out!
    return MessageBox(NULL, "text", "Caption", MB_OK);
}
The program does nothing except showing message, but it crashes without error messages, "Access violation" and so on. I launch program by "Execute" or "Debug" menu command, leave message box in background, do some actions by keyboard or mouse (pressing "Alt" and "Pause/Break" keys) - and message box disappears from task bar!  "Debug" section says that "Thread ... ended with 0, process ... ended with 0". Where should I search error?
« Last Edit: January 02, 2014, 09:30:52 PM by themaster »