You can execute an exe in many ways:
- with the WinExec function
- with the CreateProcess function
- with system(exe name) (#include <process.h>)
To capture a specific keyboard combination you have to capture the WM_CHAR and WM_SYSCHAR messages sent to your window, test for your chosen combination thenn call the exe.
Hope this helps,
s-)
Blessed is he who in the name of justice and good will, shepards the week through the valley of darknees...
#define _WIN32_WINNT 0x0500
#include<windows.h>
HHOOK x=0;
LRESULT CALLBACK KeyboardProc(int code,WPARAM wParam,LPARAM lParam information)
{ //do what do you want here
return CallNextHookEx( x,code,wParam,lParam); //if you return -1 windows will call itsefl next hook proc //if you return 1 windows will give you full control //if you return 0 windows will process message after returning from function //without giving it to next hook //but is recommnended usuely you to return or call CallNextHookEx
}
int WINAPI WinMain(HINSTANCE hInstance,HINSTANCE,LPSTR,int)
{
x=SetWindowsHookEx(WH_KEYBOARD_LL,KeyboardProc, hInstance,0);
MSG msg;
while(GetMessage(&msg,0,0,0))
DispatchMessage(&msg);//this assure what your program will finish when is called PostQuitMessage()
return 0;
} John Fill
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.