Melque_Lima Posted November 9, 2016 Share Posted November 9, 2016 hi, guys! i've create an hotket event "{enter}" that shows an msg box, i can not press enter to "OK", i have to click with mouse, i thought that if i stop the hot key event i'll be able to close the msg box with enter key! so, how do i do it? any ideas? Link to comment Share on other sites More sharing options...
j0kky Posted November 9, 2016 Share Posted November 9, 2016 (edited) HotKeySet("{ENTER}") Edited November 9, 2016 by j0kky Spoiler Some UDFs I created: Winsock UDF STUN UDF WinApi_GetAdaptersAddresses _WinApi_GetLogicalProcessorInformation Bitwise with 64 bit integers An useful collection of zipping file UDFs Link to comment Share on other sites More sharing options...
l3ill Posted November 9, 2016 Share Posted November 9, 2016 (edited) To close a message box with Enter the window has to be active and the default (usually OK) button has to be active. Make sure your script is following these rules Edited November 9, 2016 by l3ill My Contributions... SnippetBrowser NewSciTE PathFinder Text File Manipulation FTP Connection Tester / INI File - Read, Write, Save & Load Example Link to comment Share on other sites More sharing options...
l3ill Posted November 9, 2016 Share Posted November 9, 2016 A simple test: Alt + F4 will close the active window My Contributions... SnippetBrowser NewSciTE PathFinder Text File Manipulation FTP Connection Tester / INI File - Read, Write, Save & Load Example Link to comment Share on other sites More sharing options...
Charl Posted November 9, 2016 Share Posted November 9, 2016 You can use _IsPressed() instead HotKeySet(), see example below: #include #include Local $test = DllOpen("user32.dll") Local $a = 0; While 1 If (_IsPressed("0D", $test)) Then If ($a==0) Then MsgBox($MB_SYSTEMMODAL, "Ok", "Ok") $a=$a+1 Else $a=0; EndIf EndIf Sleep(50) WEnd Link to comment Share on other sites More sharing options...
spudw2k Posted November 14, 2016 Share Posted November 14, 2016 I 2nd @j0kky's suggestion. At the beginning of the function turn off the HotKey assoc. then re-apply at the end of the function (after the msgbox). Spoiler Things I've Made: Always On Top Tool ◊ AU History ◊ Deck of Cards ◊ HideIt ◊ ICU ◊ Icon Freezer ◊ Ipod Ejector ◊ Junos Configuration Explorer ◊ Link Downloader ◊ MD5 Folder Enumerator ◊ PassGen ◊ Ping Tool ◊ Quick NIC ◊ Read OCR ◊ RemoteIT ◊ SchTasksGui ◊ SpyCam ◊ System Scan Report Tool ◊ System UpTime ◊ Transparency Machine ◊ VMWare ESX Builder Misc Code Snippets: ADODB Example ◊ CheckHover ◊ Detect SafeMode ◊ DynEnumArray ◊ GetNetStatData ◊ HashArray ◊ IsBetweenDates ◊ Local Admins ◊ Make Choice ◊ Recursive File List ◊ Remove Sizebox Style ◊ Retrieve PNPDeviceID ◊ Retrieve SysListView32 Contents ◊ Set IE Homepage ◊ Tickle Expired Password ◊ Transpose Array Projects: Drive Space Usage GUI ◊ LEDkIT ◊ Plasma_kIt ◊ Scan Engine Builder ◊ SpeeDBurner ◊ SubnetCalc Cool Stuff: AutoItObject UDF ◊ Extract Icon From Proc ◊ GuiCtrlFontRotate ◊ Hex Edit Funcs ◊ Run binary ◊ Service_UDF Link to comment Share on other sites More sharing options...
232showtime Posted November 15, 2016 Share Posted November 15, 2016 unset the hotkey #include <GUIConstantsEx.au3> HotKeySet("{ENTER}", "MyFunc") While 1 Sleep(50) WEnd Func MyFunc() HotKeySet("{ENTER}") MsgBox(64, "Test", "Success") Exit EndFunc ;==>MyFunc ill get to that... i still need to learn and understand a lot of codes Correct answer, learn to walk before you take on that marathon. 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