liten Posted June 10, 2009 Posted June 10, 2009 Well, i have finished my script and i have all the higher challenged things down but the one thing i cant do is make an exit button, how, it earks me i can make a complete script but no Exit button, Please Help. My UDF:Freeze.au3-Freeze values like CE, ML, ETC[i][/i][u][/u]
TESTTH Posted June 10, 2009 Posted June 10, 2009 Well, i have finished my script and i have all the higher challenged things down but the one thing i cant do is make an exit button, how, it earks me i can make a complete script but no Exit button, Please Help. ? #include <GUIConstants.au3> ; $hGUI = GUICreate("Exit Button") $Exit = GUICtrlCreateButton ("Exit", 10, 30, 100) GUISetState () ; do $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $Exit Exit EndSelect until $msg = $GUI_EVENT_CLOSE
liten Posted June 10, 2009 Author Posted June 10, 2009 ? #include <GUIConstants.au3> ; $hGUI = GUICreate("Exit Button") $Exit = GUICtrlCreateButton ("Exit", 10, 30, 100) GUISetState () ; do $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $Exit Exit EndSelect until $msg = $GUI_EVENT_CLOSE That code dosent work for some reason. nothing happens when i click the button My UDF:Freeze.au3-Freeze values like CE, ML, ETC[i][/i][u][/u]
Yashied Posted June 10, 2009 Posted June 10, 2009 That code dosent work for some reason. nothing happens when i click the buttonThis works if you have not changed anything here. 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...
liten Posted June 10, 2009 Author Posted June 10, 2009 This works if you have not changed anything here.Hm, the only thing i seem to have edited was $sGUI to just $GUI, $Exit and $Button1(my exitbutton name) besides that i have changed nothing?coul dit be i need to use func x()or just us the do and be on, sorry i am confused My UDF:Freeze.au3-Freeze values like CE, ML, ETC[i][/i][u][/u]
Yashied Posted June 10, 2009 Posted June 10, 2009 Please post here your code. 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...
Inverted Posted June 10, 2009 Posted June 10, 2009 If you changed $Exit, I hope you also changed the line : Case $msg = $Exit
liten Posted June 10, 2009 Author Posted June 10, 2009 (edited) do $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $Button1 Exit EndSelect until $msg = $GUI_EVENT_CLOSE and also - which is at top of page almost with other GUICreate, GUI = GUICreate("Exit Button") and $Button1 = GUICtrlCreateButton("EXIT", 159, 56, 321, 129, $WS_GROUP, BitOR($WS_EX_CLIENTEDGE,$WS_EX_STATICEDGE)) GUISetState () GUICtrlSetFont(-1, 29, 400, 0, "MS Sans Serif") GUICtrlSetColor(-1, 0xB9D1EA) GUICtrlSetBkColor(-1, 0x000000) which is with all my other GUI things, Edited June 10, 2009 by liten My UDF:Freeze.au3-Freeze values like CE, ML, ETC[i][/i][u][/u]
Inverted Posted June 10, 2009 Posted June 10, 2009 Looks pretty correct to me. Are you sure the do ... until loop is being executed ?
liten Posted June 10, 2009 Author Posted June 10, 2009 Looks pretty correct to me. Are you sure the do ... until loop is being executed ?How would i find this out? My UDF:Freeze.au3-Freeze values like CE, ML, ETC[i][/i][u][/u]
rajeshontheweb Posted June 10, 2009 Posted June 10, 2009 there is a small possibility u might have used the $msg variable elsewhere which may not be corresponding to the constant value properly. u might want to try until GUIGetMsg() = $GUI_EVENT_CLOSE Started late is much better than having never started it!!!!Failure is another step towards success. I've been messing around with: Adding Entry to 'Hosts'File Information Lister (Logger)Yet Another AutoIT Error Handler Yet Another AutoIT Error Handler & Debugger Control your App's TaskBar Button YCurrency Ticker (Latest Release : 16 Apr 2009)_WinInetInternetCheckConnection UDF Symantec Definitions Lister UDF _GetLocalIPAddresses UDF UDF to get Special Folder Information WMI_NetworkAdapterConfiguration2Array WMI_CDRomDriveCapabilities _ScriptExists - Check if your au3 script is running!! Uninstaller UDF Get Version for your application (at script level or compiled stage) Uninstaller Pro - faster alternative to windows application removal applet
liten Posted June 10, 2009 Author Posted June 10, 2009 Sadly Still dosent work, is their any other way to make an exit button, like with _ispressed or something, if so please leave a code or explain to me so i can do it My UDF:Freeze.au3-Freeze values like CE, ML, ETC[i][/i][u][/u]
liten Posted June 10, 2009 Author Posted June 10, 2009 I also tried Func MS() SetPrivilege("SeDebugPrivilege", 1) $ID = _MemoryOpen(ProcessExists("Process.exe")) _MemoryWrite($CTT, $ID, GuiCtrlRead($Slider2)) While 1 MoveSpeed() Wend _MemoryClose($ID) EndFunc My UDF:Freeze.au3-Freeze values like CE, ML, ETC[i][/i][u][/u]
Inverted Posted June 10, 2009 Posted June 10, 2009 Wtf was that ... Post your whole script. Seems you keep doing weird stuff, no longer you can't make the simplest of things work.
Valuater Posted June 10, 2009 Posted June 10, 2009 (edited) I also tried Func MS() SetPrivilege("SeDebugPrivilege", 1) $ID = _MemoryOpen(ProcessExists("Process.exe")) _MemoryWrite($CTT, $ID, GuiCtrlRead($Slider2)) While 1 MoveSpeed() Wend _MemoryClose($ID) EndFunc I just told you yesterday.... you CAN NOT do this within the function (correctly) While 1 MoveSpeed() Wend 8) Edited June 10, 2009 by Valuater
liten Posted June 10, 2009 Author Posted June 10, 2009 (edited) Wtf was that ... Post your whole script. Seems you keep doing weird stuff, no longer you can't make the simplest of things work. expandcollapse popup#RequireAdmin #AutoIt3Wrapper_icon=ATX.ico #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <GUIListBox.au3> #include <SliderConstants.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <Nomadmemory.au3> #include <Array.au3> #include <memory.au3> #include <Inet.au3> #include <GUIConstants.au3> #Region WinWaitActive("Process") Opt('GUIOnEventMode', 1) ;#####################PAUSE AND ESCAPE################################################# Global $Paused HotKeySet("{PAUSE}", "TogglePause") HotKeySet("{ESC}", "Terminate") Global $hGUI Global $Radio1 Global $Radio2 Global $Radio3 Global $Radio4 Global $Slider1 Global $Slider2 Global $Button1 ;###########################GUI######################################################## $GUI = GUICreate("ExitButton", 300, 200) $hGUI = GUICreate('Test', 200, 200) GUISetOnEvent($GUI_EVENT_CLOSE, '_Close') $Form1_1 = GUICreate("XXXXXXX", 609, 463, 210, 211) $List1 = GUICtrlCreateList("", 7, 16, 113, 151, -1, BitOR($WS_EX_CLIENTEDGE,$WS_EX_STATICEDGE)) GUICtrlSetData(-1, "Free:No rights") GUICtrlSetCursor (-1, 7) $Li = GUICtrlCreateLabel("XXXXXXX", 135, 24, 380, 30, -1, BitOR($WS_EX_CLIENTEDGE,$GUI_WS_EX_PARENTDRAG)) GUICtrlSetFont(-1, 17, 400, 0, "MS Sans Serif") GUICtrlSetColor(-1, 0xFF0000) GUICtrlSetBkColor(-1, 0x000000) $Slider1 = GUICtrlCreateSlider(135, 216, 369, 17) GUICtrlSetOnEvent($Slider1, 'RadioSpeed3') GUICtrlSetLimit(-1, 250, 0) $Label1 = GUICtrlCreateLabel("AS", 127, 192, 69, 17) GUICtrlSetColor(-1, 0x99B4D1) GUICtrlSetBkColor(-1, 0x000000) $Checkbox1 = GUICtrlCreateCheckbox("checkbox1", 87, 216, 17, 17, -1, BitOR($WS_EX_CLIENTEDGE,$WS_EX_STATICEDGE)) GUICtrlSetBkColor(-1, 0xA0A0A4) $Edit = GUICtrlCreateEdit("", 135, 240, 369, 57, -1, BitOR($WS_EX_CLIENTEDGE,$WS_EX_STATICEDGE)) GUICtrlSetData(-1, "PUT NOTES AND VARIOUS THING YOU FIND AND WANT TO REMEMBER HERE:") $Button1 = GUICtrlCreateButton("EXIT", 159, 56, 321, 129, $WS_GROUP, BitOR($WS_EX_CLIENTEDGE,$WS_EX_STATICEDGE)) GUISetState () GUICtrlSetFont(-1, 29, 400, 0, "MS Sans Serif") GUICtrlSetColor(-1, 0xB9D1EA) GUICtrlSetBkColor(-1, 0x000000) $Label2 = GUICtrlCreateLabel("MS", 127, 320, 65, 17) GUICtrlSetColor(-1, 0x99B4D1) GUICtrlSetBkColor(-1, 0x000000) $Button2 = GUICtrlCreateButton("NB", 135, 344, 81, 17, $WS_GROUP) $Button3 = GUICtrlCreateButton("DS", 231, 344, 81, 17, $WS_GROUP) $Button4 = GUICtrlCreateButton("CTT", 423, 344, 81, 17, $WS_GROUP) GUICtrlSetFont(-1, 7, 400, 0, "Tahoma") $Button5 = GUICtrlCreateButton("Triple Speed", 327, 344, 81, 17, $WS_GROUP) $Slider2 = GUICtrlCreateSlider(135, 384, 369, 17) GUICtrlSetOnEvent($Slider2, 'RadioSpeed3') GUICtrlSetLimit(-1, 25000, 0) $Label3 = GUICtrlCreateLabel("on/off", 39, 216, 33, 17) GUICtrlSetColor(-1, 0x99B4D1) GUICtrlSetBkColor(-1, 0x000000) $List2 = GUICtrlCreateList("", 7, 248, 105, 175) GUICtrlSetData(-1, "Free:No rights") GUICtrlSetCursor (-1, 7) $List3 = GUICtrlCreateList("", 519, 16, 81, 409) GUICtrlSetData(-1, "Free:No rights") GUICtrlSetCursor (-1, 7) $List4 = GUICtrlCreateList("", 151, 408, 329, 45) GUICtrlSetData(-1, "Free:No rights to distribute, or use this porgram,") $Radio1 = GUICtrlCreateRadio("Radio1", 168, 360, 17, 17) GUICtrlSetOnEvent($Radio1, 'RadioSpeed1') GUICtrlSetBkColor(-1, 0x000000) $Radio2 = GUICtrlCreateRadio("Radio2", 264, 360, 17, 17) GUICtrlSetOnEvent($Radio2, 'RadioSpeed2') GUICtrlSetBkColor(-1, 0x000000) $Radio3 = GUICtrlCreateRadio("Radio3", 360, 360, 17, 17) GUICtrlSetOnEvent($Radio3, 'RadioSpeed3') GUICtrlSetBkColor(-1, 0x000000) $Radio4 = GUICtrlCreateRadio("Radio4", 456, 360, 17, 17) GUICtrlSetOnEvent($Radio4, 'RadioSpeed4') GUICtrlSetBkColor(-1, 0x000000) $Pic1 = GUICtrlCreatePic("important\BKG.jpg", 0, 0, 609, 465, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS)) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### ;############################Addresses################################### $AS = 0x00B8451B $CTT = 0x00B5EF18 ;##########################GUI FUNCTIONS########################### Func Protect() While 1 If BitAnd(GUICtrlRead($Checkbox1), $GUI_CHECKED) = $GUI_CHECKED Then GUICtrlSetState($Slider2, $GUI_DISABLE) GUICtrlSetState($Slider1, $GUI_DISABLE) GUICtrlSetState($Radio1, $GUI_ENABLE) GUICtrlSetState($Radio2, $GUI_ENABLE) GUICtrlSetState($Radio3, $GUI_ENABLE) GUICtrlSetState($Radio4, $GUI_ENABLE) Else GUICtrlSetState($Slider2, $GUI_ENABLE) GUICtrlSetState($Slider1, $GUI_ENABLE) GUICtrlSetState($Radio1, $GUI_DISABLE) GUICtrlSetState($Radio2, $GUI_DISABLE) GUICtrlSetState($Radio3, $GUI_DISABLE) GUICtrlSetState($Radio4, $GUI_DISABLE) EndIf WEnd EndFunc Func RadioSpeed1() SetPrivilege("SeDebugPrivilege", 1) $ID = _MemoryOpen(ProcessExists("Process.exe")) If BitAnd(GUICtrlRead($Radio1), $GUI_CHECKED) = $GUI_CHECKED Then _MemoryWrite($CTT, $ID, 0) EndIf _MemoryClose($ID) EndFunc Func RadioSpeed2() SetPrivilege("SeDebugPrivilege", 1) $ID = _MemoryOpen(ProcessExists("Process.exe")) If BitAnd(GUICtrlRead($Radio2), $GUI_CHECKED) = $GUI_CHECKED Then _MemoryWrite($CTT, $ID, 200) EndIf _MemoryClose($ID) EndFunc Func RadioSpeed3() SetPrivilege("SeDebugPrivilege", 1) $ID = _MemoryOpen(ProcessExists("Process.exe")) If BitAnd(GUICtrlRead($Radio3), $GUI_CHECKED) = $GUI_CHECKED Then _MemoryWrite($CTT, $ID, 300) EndIf _MemoryClose($ID) EndFunc Func RadioSpeed4() SetPrivilege("SeDebugPrivilege", 1) $ID = _MemoryOpen(ProcessExists("Process.exe")) If BitAnd(GUICtrlRead($Radio4), $GUI_CHECKED) = $GUI_CHECKED Then _MemoryWrite($CTT, $ID, 25000) EndIf _MemoryClose($ID) EndFunc Func _Close() GUIDelete() Exit EndFunc ;###############################Sliders####################################################### Func AS() SetPrivilege("SeDebugPrivilege", 1) $ID = _MemoryOpen(ProcessExists("Program.exe")) _MemoryWrite($AS, $ID, GuiCtrlRead($Slider1)) _MemoryClose($ID) EndFunc Func MS() SetPrivilege("SeDebugPrivilege", 1) $ID = _MemoryOpen(ProcessExists("program.exe")) _MemoryWrite($CTT, $ID, GuiCtrlRead($Slider2)) _MemoryClose($ID) EndFunc ;###################################WHILE ONE REPEAT########################################### While 1 Protect() RadioSpeed1() RadioSpeed2() RadioSpeed3() RadioSpeed4() MS() AS() Wend ;###############################EXIT BUTTON############################ Do $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $Button1 Exit EndSelect until $msg = $GUI_EVENT_CLOSE ;############################END OF EXIT BUTTON########## ################# While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Func TogglePause() $Paused = Not $Paused While $Paused Sleep(100) ToolTip('" PAUSED"', 512, 15) WEnd ToolTip("") EndFunc ;==>TogglePause Func Terminate() ToolTip('"Exiting"', 512, 15) Sleep(1000) ToolTip("") Exit 0 EndFunc ;==>Terminate Edited June 10, 2009 by liten My UDF:Freeze.au3-Freeze values like CE, ML, ETC[i][/i][u][/u]
liten Posted June 10, 2009 Author Posted June 10, 2009 I just told you yesterday.... you CAN NOT do this within the function (correctly) While 1 MoveSpeed() Wend8)Even without the while, it dosent work, that was ust another option i was trying My UDF:Freeze.au3-Freeze values like CE, ML, ETC[i][/i][u][/u]
Valuater Posted June 10, 2009 Posted June 10, 2009 ok 1 You can not combine "OnEventMode" with GUIGetMsg() 2 There are no on event functions set to the button 3 When creating a GUI only use GUISetState() once ... There are probably more probs, but thats a start 8)
liten Posted June 30, 2009 Author Posted June 30, 2009 So whats a SIMPLE button script one that has all that you said, OMG i FAIL at buttons, ... My UDF:Freeze.au3-Freeze values like CE, ML, ETC[i][/i][u][/u]
picea892 Posted June 30, 2009 Posted June 30, 2009 #include <GUIConstantsEx.au3> #include <ButtonConstants.au3> Example() Func Example() Local $Button_1, $Button_2, $msg GUICreate("My GUI Button"); will create a dialog box that when displayed is centered Opt("GUICoordMode", 2) $Button_1 = GUICtrlCreateButton("Exit", 10, 30, 100) $Button_2 = GUICtrlCreateButton("Button Test", 10,50, -1,$BS_BITMAP) GUICtrlSetImage(-1, "shell32.dll", 22) GUISetState() ; will display an dialog box with 2 button ; Run the GUI until the dialog is closed While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $Button_1 ExitLoop Case $msg = $Button_2 MsgBox(0, 'Testing', 'Button 2 was pressed') ; Will demonstrate Button 2 being pressed EndSelect WEnd EndFunc ;==>Example
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