singcang Posted July 17, 2018 Share Posted July 17, 2018 (edited) Hello, I have read a lot of topic about this , but still not work on my code sorry, i'm newbie. I want Set Hotkey Stop ( F4) and Start ( F5) while loop , this is my code : expandcollapse popup#include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <GuiStatusBar.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <AutoItConstants.au3> #include <MsgBoxConstants.au3> #Region ### START Koda GUI section ### Form= $Auto = GUICreate("xxxxxx", 626, 282, 203, 114) Global $link1 = GUICtrlCreateLabel("xxx link", 16, 16, 96, 23) GUICtrlSetFont(-1, 12, 400, 0, "Tahoma") Global $linkinput = GUICtrlCreateInput("", 144, 16, 473, 21) Global $Start = GUICtrlCreateButton("Start", 432, 104, 161, 41) GUICtrlSetFont(-1, 12, 800, 0, "Tahoma") Global $Exit = GUICtrlCreateButton("Exit", 432, 160, 161, 41) GUICtrlSetFont(-1, 12, 800, 0, "Tahoma") $Label1 = GUICtrlCreateLabel(" xxx v1.0", 232, 216, 186, 17) $Label2 = GUICtrlCreateLabel("xxx", 16, 112, 121, 23) GUICtrlSetFont(-1, 12, 400, 0, "Tahoma") Global $numberofplayinput = GUICtrlCreateInput("", 147, 112, 89, 21) Global $StatusBar1 = _GUICtrlStatusBar_Create($Auto) _GUICtrlStatusBar_SetMinHeight($StatusBar1, 33) Global $link2 = GUICtrlCreateLabel("xxx link 2", 16, 60, 110, 23) GUICtrlSetFont(-1, 12, 400, 0, "Tahoma") Global $linkinput2 = GUICtrlCreateInput("", 142, 57, 473, 21) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Start $SaveLinkFromUser = GUICtrlRead($linkinput) StartChrome() Case $Exit Exit 0 EndSwitch WEnd Func StartChrome() ;my code While $number $number -= 1 ;my code WEnd EndFunc Thanks all ! Edited July 17, 2018 by singcang Link to comment Share on other sites More sharing options...
careca Posted July 17, 2018 Share Posted July 17, 2018 There are a couple ways of doing it, but the way i would do it, would be by having _ispressed and conditions in the main loop. singcang 1 Spoiler Renamer - Rename files and folders, remove portions of text from the filename etc. GPO Tool - Export/Import Group policy settings. MirrorDir - Synchronize/Backup/Mirror Folders BeatsPlayer - Music player. Params Tool - Right click an exe to see it's parameters or execute them. String Trigger - Triggers pasting text or applications or internet links on specific strings. Inconspicuous - Hide files in plain sight, not fully encrypted. Regedit Control - Registry browsing history, quickly jump into any saved key. Time4Shutdown - Write the time for shutdown in minutes. Power Profiles Tool - Set a profile as active, delete, duplicate, export and import. Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes. NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s. IUIAutomation - Topic with framework and examples Au3Record.exe Link to comment Share on other sites More sharing options...
Herford Posted July 17, 2018 Share Posted July 17, 2018 (edited) On 7/17/2018 at 7:11 AM, careca said: There are a couple ways of doing it, but the way i would do it, would be by checking out weight loss pills for men here and having _ispressed and conditions in the main loop. Can you elaborate by any chance please, Careca? It looks like this would be useful for me too. Edited April 5, 2023 by Herford Link to comment Share on other sites More sharing options...
singcang Posted July 17, 2018 Author Share Posted July 17, 2018 10 hours ago, careca said: There are a couple ways of doing it, but the way i would do it, would be by having _ispressed and conditions in the main loop. this is code follow your reply , press F4 or F5 but nothing happend expandcollapse popup#include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <GuiStatusBar.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <AutoItConstants.au3> #include <MsgBoxConstants.au3> #include <Misc.au3> #Region ### START Koda GUI section ### Form= $Auto = GUICreate("xxx", 626, 282, 203, 114) Global $link1 = GUICtrlCreateLabel("xxx", 16, 16, 96, 23) GUICtrlSetFont(-1, 12, 400, 0, "Tahoma") Global $linkinput = GUICtrlCreateInput("", 144, 16, 473, 21) Global $Start = GUICtrlCreateButton("Start", 432, 104, 161, 41) GUICtrlSetFont(-1, 12, 800, 0, "Tahoma") Global $Exit = GUICtrlCreateButton("Exit", 432, 160, 161, 41) GUICtrlSetFont(-1, 12, 800, 0, "Tahoma") $Label1 = GUICtrlCreateLabel("xxx", 232, 216, 186, 17) $Label2 = GUICtrlCreateLabel("xxx", 16, 112, 121, 23) GUICtrlSetFont(-1, 12, 400, 0, "Tahoma") Global $numberofplayinput = GUICtrlCreateInput("", 147, 112, 89, 21) Global $StatusBar1 = _GUICtrlStatusBar_Create($Auto) _GUICtrlStatusBar_SetMinHeight($StatusBar1, 33) Global $link2 = GUICtrlCreateLabel("xxx", 16, 60, 110, 23) GUICtrlSetFont(-1, 12, 400, 0, "Tahoma") Global $linkinput2 = GUICtrlCreateInput("", 142, 57, 473, 21) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Start $SaveLinkFromUser = GUICtrlRead($linkinput) StartChrome() Case $Exit Exit EndSwitch WEnd Func StartChrome() ShellExecute("chrome.exe",$SaveLinkFromUser, "--start-maximized") Sleep(6000) $number = GUICtrlRead($numberofplayinput) Global $hDLL = DllOpen("user32.dll") While $number $number -= 1 If _IsPressed("73", $hDLL) Then ; my code While _IsPressed("73", $hDLL) Sleep(250) WEnd ElseIf _IsPressed("74", $hDLL) Then MsgBox($MB_SYSTEMMODAL, "_IsPressed", "The F5 Key was pressed, therefore we will close the application.") ExitLoop EndIf Sleep(250) WEnd DllClose($hDLL) EndFunc Link to comment Share on other sites More sharing options...
singcang Posted July 17, 2018 Author Share Posted July 17, 2018 @careca i need you help, sorry to buzz you Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted July 17, 2018 Moderators Share Posted July 17, 2018 singcang, Please do not bump your own threads within 24 hours. Remember this is not a 24/7 support forum - those who answer are only here because they like helping others and have some time to spare. You just have to wait until someone who knows something about your particular problem, and is willing to help, comes online - so please be patient. M23 singcang 1 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
JuanFelipe Posted July 17, 2018 Share Posted July 17, 2018 15 hours ago, singcang said: Hello, I have read a lot of topic about this , but still not work on my code sorry, i'm newbie. I want Set Hotkey Stop ( F4) and Start ( F5) while loop , this is my code : expandcollapse popup#include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <GuiStatusBar.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <AutoItConstants.au3> #include <MsgBoxConstants.au3> #Region ### START Koda GUI section ### Form= $Auto = GUICreate("xxxxxx", 626, 282, 203, 114) Global $link1 = GUICtrlCreateLabel("xxx link", 16, 16, 96, 23) GUICtrlSetFont(-1, 12, 400, 0, "Tahoma") Global $linkinput = GUICtrlCreateInput("", 144, 16, 473, 21) Global $Start = GUICtrlCreateButton("Start", 432, 104, 161, 41) GUICtrlSetFont(-1, 12, 800, 0, "Tahoma") Global $Exit = GUICtrlCreateButton("Exit", 432, 160, 161, 41) GUICtrlSetFont(-1, 12, 800, 0, "Tahoma") $Label1 = GUICtrlCreateLabel(" xxx v1.0", 232, 216, 186, 17) $Label2 = GUICtrlCreateLabel("xxx", 16, 112, 121, 23) GUICtrlSetFont(-1, 12, 400, 0, "Tahoma") Global $numberofplayinput = GUICtrlCreateInput("", 147, 112, 89, 21) Global $StatusBar1 = _GUICtrlStatusBar_Create($Auto) _GUICtrlStatusBar_SetMinHeight($StatusBar1, 33) Global $link2 = GUICtrlCreateLabel("xxx link 2", 16, 60, 110, 23) GUICtrlSetFont(-1, 12, 400, 0, "Tahoma") Global $linkinput2 = GUICtrlCreateInput("", 142, 57, 473, 21) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Start $SaveLinkFromUser = GUICtrlRead($linkinput) StartChrome() Case $Exit Exit 0 EndSwitch WEnd Func StartChrome() ;my code While $number $number -= 1 ;my code WEnd EndFunc Thanks all ! HotKeySet("f4",namefunc) HotKeySet("f5",_ExitLoop) Func _ExitLoop() ExitLoop EndFunc Try this, ando tell me 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