Jump to content

Win+D and Win+M


Recommended Posts

@raduking....are you trying to capture these keys to prevent RKL from disapearing when a user uses those Hot-Keys? If you just want to register it you can use the RegisterHotKey function

RegisterHotKey(hwnd, 0, 0, VK_F9); for example

and then maybe

/* Run the message loop. It will run until GetMessage() returns 0 */

while (GetMessage (&messages, NULL, 0, 0))

{

/* Translate virtual-key messages into character messages */

TranslateMessage(&messages);

/* Send message to WindowProcedure */

DispatchMessage(&messages);

}

/* The program return-value is 0 - The value that PostQuitMessage() gave */

return messages.wParam;

}

then....maybe something like this

/* This function is called by the Windows function DispatchMessage() */

LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)

{

switch (message) /* handle the messages */

{

case WM_DESTROY:

PostQuitMessage (0); /* send a WM_QUIT to the message queue */

break;

case WM_HOTKEY:

SetForegroundWindow(hwnd);

MessageBox(hwnd, "You pressed F9.", "Hotkey", MB_OK); /* send a WM_QUIT to the message queue */

break;

default: /* for messages that we don't deal with */

return DefWindowProc (hwnd, message, wParam, lParam);

}

return 0;

}

I have no idea if this is what you are meaning

Link to comment
  • 2 weeks later...

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...