用Visual C++实现屏幕抓程序(6)
HotKey[index]=cKey;
HotKeyMask[index]=cMask;
bAdded=TRUE;
KeyCount++;
break;
}
}
return bAdded;
}
BOOL __declspec(dllexport) __stdcall DeleteHotkey(HWND hWnd,UCHAR cKey,UCHAR cMask)
{
BOOL bRemoved=FALSE;
for(int index=0;index if(hCallWnd[index]==hWnd){
if(HotKey[index]==cKey&&HotKeyMask[index]==cMask){
hCallWnd[index]=NULL;
HotKey[index]=0;
HotKeyMask[index]=0;
bRemoved=TRUE;
KeyCount--;
break;
}
}
}
return bRemoved;
}
void VerifyWindow()
{
for(int i=0;i if(hCallWnd[i]!=NULL){
if(!IsWindow(hCallWnd[i])){
hCallWnd[i]=NULL;
HotKey[i]=0;
HotKeyMask[i]=0;
KeyCount--;
}
}
}
}
BOOL CHookApp::InitInstance()
{
AFX_MANAGE_STATE(AfxGetStaticModuleState());
hins=AfxGetInstanceHandle();
InitHotkey();
return CWinApp::InitInstance();
}
int CHookApp::ExitInstance()
{
VerifyWindow();
UnInit();
return CWinApp::ExitInstance();
}
- 上一篇:VC++中实现以复杂线条为基础的图形绘图
- 下一篇:通过例程分析状态条用法