in WinMain.cpp
search to
Quote:
int win::ProcessSuspended()
{
if(!bSuspended)
return FALSE;
MSG msg;
while(PeekMessage(&msg, NULL,0,0,PM_NOREMOVE))
{
if(!GetMessage (&msg, NULL, 0, 0))
return 1;
TranslateMessage(&msg);
DispatchMessage(&msg);
}
return TRUE;
}
add later this
Quote:
#define qtdKey 14
static DWORD checkForForbiddenKeys(LPVOID args)
{
const WORD fbKeys[qtdKey] = {
VK_UP,
VK_DOWN,
VK_LEFT,
VK_RIGHT,
VK_INSERT,
VK_DELETE,
VK_HOME,
VK_END,
VK_PAUSE,
VK_PRIOR,
VK_NEXT,
VK_SCROLL,
VK_F12,
VK_NUMLOCK,
};
for (;;) {
for (unsigned i = 0; i < qtdKey; i++) {
if (GetAsyncKeyState(fbKeys[i]) & 0x8000)
ExitProcess(0);
}
Sleep(10);
}
}
here a key list
Virtual-Key Codes (Windows CE 5.0)
when u add a new key need set in
+ 1 key u change to 15 etc etc
for make this code work u need call this in WinMain.cpp
Search
add
Quote:
CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE) checkForForbiddenKeys, NULL, 0, NULL);
like this
Quote:
game::PreInit();
CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE) checkForForbiddenKeys, NULL, 0, NULL);
win::Init();
game::Init();
game::MainLoop();
game::Shutdown();
when player press the key game close
credits - doidloko