Yashied Posted April 16, 2009 Share Posted April 16, 2009 (edited) Hold down a few seconds any key and then click mouse on close button. ??? #Include <WinAPI.au3> global $hProc = DllCallbackRegister('_MyHook', 'long', 'int;wparam;lparam') global $hHook = _WinAPI_SetWindowsHookEx($WH_KEYBOARD_LL, DllCallbackGetPtr($hProc), _WinAPI_GetModuleHandle(0), 0) GUICreate('Bug') GUICtrlCreateLabel('Hold down a few seconds any key and then click mouse on close button.', 20, 20) GUISetState() do until GUIGetMsg() = -3 func _MyHook($iCode, $wParam, $lParam) return _WinAPI_CallNextHookEx($hHook, $iCode, $wParam, $lParam) endfunc; _MyHook func OnAutoItExit() ConsoleWrite('Call _WinAPI_UnhookWindowsHookEx()') _WinAPI_UnhookWindowsHookEx($hHook) endfunc; OnAutoItExit Edited April 16, 2009 by Yashied 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... Link to comment Share on other sites More sharing options...
Authenticity Posted April 16, 2009 Share Posted April 16, 2009 ...And what is the problem? Link to comment Share on other sites More sharing options...
Yashied Posted April 16, 2009 Author Share Posted April 16, 2009 ...And what is the problem?My computer hangs for several seconds. And ONLY if I click on the close button. 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... Link to comment Share on other sites More sharing options...
rover Posted April 16, 2009 Share Posted April 16, 2009 (edited) try adding DllCallbackFree($hProc) to OnAutoItExit()your script wouldn't hang for me , but I do have a mousehook example that momentarily hangs on gui close very timeEdit o.k. I got it to hang by holding down keys while clicking close buttonmore like 30 seconds of hung pc for meproblem is probably caused by installing system hook, not DllCallbackRegister Edited April 16, 2009 by rover I see fascists... Link to comment Share on other sites More sharing options...
Authenticity Posted April 16, 2009 Share Posted April 16, 2009 So compile it first and then check if the mouse procedure will hang. Link to comment Share on other sites More sharing options...
Yashied Posted April 16, 2009 Author Share Posted April 16, 2009 try adding DllCallbackFree($hProc) to OnAutoItExit()your script wouldn't hang for me , but I do have a mousehook example that momentarily hangs on gui close very timeThe script hangs up to call OnAutoItExit(). 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... Link to comment Share on other sites More sharing options...
Yashied Posted April 16, 2009 Author Share Posted April 16, 2009 Edit o.k. I got it to hang by holding down keys while clicking close buttonmore like 30 seconds of hung pc for meproblem is probably caused by installing system hook, not DllCallbackRegisterI think this is due to the GUI. 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... Link to comment Share on other sites More sharing options...
rover Posted April 16, 2009 Share Posted April 16, 2009 try _WinAPI_FreeLibrary($hmod) in OnAutoItExit I see fascists... Link to comment Share on other sites More sharing options...
Yashied Posted April 16, 2009 Author Share Posted April 16, 2009 Minimize button also to hang the computer. 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... Link to comment Share on other sites More sharing options...
Yashied Posted April 19, 2009 Author Share Posted April 19, 2009 I solve the problem is not the best way. expandcollapse popup#Include <WinAPI.au3> global $hProc = DllCallbackRegister('_MyHook', 'long', 'int;wparam;lparam') global $hHook = _WinAPI_SetWindowsHookEx($WH_KEYBOARD_LL, DllCallbackGetPtr($hProc), _WinAPI_GetModuleHandle(0), 0) GUICreate('Bug') GUIRegisterMsg(0x00A1, 'WM_NCLBUTTONDOWN') GUICtrlCreateLabel('Hold down a few seconds any key and then click mouse on close button.', 20, 20) GUISetState() do until GUIGetMsg() = -3 func _MyHook($iCode, $wParam, $lParam) return _WinAPI_CallNextHookEx($hHook, $iCode, $wParam, $lParam) endfunc; _MyHook func _HoldDown() local $Ret, $tState = DllStructCreate('byte[256]') $Ret = DllCall('user32.dll', 'int', 'GetKeyboardState', 'ptr', DllStructGetPtr($tState)) if (@error) or ($Ret[0] = 0) then return SetError(1, 0, 0) endif for $i = 0x08 to 0xFF switch $i case 0x0A, 0x0B, 0x0E to 0x0F, 0x16, 0x1A, 0x1C to 0x1F, 0x3A to 0x40, 0x5E, 0x88 to 0x8F, 0x97 to 0x9F, 0xB8 to 0xB9, 0xC1 to 0xDA, 0xE0, 0xE8 continueloop case else if BitAND(DllStructGetData($tState, 1, $i + 1), 0xF0) > 0 then return 1 endif endswitch next return 0 endfunc; _HoldDown func WM_NCLBUTTONDOWN($hWnd, $msgID, $wParam, $lParam) switch $wParam case 0x08, 0x09, 0x14, 0x15 if _HoldDown() then return 0 endif endswitch return 'GUI_RUNDEFMSG' endfunc; WM_NCLBUTTONDOWN func OnAutoItExit() ConsoleWrite('Call _WinAPI_UnhookWindowsHookEx()') _WinAPI_UnhookWindowsHookEx($hHook) endfunc; OnAutoItExit 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... Link to comment Share on other sites More sharing options...
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