Leaderboard
Popular Content
Showing content with the highest reputation on 06/18/2014 in all areas
-
Try now: #include <GUIConstantsEx.au3> #include <WinAPIGdi.au3> #include <WindowsConstants.au3> #include <StaticConstants.au3> ;coded by taietel #cs <----------------------- $iW -----------------------> | | $iH | | - <--------- $w -------><--- $r ---> | | $p | | - #ce $iW=500 $iFont=12 $iH=$iFont+4+20 $bExpand=True $iNoIcnsExpand=3 $w=$iNoIcnsExpand*($iFont+4+10) $p=25 $r=20 $iDelay=2 $iIcnExit="r" $iIcnCfg="@" $iIcnInfo="i" $iIcnUp="5" $iIcnDown="6" $iIcnSep="|" $iIcnChk="a" $iIcnFull="1" ; Create GUI Local $hForm = GUICreate("Test", $iW, $iH+$p, (@DesktopWidth-$iW+$w+$r)/2, -$iH, $WS_POPUP, $WS_EX_TOPMOST) GUISetBkColor(0xdedede) ;------- Put some stuff on GUI ---------- $hExit = GUICtrlCreateLabel($iIcnExit, 5, $iH-($iFont+4)-10, $iFont+4, $iFont+4, BitOR($SS_CENTER,$SS_CENTERIMAGE)) GUICtrlSetFont(-1, $iFont, 400, 0, "Webdings",5) GUICtrlSetColor(-1, 0x505050) GUICtrlSetCursor(-1,0) GUICtrlSetTip(-1,"Exit") GUICtrlCreateLabel($iIcnSep, 5+$iFont+4, $iH-($iFont+4)-10, $iFont+4, $iFont+4, BitOR($SS_CENTER,$SS_CENTERIMAGE)) GUICtrlSetFont(-1, $iFont, 400, 0, "Webdings",5) GUICtrlSetColor(-1, 0x909090) $hSomeStuff = GUICtrlCreateLabel($iIcnCfg, 5+2*($iFont+4), $iH-($iFont+4)-10, $iFont+4, $iFont+4, BitOR($SS_CENTER,$SS_CENTERIMAGE)) GUICtrlSetFont(-1, $iFont, 400, 0, "Webdings",5) GUICtrlSetColor(-1, 0x505050) $hSomeStuff_l=GUICtrlCreateLabel("Some stuff", 5+3*($iFont+4), $iH-($iFont+4)-10, 80, $iFont+4, BitOR($SS_CENTER,$SS_CENTERIMAGE)) GUICtrlSetFont(-1, $iFont, 400, 0, "Arial",5) GUICtrlSetColor(-1, 0x505050) $hSomeStuffA = GUICtrlCreateLabel($iIcnDown, 5+3*($iFont+4)+80, $iH-($iFont+4)-10, $iFont+4, $iFont+4, BitOR($SS_CENTER,$SS_CENTERIMAGE)) GUICtrlSetFont(-1, $iFont-2, 400, 0, "Webdings",5) GUICtrlSetColor(-1, 0x505050) GUICtrlSetCursor(-1,0) $DummyMenu = GUICtrlCreateDummy() $hContextMenu = GUICtrlCreateContextMenu($DummyMenu) $mnuSomeStuff = GUICtrlCreateMenuItem("Some Item", $hContextMenu) $mnuExit = GUICtrlCreateMenuItem("Exit", $hContextMenu) GUICtrlCreateLabel($iIcnSep, 5+4*($iFont+4)+80-5, $iH-($iFont+4)-10, $iFont+4, $iFont+4, BitOR($SS_CENTER,$SS_CENTERIMAGE)) GUICtrlSetFont(-1, $iFont, 400, 0, "Webdings",5) GUICtrlSetColor(-1, 0x909090) GUICtrlCreateLabel($iIcnInfo, 5+5*($iFont+4)+80, $iH-($iFont+4)-10, $iFont+4, $iFont+4, BitOR($SS_CENTER,$SS_CENTERIMAGE)) GUICtrlSetFont(-1, $iFont, 400, 0, "Webdings",5) GUICtrlSetColor(-1, 0x505050) $hAbout = GUICtrlCreateLabel("About", 5+6*($iFont+4)+80, $iH-($iFont+4)-10, 60, $iFont+4, BitOR($SS_CENTER,$SS_CENTERIMAGE)) GUICtrlSetFont(-1, $iFont, 400, 0, "Arial",5) GUICtrlSetColor(-1, 0x505050) GUICtrlSetCursor(-1,0) GUICtrlSetTip(-1,"About this program...") GUICtrlCreateLabel($iIcnSep, 5+6*($iFont+4)+80+60, $iH-($iFont+4)-10, $iFont+4, $iFont+4, BitOR($SS_CENTER,$SS_CENTERIMAGE)) GUICtrlSetFont(-1, $iFont, 400, 0, "Webdings",5) GUICtrlSetColor(-1, 0x909090) ;------- end some stuff on GUI ---------- $hExpand = GUICtrlCreateLabel($iIcnDown, $iW-$r-$w/4-($iFont+4)/2, $iH+($p-($iFont+4))/2, $iFont+4, $iFont+4, BitOR($SS_CENTER,$SS_CENTERIMAGE)) GUICtrlSetFont(-1, $iFont, 400, 0, "Webdings",5) GUICtrlSetColor(-1, 0x505050) GUICtrlSetCursor(-1,0) GUICtrlSetTip(-1,"Expand") GUICtrlCreateLabel($iIcnSep, $iW-$r-2*$w/4-($iFont+4)/2, $iH+($p-($iFont+4))/2, $iFont+4, $iFont+4, BitOR($SS_CENTER,$SS_CENTERIMAGE)) GUICtrlSetFont(-1, $iFont, 400, 0, "Webdings",5) GUICtrlSetColor(-1, 0x909090) $hFullScreen = GUICtrlCreateLabel($iIcnFull, $iW-$r-3*$w/4-($iFont+4)/2, $iH+($p-($iFont+4))/2, $iFont+4, $iFont+4, BitOR($SS_CENTER,$SS_CENTERIMAGE)) GUICtrlSetFont(-1, $iFont, 400, 0, "Webdings",5) GUICtrlSetCursor(-1,0) GUICtrlSetTip(-1,"Full Screen") GUICtrlSetColor(-1, 0x505050) Local $hRgn = _WinAPI_CreateRectRgn (0, 0, $iW-1, $iH/2) Local $hRgn1 = _WinAPI_CreateRoundRectRgn(0, 0, $iW, $iH, 7, 7) Local $hRgn2 = _WinAPI_CreateRoundRectRgn($iW-$r-$w, 2, $iW-$r, $iH+$p, 7, 7) _WinAPI_CombineRgn($hRgn, $hRgn, $hRgn1, $RGN_OR) _WinAPI_CombineRgn($hRgn, $hRgn, $hRgn2, $RGN_OR) _WinAPI_DeleteObject($hRgn1) _WinAPI_DeleteObject($hRgn2) _WinAPI_SetWindowRgn($hForm, $hRgn, 1) GUISetState(@SW_SHOW) While 1 Switch GUIGetMsg() Case $hExit, $mnuExit Exit Case $hFullScreen MsgBox(0,"","Here you'll have to put the code for full screen mode.") Case $hAbout MsgBox(0,"","Here you'll have to put the code for About message.") Case $hExpand If $bExpand Then GUICtrlSetData($hExpand,$iIcnUp) WinMove($hForm, "", (@DesktopWidth-$iW+$w+$r)/2, 0, $iW, $iH+$p,$iDelay) GUICtrlSetTip($hExpand,"Retract") $bExpand=False Else GUICtrlSetData($hExpand,$iIcnDown) WinMove($hForm, "", (@DesktopWidth-$iW+$w+$r)/2, -$iH, $iW, $iH+$p,$iDelay) GUICtrlSetTip($hExpand,"Expand") $bExpand=True EndIf Case $hSomeStuffA, $hSomeStuff_l ShowMenu($hForm, $hContextMenu, $hSomeStuff) EndSwitch WEnd Func ShowMenu($hWnd, $nContextID, $nContextControlID, $iMouse=0) Local $hMenu = GUICtrlGetHandle($nContextID) Local $iCtrlPos = ControlGetPos($hWnd, "", $nContextControlID) Local $X = $iCtrlPos[0] Local $Y = $iCtrlPos[1] + $iCtrlPos[3] ClientToScreen($hWnd, $X, $Y) If $iMouse Then $X = MouseGetPos(0) $Y = MouseGetPos(1) EndIf DllCall("user32.dll", "int", "TrackPopupMenuEx", "hwnd", $hMenu, "int", 0, "int", $X, "int", $Y, "hwnd", $hWnd, "ptr", 0) EndFunc ; Convert the client (GUI) coordinates to screen (desktop) coordinates Func ClientToScreen($hWnd, ByRef $x, ByRef $y) Local $stPoint = DllStructCreate("int;int") DllStructSetData($stPoint, 1, $x) DllStructSetData($stPoint, 2, $y) DllCall("user32.dll", "int", "ClientToScreen", "hwnd", $hWnd, "ptr", DllStructGetPtr($stPoint)) $x = DllStructGetData($stPoint, 1) $y = DllStructGetData($stPoint, 2) ; release Struct not really needed as it is a local $stPoint = 0 EndFunc2 points
-
Edit 2: Version 1.0.0.3 including View History of Changes function Edit 1: Amended source code on guinness advise (replacement of obsolete _Iif() ) Example of Auto Updating of a running script using Internet Web download. Works as well for compiled as for uncompiled scripts. Download with file size and checksum verification UpdateTest_1.0.1.3.au3 this is version 1.0.1.2 for the update example Helper to setup file data (version, date, filesize and CRC) in AppsUpdates.txt AppsUpdates_Calculator.au3 Credits: MsgBoxEx() used in in the example written by Ward _CRC32() also by Ward (just a coincidence) version 1.0.0.2: Before you test the script, compile it first with AutoIt3Wrapper, to get the version number in the executable. You can test it then with both compiled and uncompiled versions. The script example will check the application update version in file AppsUpdates.txt on the update website. If required, it will propose the upgrade. You can then disregard it or accept the update. The new 'View Changes' button will download and display the change information text. If updating, the initial script will be renamed with it's version number (as safety backup), and the new updated will be renamed to the initial script file name, in order not to break shortcuts. There is no code to postpone the update proposal by a number of days, this has to be programmed separately. Web data file AppsUpdates.txt content (INI file) now includes a new line containing the url to history file: changes=... [UpdateTest.au3] version=1.0.1.3 date=2014/06/26 23:00 Filesize=22234 CRC=77446F0C download=http://users.telenet.be/GreenCan/AutoIt/Updates/UpdateTest_1.0.1.3.au3 changes=http://users.telenet.be/GreenCan/AutoIt/Updates/UpdateTest_HistoryOfChanges.txt [UpdateTest.exe] version=1.0.1.3 date=2014/06/26 23:02 Filesize=490496 CRC=28974906 download=http://users.telenet.be/GreenCan/AutoIt/Updates/UpdateTest_1.0.1.3.exe changes=http://users.telenet.be/GreenCan/AutoIt/Updates/UpdateTest_HistoryOfChanges.txt The web directory has 3 files: AppsUpdates.txt (the updater data file) UpdateTest_1.0.1.1.exe UpdateTest_1.0.1.1.au31 point
-
Because your script runs a x86 cmd, the reg query cannot find the x64 hive into the registry. Try to launch the native cmd, using @WindowsDir & "Sysnativecmd.exe" instead of @ComSpec1 point
-
BTW: A good tutorial about ADO and AutoIt can be found here.1 point
-
JScript, try now: #include <GUIConstantsEx.au3> #include <WinAPIGdi.au3> #include <WindowsConstants.au3> #include <StaticConstants.au3> ;coded by taietel _SlideWindow() Func _SlideWindow() Local $iW = 600, $iFont = 12, $iH = $iFont + 4 + 20, $bExpand = True, $iNoIcnsExpand = 3, $w = $iNoIcnsExpand * ($iFont + 4 + 10), $p = 25, $r = 25, $iDelay = 2 Local $iIcnExit = "r", $iIcnCfg = "@", $iIcnInfo = "i", $iIcnUp = "5", $iIcnDown = "6", $iIcnSep = "|", $iIcnChk = "a", $iIcnFull = "1" ; Create GUI Local $hForm = GUICreate("Test", $iW, $iH + $p, (@DesktopWidth - $iW + $w + $r) / 2, -$iH, $WS_POPUP, $WS_EX_TOPMOST) GUISetBkColor(0xdedede) ;------- Put some stuff on GUI ---------- Local $hExit = GUICtrlCreateLabel($iIcnExit, 5, $iH - ($iFont + 4) - 10, $iFont + 4, $iFont + 4, BitOR($SS_CENTER, $SS_CENTERIMAGE)) GUICtrlSetFont(-1, $iFont, 400, 0, "Webdings", 5) GUICtrlSetColor(-1, 0x505050) GUICtrlSetCursor(-1, 0) GUICtrlSetTip(-1, "Exit") GUICtrlCreateLabel($iIcnSep, 5 + $iFont + 4, $iH - ($iFont + 4) - 10, $iFont + 4, $iFont + 4, BitOR($SS_CENTER, $SS_CENTERIMAGE)) GUICtrlSetFont(-1, $iFont, 400, 0, "Webdings", 5) GUICtrlSetColor(-1, 0x909090) Local $hSomeStuff = GUICtrlCreateLabel($iIcnCfg, 5 + 2 * ($iFont + 4), $iH - ($iFont + 4) - 10, $iFont + 4, $iFont + 4, BitOR($SS_CENTER, $SS_CENTERIMAGE)) GUICtrlSetFont(-1, $iFont, 400, 0, "Webdings", 5) GUICtrlSetColor(-1, 0x505050) Local $hSomeStuff_l = GUICtrlCreateLabel("Some stuff", 5 + 3 * ($iFont + 4), $iH - ($iFont + 4) - 10, 80, $iFont + 4, BitOR($SS_CENTER, $SS_CENTERIMAGE)) GUICtrlSetFont(-1, $iFont, 400, 0, "Arial", 5) GUICtrlSetColor(-1, 0x505050) GUICtrlSetTip(-1, "Click for menu") GUICtrlSetCursor(-1, 0) Local $hSomeStuffA = GUICtrlCreateLabel($iIcnDown, 5 + 3 * ($iFont + 4) + 80, $iH - ($iFont + 4) - 10, $iFont + 4, $iFont + 4, BitOR($SS_CENTER, $SS_CENTERIMAGE)) GUICtrlSetFont(-1, $iFont - 2, 400, 0, "Webdings", 5) GUICtrlSetColor(-1, 0x505050) GUICtrlSetTip(-1, "Click for menu") GUICtrlSetCursor(-1, 0) Local $DummyMenu = GUICtrlCreateDummy() Local $hContextMenu = GUICtrlCreateContextMenu($DummyMenu) Local $mnuSomeStuff = GUICtrlCreateMenuItem("Some Item", $hContextMenu) Local $mnuExit = GUICtrlCreateMenuItem("Exit", $hContextMenu) GUICtrlCreateLabel($iIcnSep, 5 + 4 * ($iFont + 4) + 80 - 5, $iH - ($iFont + 4) - 10, $iFont + 4, $iFont + 4, BitOR($SS_CENTER, $SS_CENTERIMAGE)) GUICtrlSetFont(-1, $iFont, 400, 0, "Webdings", 5) GUICtrlSetColor(-1, 0x909090) GUICtrlCreateLabel($iIcnInfo, 5 + 5 * ($iFont + 4) + 80, $iH - ($iFont + 4) - 10, $iFont + 4, $iFont + 4, BitOR($SS_CENTER, $SS_CENTERIMAGE)) GUICtrlSetFont(-1, $iFont, 400, 0, "Webdings", 5) GUICtrlSetColor(-1, 0x505050) Local $hAbout = GUICtrlCreateLabel("About", 5 + 6 * ($iFont + 4) + 80, $iH - ($iFont + 4) - 10, 60, $iFont + 4, BitOR($SS_CENTER, $SS_CENTERIMAGE)) GUICtrlSetFont(-1, $iFont, 400, 0, "Arial", 5) GUICtrlSetColor(-1, 0x505050) GUICtrlSetCursor(-1, 0) GUICtrlSetTip(-1, "About this program...") GUICtrlCreateLabel($iIcnSep, 5 + 6 * ($iFont + 4) + 80 + 60, $iH - ($iFont + 4) - 10, $iFont + 4, $iFont + 4, BitOR($SS_CENTER, $SS_CENTERIMAGE)) GUICtrlSetFont(-1, $iFont, 400, 0, "Webdings", 5) GUICtrlSetColor(-1, 0x909090) ;------- end some stuff on GUI ---------- Local $hExpand = GUICtrlCreateLabel($iIcnDown, $iW - $r - $w / 4 - ($iFont + 4) / 2, $iH + ($p - ($iFont + 4)) / 2, $iFont + 4, $iFont + 4, BitOR($SS_CENTER, $SS_CENTERIMAGE)) GUICtrlSetFont(-1, $iFont, 400, 0, "Webdings", 5) GUICtrlSetColor(-1, 0x505050) GUICtrlSetCursor(-1, 0) GUICtrlSetTip(-1, "Expand") GUICtrlCreateLabel($iIcnSep, $iW - $r - 2 * $w / 4 - ($iFont + 4) / 2, $iH + ($p - ($iFont + 4)) / 2, $iFont + 4, $iFont + 4, BitOR($SS_CENTER, $SS_CENTERIMAGE)) GUICtrlSetFont(-1, $iFont, 400, 0, "Webdings", 5) GUICtrlSetColor(-1, 0x909090) Local $hFullScreen = GUICtrlCreateLabel($iIcnFull, $iW - $r - 3 * $w / 4 - ($iFont + 4) / 2, $iH + ($p - ($iFont + 4)) / 2, $iFont + 4, $iFont + 4, BitOR($SS_CENTER, $SS_CENTERIMAGE)) GUICtrlSetFont(-1, $iFont, 400, 0, "Webdings", 5) GUICtrlSetCursor(-1, 0) GUICtrlSetTip(-1, "Full Screen") GUICtrlSetColor(-1, 0x505050) Local $hRgn = _WinAPI_CreateRectRgn(0, 0, $iW - 1, $iH / 2) Local $hRgn1 = _WinAPI_CreateRoundRectRgn(0, 0, $iW, $iH, 7, 7) Local $hRgn2 = _WinAPI_CreateRoundRectRgn($iW - $r - $w, 2, $iW - $r, $iH + $p, 7, 7) Local $hRgn3 = _WinAPI_CreateRectRgn($iW - $r - $w - 5, 2, $iW - $r - $w, $iH + $p) Local $aPointl[3][2] = [[$iW - $r - $w - 5, $iH - 1], [$iW - $r - $w, $iH + $p], [$iW - $r - $w, $iH - 1]] Local $hRgn3 = _WinAPI_CreatePolygonRgn($aPointl) Local $aPointr[3][2] = [[$iW - $r + 5, $iH - 1], [$iW - $r - 2, $iH + $p - 1], [$iW - $r - 1, $iH - 1]] Local $hRgn4 = _WinAPI_CreatePolygonRgn($aPointr) _WinAPI_CombineRgn($hRgn, $hRgn, $hRgn1, $RGN_OR) _WinAPI_CombineRgn($hRgn, $hRgn, $hRgn2, $RGN_OR) _WinAPI_CombineRgn($hRgn, $hRgn, $hRgn3, $RGN_OR) _WinAPI_CombineRgn($hRgn, $hRgn, $hRgn4, $RGN_OR) _WinAPI_DeleteObject($hRgn1) _WinAPI_DeleteObject($hRgn2) _WinAPI_DeleteObject($hRgn3) _WinAPI_DeleteObject($hRgn4) _WinAPI_SetWindowRgn($hForm, $hRgn, 1) GUISetState(@SW_SHOW) While 1 Switch GUIGetMsg() Case $hExit, $mnuExit Exit Case $hFullScreen MsgBox(0, "", "Here you'll have to put the code for full screen mode.") Case $mnuSomeStuff MsgBox(0,"","stuff...") Case $hAbout MsgBox(0, "", "Here you'll have to put the code for About message.") Case $hExpand If $bExpand Then GUICtrlSetData($hExpand, $iIcnUp) WinMove($hForm, "", (@DesktopWidth - $iW + $w + $r) / 2, 0, $iW, $iH + $p, $iDelay) GUICtrlSetTip($hExpand, "Retract") $bExpand = False Else GUICtrlSetData($hExpand, $iIcnDown) WinMove($hForm, "", (@DesktopWidth - $iW + $w + $r) / 2, -$iH, $iW, $iH + $p, $iDelay) GUICtrlSetTip($hExpand, "Expand") $bExpand = True EndIf Case $hSomeStuffA, $hSomeStuff_l ShowMenu($hForm, $hContextMenu, $hSomeStuff) EndSwitch WEnd EndFunc ;==>_test Func ShowMenu($hWnd, $nContextID, $nContextControlID, $iMouse = 0) Local $hMenu = GUICtrlGetHandle($nContextID) Local $iCtrlPos = ControlGetPos($hWnd, "", $nContextControlID) Local $X = $iCtrlPos[0] Local $Y = $iCtrlPos[1] + $iCtrlPos[3] ClientToScreen($hWnd, $X, $Y) If $iMouse Then $X = MouseGetPos(0) $Y = MouseGetPos(1) EndIf DllCall("user32.dll", "int", "TrackPopupMenuEx", "hwnd", $hMenu, "int", 0, "int", $X, "int", $Y, "hwnd", $hWnd, "ptr", 0) EndFunc ;==>ShowMenu ; Convert the client (GUI) coordinates to screen (desktop) coordinates Func ClientToScreen($hWnd, ByRef $X, ByRef $Y) Local $stPoint = DllStructCreate("int;int") DllStructSetData($stPoint, 1, $X) DllStructSetData($stPoint, 2, $Y) DllCall("user32.dll", "int", "ClientToScreen", "hwnd", $hWnd, "ptr", DllStructGetPtr($stPoint)) $X = DllStructGetData($stPoint, 1) $Y = DllStructGetData($stPoint, 2) ; release Struct not really needed as it is a local $stPoint = 0 EndFunc ;==>ClientToScreen1 point
-
If you need to get more rows then do it like this: $sqlRs = ObjCreate("ADODB.Recordset") $sqlRs.open ($SQLQUERY,$SqlConn) While Not $sqlRs.EOF $aOptionValue = $sqlRs.Fields ($fieldname).Value ConsoleWrite($aOptionValue & @CRLF) $sqlRs.MoveNext WEnd1 point
-
Do you want to cycle through those links or really randomize it? For $i = 1 To 8 Step 1 _IELinkClickByText($oIE, "link" & $i) Sleep(1000) Next The one above will click link1 - link8 For $i = 1 To 8 Step 1 _IELinkClickByText($oIE, "link" & Random(1, 8, 1)) Sleep(100) Next This one will click a random link between the numbers 1 and 8. And that 8x in a row.1 point
-
http://www.autoitscript.com/autoit3/scite/download/beta_SciTE4AutoIt3/Au3Check.exe Updated beta version of Au3Check that should contain a fix for that. BTW, when someone says there's probably been a fix for something, you should probably go look for the fix. Look in the BugTracker, usually under Fixed Bugs. After all, that's what the BugTracker link is there for, to report bugs and see if there's been a fix to a bug you think is happening.1 point
-
OnEvent Mode and more than one loop!
StandardUser reacted to BrewManNH for a topic
When using OnEvent mode, you can't use the events to interrupt a running function like that, nothing will be actioned from the first function until you exit the second one. And nothing will get acted on until the third one is finished etc. Your gui1 function jumps to the On_Button function, and doesn't return because it calls gui2 and gets stuck there. Try it this way. #include <GUIConstantsEx.au3> Opt("GUIOnEventMode", 1) Global $hGUI1, $hGUI2 = 9999, $hButton1, $hButton2, $hButton3 = 9999 ; Predeclare the variables with dummy values to prevent firing the Case statements gui1() While 1 ; Here I need to run code inside this loop... Sleep(10) WEnd Func gui1() $hGUI1 = GUICreate("Gui 1", 200, 200, 100, 100) GUISetOnEvent($GUI_EVENT_CLOSE, "On_Close", $hGUI1) ; Call a common GUI close function $hButton1 = GUICtrlCreateButton("Msgbox 1", 10, 10, 80, 30) GUICtrlSetOnEvent(-1, "On_Button") ; Call a common button function $hButton2 = GUICtrlCreateButton("Show Gui 2", 10, 60, 80, 30) GUICtrlSetOnEvent(-1, "On_Button") ; Call a common button function GUISetState() EndFunc ;==>gui1 Func gui2() $hGUI2 = GUICreate("Gui 2", 200, 200, 350, 350) ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $hGUI2 = ' & $hGUI2 & @CRLF & '>Error code: ' & @error & @CRLF) ;### Debug Console GUISetOnEvent($GUI_EVENT_CLOSE, "On_Close", $hGUI2) ; Call a common GUI close function $hButton3 = GUICtrlCreateButton("MsgBox 2", 10, 10, 80, 30) GUICtrlSetOnEvent(-1, "On_Button") ; Call a common button function GUISetState() EndFunc ;==>gui2 Func On_Close() Switch @GUI_WinHandle ; See which GUI sent the CLOSE message Case $hGUI1 Exit ; If it was this GUI - we exit <<<<<<<<<<<<<<< Case $hGUI2 GUIDelete($hGUI2) ; If it was this GUI - we just delete the GUI <<<<<<<<<<<<<<< GUICtrlSetState($hButton2, $GUI_ENABLE) EndSwitch EndFunc ;==>On_Close Func On_Button() Switch @GUI_CtrlId ; See which button sent the message Case $hButton1 MessageBox(1) ; We can call a function with parameters here <<<<<<<<<<<<<<<<<<< Case $hButton2 GUICtrlSetState($hButton2, $GUI_DISABLE) gui2() Case $hButton3 MessageBox(2) ; We can call a function with parameters here <<<<<<<<<<<<<<<<<<< EndSwitch EndFunc ;==>On_Button Func MessageBox($iIndex) MsgBox("", "MsgBox " & $iIndex, "Test from Gui " & $iIndex) EndFunc ;==>MessageBox You'd need to probably create other functions that are run from either the While loop or from inside one or both of your other functions, but realize that nothing will get acted on until the functions end. You could also use a Windows message handler to handle some of it as well without having to use OnEvent or message loop mode. See the link to the GUIRegisterMsg demo I have in my signature that demonstrates how to do that.1 point -
AutoIt v3.3.12.0 has been released. Thanks to everyone involved - there's been a lot of effort in the help file, UDF library and build scripts by many under-appreciated individuals. Download it here. Complete list of changes: History1 point
-
Program Launcher
ravkr reacted to kaotkbliss for a topic
My first project outside of work Since I have literally hundreds of games and programs installed on my pc, even using the start menu can get me lost when looking for a specific thing. With this, you can drag/drop any file or shortcut onto the GUI. Then you can open any file from the convienient GUI sitting on your desktop. 5 different "tabs" or lists allow you to sort and organize your files to make them easier to find when your lists get long. Latest Version 3.0.2.2<-11/8/13 (or 8/11/13 for the European people) You can get the included help file here for a more indepth look at what this program can do and how it works. I've removed the purchase requirement (it's free again) and added a donate button to the installer. Bugs, suggestions and comments are welcome!1 point