001
17.09.2004, 21:47 Uhr
~mike
Gast
|
Hi!
C++: |
globalid = GlobalAddAtom(_T("mikeschummel")); RegisterHotKey(GetSafeHwnd(), globalid, MOD_ALT | MOD_WIN, 'S'); UnregisterHotKey(GetSafeHwnd(),globalid);
|
In die Message Map
C++: |
ON_MESSAGE(WM_HOTKEY,OnHotKey)
|
Wenn Taste gedürckt mach was (Bsp. aus Window Hider dev-geeks.org)
C++: |
LRESULT CWatcherDlg::OnHotKey(WPARAM wParam, LPARAM lParam) { HWND hwnd; CWnd *pWnd; for(int i=0; i<m_cList.GetItemCount();i++){ if(m_cList.GetCheck(i)){ hwnd = (HWND)m_cList.GetItemData(i); if(IsWindow(hwnd)){ pWnd = CWnd::FromHandle(hwnd); if(pWnd){ if(pWnd->IsWindowVisible()) pWnd->ShowWindow(SW_HIDE); else pWnd->ShowWindow(SW_SHOW); } } } }
return 0; }
|
mfg |