adamski Posted September 6, 2009 Posted September 6, 2009 Hello, How can I prevent the right click menu from displaying when the GUI title bar, icon, minimise and maximise/restore buttons are right clicked? Nothing happens when you right click the close button, and that is what I am after for the rest of the title bar. Thanks.
Yashied Posted September 6, 2009 Posted September 6, 2009 expandcollapse popup#Include <WindowsConstants.au3> #Include <GUIConstantsEx.au3> Global Const $SC_KEYMENU = 0xF100 $hForm = GUICreate('MyGUI') GUIRegisterMsg($WM_NCLBUTTONDBLCLK, 'WM_NCLBUTTONDBLCLK') GUIRegisterMsg($WM_NCLBUTTONDOWN, 'WM_NCLBUTTONDOWN') GUIRegisterMsg($WM_NCRBUTTONDOWN, 'WM_NCRBUTTONDOWN') GUIRegisterMsg($WM_SYSCOMMAND, 'WM_SYSCOMMAND') GUISetState() Do Until GUIGetMsg() = -3 Func WM_NCLBUTTONDBLCLK($hWnd, $iMsg, $wParam, $lParam) Switch $wParam Case 0x03 Return 0 EndSwitch Return $GUI_RUNDEFMSG EndFunc ;==>WM_NCLBUTTONDBLCLK Func WM_NCLBUTTONDOWN($hWnd, $iMsg, $wParam, $lParam) Switch $wParam Case 0x03 Return 0 EndSwitch Return $GUI_RUNDEFMSG EndFunc ;==>WM_NCLBUTTONDOWN Func WM_NCRBUTTONDOWN($hWnd, $iMsg, $wParam, $lParam) Switch $wParam Case 0x02, 0x03 Return 0 EndSwitch Return $GUI_RUNDEFMSG EndFunc ;==>WM_NCRBUTTONDOWN Func WM_SYSCOMMAND($hWnd, $iMsg, $wParam, $lParam) Switch $wParam Case $SC_KEYMENU Return 0 EndSwitch Return $GUI_RUNDEFMSG EndFunc ;==>WM_SYSCOMMAND My UDFs: iKey | FTP Uploader | Battery Checker | Boot Manager | Font Viewer | UDF Keyword Manager | Run Dialog Replacement | USBProtect | 3D Axis | Calculator | Sleep | iSwitcher | TM | NetHelper | File Types Manager | Control Viewer | SynFolders | DLL Helper Animated Tray Icons UDF Library | Hotkeys UDF Library | Hotkeys Input Control UDF Library | Caret Shape UDF Library | Context Help UDF Library | Most Recently Used List UDF Library | Icons UDF Library | FTP UDF Library | Script Communications UDF Library | Color Chooser UDF Library | Color Picker Control UDF Library | IPHelper (Vista/7) UDF Library | WinAPI Extended UDF Library | WinAPIVhd UDF Library | Icon Chooser UDF Library | Copy UDF Library | Restart UDF Library | Event Log UDF Library | NotifyBox UDF Library | Pop-up Windows UDF Library | TVExplorer UDF Library | GuiHotKey UDF Library | GuiSysLink UDF Library | Package UDF Library | Skin UDF Library | AITray UDF Library | RDC UDF Library Appropriate path | Button text color | Gaussian random numbers | Header's styles (Vista/7) | ICON resource enumeration | Menu & INI | Tabbed string size | Tab's skin | Pop-up circular menu | Progress Bar without animation (Vista/7) | Registry export | Registry path jumping | Unique hardware ID | Windows alignment More...
adamski Posted September 6, 2009 Author Posted September 6, 2009 Thanks Yashied, The menu still appears when right clicking the max/minimise buttons, but many thanks.
Yashied Posted September 6, 2009 Posted September 6, 2009 Thanks Yashied, The menu still appears when right clicking the max/minimise buttons, but many thanks. expandcollapse popup#Include <WindowsConstants.au3> #Include <GUIConstantsEx.au3> Global Const $SC_KEYMENU = 0xF100 $hForm = GUICreate('MyGUI') GUIRegisterMsg($WM_NCLBUTTONDBLCLK, 'WM_NCLBUTTONDBLCLK') GUIRegisterMsg($WM_NCLBUTTONDOWN, 'WM_NCLBUTTONDOWN') GUIRegisterMsg($WM_NCRBUTTONDOWN, 'WM_NCRBUTTONDOWN') GUIRegisterMsg($WM_SYSCOMMAND, 'WM_SYSCOMMAND') GUISetState() Do Until GUIGetMsg() = -3 Func WM_NCLBUTTONDBLCLK($hWnd, $iMsg, $wParam, $lParam) Switch $wParam Case 0x03 Return 0 EndSwitch Return $GUI_RUNDEFMSG EndFunc ;==>WM_NCLBUTTONDBLCLK Func WM_NCLBUTTONDOWN($hWnd, $iMsg, $wParam, $lParam) Switch $wParam Case 0x03 Return 0 EndSwitch Return $GUI_RUNDEFMSG EndFunc ;==>WM_NCLBUTTONDOWN Func WM_NCRBUTTONDOWN($hWnd, $iMsg, $wParam, $lParam) Switch $wParam Case 0x02, 0x03, 0x08, 0x09, 0x14, 0x15 Return 0 EndSwitch Return $GUI_RUNDEFMSG EndFunc ;==>WM_NCRBUTTONDOWN Func WM_SYSCOMMAND($hWnd, $iMsg, $wParam, $lParam) Switch $wParam Case $SC_KEYMENU Return 0 EndSwitch Return $GUI_RUNDEFMSG EndFunc ;==>WM_SYSCOMMAND My UDFs: iKey | FTP Uploader | Battery Checker | Boot Manager | Font Viewer | UDF Keyword Manager | Run Dialog Replacement | USBProtect | 3D Axis | Calculator | Sleep | iSwitcher | TM | NetHelper | File Types Manager | Control Viewer | SynFolders | DLL Helper Animated Tray Icons UDF Library | Hotkeys UDF Library | Hotkeys Input Control UDF Library | Caret Shape UDF Library | Context Help UDF Library | Most Recently Used List UDF Library | Icons UDF Library | FTP UDF Library | Script Communications UDF Library | Color Chooser UDF Library | Color Picker Control UDF Library | IPHelper (Vista/7) UDF Library | WinAPI Extended UDF Library | WinAPIVhd UDF Library | Icon Chooser UDF Library | Copy UDF Library | Restart UDF Library | Event Log UDF Library | NotifyBox UDF Library | Pop-up Windows UDF Library | TVExplorer UDF Library | GuiHotKey UDF Library | GuiSysLink UDF Library | Package UDF Library | Skin UDF Library | AITray UDF Library | RDC UDF Library Appropriate path | Button text color | Gaussian random numbers | Header's styles (Vista/7) | ICON resource enumeration | Menu & INI | Tabbed string size | Tab's skin | Pop-up circular menu | Progress Bar without animation (Vista/7) | Registry export | Registry path jumping | Unique hardware ID | Windows alignment More...
adamski Posted September 6, 2009 Author Posted September 6, 2009 GUIRegisterMsg($WM_NCLBUTTONDBLCLK, 'WM_NCLBUTTONDBLCLK')GUIRegisterMsg($WM_NCLBUTTONDOWN, 'WM_NCLBUTTONDOWN')GUIRegisterMsg($WM_NCRBUTTONDOWN, 'WM_NCRBUTTONDOWN')GUIRegisterMsg($WM_SYSCOMMAND, 'WM_SYSCOMMAND')Thanks again!Do I need WM_NCLBUTTONDBLCLK, WM_NCLBUTTONDOWN and WM_SYSCOMMAND? It appears to work OK when I comment these out.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now