|
-
June 4th, 1999, 04:25 AM
#1
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
-
June 5th, 1999, 12:11 AM
#2
Re: HotKey
see registerhotkey in msdn
-
June 5th, 1999, 06:53 AM
#3
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
-
June 5th, 1999, 10:36 AM
#4
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.
-
June 6th, 1999, 01:33 PM
#5
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
-
June 7th, 1999, 09:08 AM
#6
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|