|
-
October 31st, 2006, 10:22 AM
#1
Disable Alt + Space
Hi,
I want to disable the menu that pop-up's in the header when i use the alt+space bar key in .Net. Basically i dont want the menu to be listed.Is there any property for that or is there any api call to disable that. Please help me out in that. Thanks in advance.
Vinoth
-
October 31st, 2006, 02:19 PM
#2
Re: Disable Alt + Space
add the following code to the form you dont want the alt + space menu in.
Code:
const int WM_SYSCOMMAND = 0x0112,
SC_KEYMENU = 0xF100;
protected override void WndProc(ref Message m) {
if(m.Msg == WM_SYSCOMMAND && m.WParam == (IntPtr)SC_KEYMENU) {
return;
}
base.WndProc(ref m);
}
-
October 31st, 2006, 10:56 PM
#3
Re: Disable Alt + Space
 Originally Posted by MadHatter
add the following code to the form you dont want the alt + space menu in.
Code:
const int WM_SYSCOMMAND = 0x0112,
SC_KEYMENU = 0xF100;
protected override void WndProc(ref Message m) {
if(m.Msg == WM_SYSCOMMAND && m.WParam == (IntPtr)SC_KEYMENU) {
return;
}
base.WndProc(ref m);
}
thanks,but why u use 0x0112 and 0xF100 in assign variable and wat its mean ?
and wat is the function of m.Msg and WndProc(ref m) ?
Last edited by honeyboy_20; October 31st, 2006 at 11:14 PM.
-
November 1st, 2006, 12:11 AM
#4
Re: Disable Alt + Space
they are the win32 windows messages that you're handling (defined in winuser.h).
WndProc is the method used to handle the main message queue.
alt + space generates the wm_syscommand / sc_keymenu notification used to pop up the window's context menu.
by returning (not allowing base.WndProc to process the message) you stop the message from being sent / handled by the window.
Last edited by MadHatter; November 1st, 2006 at 12:14 AM.
-
November 1st, 2006, 05:10 AM
#5
-
November 1st, 2006, 06:04 AM
#6
Re: Disable Alt + Space
it worked for me, thanks a lot..... thanks once again....
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
|