Here are the available hotkeys:
- Ctrl + Alt + C Display a message box with the coordinates of where the mouse is at right now.
- Ctrl + Alt + E Exit the CMouse program.
You can also modify the 'c_notify' and 'c_exit' #defines, to alter the shortcut key used for the functions.
Here's the source code:
// Copyring (C) 2011 By RhetoricalRuvim
// Program: CMouse
#include <windows.h>
#include <stdio.h>
#define KEY_NOTIFY 1
#define KEY_FINISH 2
#define c_notify 'C'
#define c_exit 'E'
int WinMain (HINSTANCE hInst, HINSTANCE hPrevInst, LPSTR CmdLine, int CmdShow){
POINT mouse;
char string1 [512];
LRESULT result;
MSG msg;
if ( RegisterHotKey (0, KEY_NOTIFY, MOD_CONTROL | MOD_ALT, (UINT)(c_notify)) * RegisterHotKey (0, KEY_FINISH, MOD_CONTROL | MOD_ALT, (UINT)(c_exit)) ){
while (GetMessage (&msg, 0, 0, 0)){
if (msg.message == WM_HOTKEY){
if (msg.wParam == KEY_NOTIFY){
GetCursorPos (&mouse);
sprintf (string1, "Current Cursor Position: (%d, %d)", mouse.x, mouse.y);
MessageBoxA (0, string1, "Cursor Coordinates - CMouse", MB_OK | MB_SETFOREGROUND);
} else if (msg.wParam == KEY_FINISH){
ReplyMessage (0);
break;
} else {
// Nothing...
}
result= 0;
} else if (msg.message == WM_CLOSE){
ReplyMessage (0);
break;
} else {
// Nothing...
result= 0;
}
ReplyMessage (result);
}
} else {
MessageBoxA (0, "Error: Could not register hotkeys. ", "Error - CMouse", MB_OK | MB_SETFOREGROUND);
}
UnregisterHotKey (0, KEY_NOTIFY);
UnregisterHotKey (0, KEY_FINISH);
ExitProcess (0);
}


Sign In
Create Account


Back to top









