// Notify.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <windows.h>
#include <commctrl.h>
const UINT uiTimerID = 10;
void CALLBACK MyLockProc(HWND hwnd,UINT uMsg,UINT idEvent,DWORD dwTime)
{
UINT i = 5;
while(i--) {
printf("hi set timer/n");
}
PostQuitMessage(0);
}
void LockSysThr(void)
{
MSG msgLock;
printf("LockSysThr/r/n");
SetTimer(NULL,uiTimerID,1000, MyLockProc);
while (GetMessage (&msgLock, NULL, 0, 0)) {
TranslateMessage (&msgLock);
DispatchMessage (&msgLock);
}
KillTimer( NULL, uiTimerID);
}
int _tmain(int argc, _TCHAR* argv[])
{
if(!CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)LockSysThr, NULL, 0, NULL)) {
NKDbgPrintfW(TEXT("CreateThread:LockSysThr failed/r/n"));
return -1;
}
while(1);
return 0;
}