-
HotKey
Hi,
I want to put a HotKey to my application means, it should open my application window which will be minimized... Means that If I am working with some other application and If I press that Hotkey I should be able to trap that hotkey and open my application... how can I do this..
Thanks lot,
Srini
-
Re: HotKey
see registerhotkey in msdn
-
Re: HotKey
I wrote the code like this... I don't get where the problem is. Still unable to solve the problem.Thanks lot for ur answer and solution. The code is
int a = (int)GlobalAddAtom("Tasksrini");
d = GetLastError();
if (RegisterHotKey((HWND)this,a,MOD_ALT|MOD_CONTROL ,30) == 0)
{
d = GetLastError();
AfxMessageBox("hello wrong");
Can u please let me know where I am doing some mistake?
Thanks lot,
Srini
-
Re: HotKey
Hi,
If the problem is that the actual RegisterHotKey call returns zero, it probably means that the hotkey you chose is already in use. If the problem is that nothing happens when you press the hotkey, that is because your window must handle the WM_HOTKEY message.
Daniel.
-
Re: HotKey
I did use hotkey as following:
SendMessage(WM_SETHOTKEY,(WPARAM)MAKEWORD(VK_F12,HOTKEYF_CONTROL|HOTKEYF_SHIFT));
U get hotkey message thru WM_SYSCOMMAND
so overide that message and check for
SC_HOTKEY and then do appropriate stuff.
It worked for my app.
Let me know whether it works for U.
Hope for help. :)
Walter
-
Re: HotKey
Hi,
Thanks a lot and lot. Finally problem got solved. It is working fine now.... The problem is, the first parameter I gave this, insteaf I gave m_hWnd... It works fine...
Thanks lot,
srini