
momar33
Active Members-
Posts
70 -
Joined
-
Last visited
momar33's Achievements

Wayfarer (2/7)
0
Reputation
-
ArraySearch Not Returning Error
momar33 replied to momar33's topic in AutoIt General Help and Support
Thank you both! -
When doing a search for a value that is not in the array, I am not getting an error. Instead it returns -1 as the index that it was found in. From some searching I noticed that this used to be an issue when using different variable types, but in my example all variables are strings. Here is the example: #include <Array.au3> #include <MsgBoxConstants.au3> Global $aSavedFiles[] = ["test", _ "dd_TESTCL_private.m", _ "dd_TESTCL_protected.m", _ "dd_TRSTAT_private.m", _ "OBJECT_TESTCL.mdl", _ "PUBLIC__T_TESTACTV.m", _ "PUBLIC__T_TESTEVT.m", _ "PUBLIC__T_TSTSTATTTRV.m", _ "TESTCL__CTRV.mdl", _ "TESTCL__SELECT.mdl", _ "TESTCL__T_STTTRV.m", _ "TESTCL__TTRV.mdl"] _ArraySort($aSavedFiles, Default, 1) $iIndex = _ArraySearch($aSavedFiles, "TRSTAT__TLASTAT.mdl") ;$iIndex = _ArrayBinarySearch($aSavedFiles, "TRSTAT__TLASTAT.mdl") ;ConsoleWrite("IndexFound = " & $iIndex & @CRLF) _ArrayDisplay($aSavedFiles) If @error Then MsgBox($MB_SYSTEMMODAL, "Not Found", '"' & "TRSTAT__TLASTAT.mdl" & '" was not found in the array.') Else MsgBox($MB_SYSTEMMODAL, "Found", '"' & "TRSTAT__TLASTAT.mdl" & '" was found in the array at position ' & $iIndex & ".") EndIfAny help would be appreciated. Thanks, momar33
-
Label Blinking with Pic for Background
momar33 replied to momar33's topic in AutoIt GUI Help and Support
UEZ, That script was very helpful. It looks like it is still not using a transparent background though, instead just making the label and background all in the same pic. The program I intend to use this timer in has several other labels being displayed at the same time. Based on what I have learned from the script, and assuming there is no way to make the pic background transparent, it seems that either the GDI pic will either overwrite everything, or if i adjust the position and size, the GDI pic background will not match up with the GUI background. It seems the only way I can proceed is to make all the information on my program using GDI. Thanks, momar33 -
Label Blinking with Pic for Background
momar33 replied to momar33's topic in AutoIt GUI Help and Support
UEZ, I looked at the GDI script in your linked post and played with it a bit. When I add a background to the gui, the time label/graphic is not transparent so it ends up having a grey rectangle around the time. I was unable to figure out if it's possible to make the background transparent. I believe I ran across this before, GDI looked like a good solution until I realized that none of the example scripts use a background and transparency. Can GDI be used to create a label with a transparent background? Thanks, momar33 -
I have a program that has a large label acting as a count down timer. I have set the background color of the label to $GUI_BKCOLOR_TRANSPARENT. This program has a picture for a background. In the below example the gui's background color is set to yellow. Occasionally when the timer updates you can see the yellow background color in the shape of the label. i have looked at many posts about blinking labels, but the all appear to find a way around the blinking problem instead of fixing it and none of them use a background picture. Does anyone know how this problem can be fixed? Or perhaps just a work around for my situation? As you can see by my commented out code, I have tried ControlSetText and GUISetState LOCK/UNLOCK. ControlSetText results in each new number being written over whatever was in the label instead of replacing it GUISetState LOCK/UNLOCK cause the issue to happen to the whole gui instead of just the label. I have attached the background I was using. Thanks in advance. #include <WindowsConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> Const $BKGND_FILE = "C:\Users\sjraisbe\Pictures\poker bkgd.jpg" Global $seconds = 60 $hMain = GUICreate("Timer", 800, 600, -1, -1, BitOR($WS_MAXIMIZEBOX,$WS_MINIMIZEBOX,$WS_SIZEBOX,$WS_THICKFRAME,$WS_SYSMENU,$WS_CAPTION,$WS_OVERLAPPEDWINDOW,$WS_TILEDWINDOW,$WS_POPUP,$WS_POPUPWINDOW,$WS_GROUP,$WS_TABSTOP,$WS_BORDER,$WS_CLIPSIBLINGS)) GUISetBkColor(0xFFFF00, $hMain) GUICtrlSetDefBkColor($GUI_BKCOLOR_TRANSPARENT, $hMain) $pic = GUICtrlCreatePic($BKGND_FILE, 0, 0, 1920, 1080) GUICtrlSetState(-1,$GUI_DISABLE) $lblTime = GUICtrlCreateLabel("01:00", 192, 222, 424, 156, $SS_CENTER) GUICtrlSetFont($lblTime, 100, 400, 0, "Arial") GUICtrlSetColor($lblTime, 0xFFFFFF) AdlibRegister("UpdateTime", 1000) GUISetState(@SW_SHOW, $hMain) While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then ExitLoop EndIf WEnd Func UpdateTime() ;GUISetState(@SW_LOCK) Local $sec, $min, $hr $sec = Mod($seconds, 60) $min = Mod($seconds / 60, 60) GUICtrlSetData($lblTime, StringFormat("%02i:%02i", $min, $sec)) ;ControlSetText($hMain, "", $lblTime, StringFormat("%02i:%02i", $min, $sec)) $seconds -= 1 ;GUISetState(@SW_UNLOCK) EndFunc
-
M23, I had actually thought about that method at one time, but for whatever reason decided against it. (or it may have been a backup idea) I will likely use that method if I can't figure out the issue in the OP. Do you have any idea what is causing the issue in the OP? It doesn't appear to be an issue with my code, but I was kinda hoping it was and I just missed it. Thanks, M33
- 5 replies
-
- fullscreen
- button
-
(and 5 more)
Tagged with:
-
I am using $GUI_DOCKAUTO in my actual program, but removed it for simplification. With $GUI_DOCKAUTO set, this still happens just slightly differently. The code posted is the result of weeding out unnecessary code. Hiding/Showing will not work for me. I change the button color which makes the button "Windows Classic Style", I redraw the button to get the 3d button back. What I am doing is using a colored button to show a more prominent tab focus. (Down button changes the focus (and background color) of the next button down, then redraws the button that previously had focus).
- 5 replies
-
- fullscreen
- button
-
(and 5 more)
Tagged with:
-
I am seeing a buttons position change when the following happens. 1. GUI created at 800 x 600 2. GUI info is stored using WinGetPos 3. GUI changed to full-screen using WinMove 4. Button info is stored using ControlGetPos 5. Button is deleted 6. Button is re-created using the stored data from item 4. 7. GUI is restored to the info gathered in item 2. The button starts with this info: Button Left: 408 Button Top: 84 Button Width: 80 Button Height: 24 and after the events above the button has this info: Button Left: 409 Button Top: 83 Button Width: 80 Button Height: 24 Here is some code that can reproduce the issue: (press space, f, space, f, then look in the console) #Region Includes #include <WindowsConstants.au3> #include <StaticConstants.au3> #include <GUIConstantsEx.au3> #include <Array.au3> #EndRegion Includes Const $HT_KEY_FULLSCREEN = "f" Const $HT_KEY_SPACE = "{SPACE}" Global $btnAddRebuy[21] Global $btnRemovePlayer[21] Global $fFullscreen = False Global $aGuiInfo Global $aGuiInfo2 Global $guiWidth = 800 Global $guiHeight = 600 #Region Dimensions for Settings Screen ; Player Global $lblPlayerTop = 60 Global $playerLabelSpace = 24 ; Add Rebuy Button Global $btnRebuyLeft = 320 Global $btnRebuyWidth = 80 Global $btnRebuyHeight = 24 ; Remove Player Global $btnRemoveLeft = 408 Global $btnRemoveWidth = 80 Global $btnRemoveHeight = 24 #EndRegion Dimensions for Settings Screen $hMain = GUICreate("Timer", $guiWidth, $guiHeight, -1, -1, BitOR($WS_MAXIMIZEBOX,$WS_MINIMIZEBOX,$WS_SIZEBOX,$WS_THICKFRAME,$WS_SYSMENU,$WS_CAPTION,$WS_OVERLAPPEDWINDOW,$WS_TILEDWINDOW,$WS_POPUP,$WS_POPUPWINDOW,$WS_GROUP,$WS_TABSTOP,$WS_BORDER,$WS_CLIPSIBLINGS)) For $i = 1 To 5 Step 1 $btnAddRebuy[$i] = GUICtrlCreateButton("Button", $btnRebuyLeft, $lblPlayerTop + ($playerLabelSpace * $i), $btnRebuyWidth, $btnRebuyHeight) GUICtrlSetResizing($btnAddRebuy[$i], $GUI_DOCKAUTO) GuiCtrlSetState($btnAddRebuy[$i], $GUI_DISABLE) $btnRemovePlayer[$i] = GUICtrlCreateButton("Button", $btnRemoveLeft, $lblPlayerTop + ($playerLabelSpace * $i), $btnRemoveWidth, $btnRemoveHeight) ;GUICtrlSetResizing($btnRemovePlayer[$i], $GUI_DOCKAUTO) Next GUISetState(@SW_SHOW) HotKeySet($HT_KEY_FULLSCREEN, "Fullscreen") HotKeySet($HT_KEY_SPACE, "Redraw") While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then ExitLoop EndIf WEnd Func Fullscreen() If WinActive($hMain) Then If $fFullscreen Then ;GUISetStyle(BitOR($WS_MAXIMIZEBOX,$WS_MINIMIZEBOX,$WS_SIZEBOX,$WS_THICKFRAME,$WS_SYSMENU,$WS_CAPTION,$WS_OVERLAPPEDWINDOW,$WS_TILEDWINDOW,$WS_POPUP,$WS_POPUPWINDOW,$WS_GROUP,$WS_TABSTOP,$WS_BORDER,$WS_CLIPSIBLINGS), Default, $hMain) $aGuiInfo2 = WinGetPos($hMain) ConsoleWrite("******* Fullscreen *******" & @LF) ConsoleWrite("Win Left: " & $aGuiInfo2[0] & @LF) ConsoleWrite("Win Top: " & $aGuiInfo2[1] & @LF) ConsoleWrite("Win Width: " & $aGuiInfo2[2] & @LF) ConsoleWrite("Win Height: " & $aGuiInfo2[3] & @LF & @LF) ;WinMove($hMain, Default, $aGuiInfo[0], $aGuiInfo[1], $aGuiInfo[2], $aGuiInfo[3]) WinMove($hMain, Default, 238, 179, 816, 638) $fFullscreen = False $aCtrlInfo = ControlGetPos($hMain, "", $btnRemovePlayer[1]) ConsoleWrite("******* Button Info after Restored *******" & @LF) ConsoleWrite("Button Left: " & $aCtrlInfo[0] & @LF) ConsoleWrite("Button Top: " & $aCtrlInfo[1] & @LF) ConsoleWrite("Button Width: " & $aCtrlInfo[2] & @LF) ConsoleWrite("Button Height: " & $aCtrlInfo[3] & @LF & @LF) Else ;GUISetStyle($WS_POPUP, Default, $hMain) $aGuiInfo = WinGetPos($hMain) ConsoleWrite("******* Start Size *******" & @LF) ConsoleWrite("Win Left: " & $aGuiInfo[0] & @LF) ConsoleWrite("Win Top: " & $aGuiInfo[1] & @LF) ConsoleWrite("Win Width: " & $aGuiInfo[2] & @LF) ConsoleWrite("Win Height: " & $aGuiInfo[3] & @LF & @LF) WinMove($hMain, Default, 0, 0, @DesktopWidth, @DesktopHeight) $fFullscreen = True $aCtrlInfo = ControlGetPos($hMain, "", $btnRemovePlayer[1]) ConsoleWrite("******* Button Info after Fullscreened *******" & @LF) ConsoleWrite("Button Left: " & $aCtrlInfo[0] & @LF) ConsoleWrite("Button Top: " & $aCtrlInfo[1] & @LF) ConsoleWrite("Button Width: " & $aCtrlInfo[2] & @LF) ConsoleWrite("Button Height: " & $aCtrlInfo[3] & @LF & @LF) EndIf Else HotKeySet($HT_KEY_FULLSCREEN) Send($HT_KEY_FULLSCREEN) HotKeySet($HT_KEY_FULLSCREEN, "Fullscreen") EndIf EndFunc Func Redraw() Local $aCtrlInfo $aCtrlInfo = ControlGetPos($hMain, "", $btnRemovePlayer[1]) ConsoleWrite("******* Button Info before Redraw *******" & @LF) ConsoleWrite("Button Left: " & $aCtrlInfo[0] & @LF) ConsoleWrite("Button Top: " & $aCtrlInfo[1] & @LF) ConsoleWrite("Button Width: " & $aCtrlInfo[2] & @LF) ConsoleWrite("Button Height: " & $aCtrlInfo[3] & @LF & @LF) GuiCtrlDelete($btnRemovePlayer[1]) $btnRemovePlayer[1] = GUICtrlCreateButton("Button", $aCtrlInfo[0], $aCtrlInfo[1], $aCtrlInfo[2], $aCtrlInfo[3]) ;GUICtrlSetResizing(-1, $GUI_DOCKAUTO) $aCtrlInfo = ControlGetPos($hMain, "", $btnRemovePlayer[1]) ConsoleWrite("******* Button Info after Redraw *******" & @LF) ConsoleWrite("Button Left: " & $aCtrlInfo[0] & @LF) ConsoleWrite("Button Top: " & $aCtrlInfo[1] & @LF) ConsoleWrite("Button Width: " & $aCtrlInfo[2] & @LF) ConsoleWrite("Button Height: " & $aCtrlInfo[3] & @LF & @LF) EndFunc Is there a way to fix this, or is the issue built in to how windows get resized?
- 5 replies
-
- fullscreen
- button
-
(and 5 more)
Tagged with:
-
Trouble Using One Function for Several Buttons
momar33 posted a topic in AutoIt GUI Help and Support
I have a poker timer program that has a feature to add a re-buy. Currently the re-buy is just used to calculate the number of chips at the table and pot size. I am trying to add functionality to keep track of who did the re-buy. I have added functionality to add players names, which get saved to an array. What I would like the "Add Re-buy" button to do is bring up a second gui with a button for each player currently in the game. Since the number of players changes, I am using a for loop to create the buttons. The problem comes when I try to determine which button was pressed. I am using GUIOnEventMode. Since I don't know how many buttons there will be, I can't create functions for each of the buttons. Instead what I am trying to do is have one Function that all buttons call. This seems to work fine, if i want all the buttons to do the same thing. Is there a way I can use my single function (RebuyAdded) to determine which of the buttons was pressed? Here is the code for my secondary Gui: <snip> -
Thanks for the Reply. I may deal with the highlighting for the sake of keeping the code simple, but this will definitely help should I choose to picky. Thanks again!
-
When you create a simple UpDown down input the number in the input field is always highlighted as you press the up or down buttons. Is there a way to remove this highlighting? $ES_NOHIDESEL keeps the highlighting there when you click away from the input box. I want the opposite, never show the highlighting.
-
Determining Progress Bar Increments
momar33 replied to momar33's topic in AutoIt GUI Help and Support
If i understand you correctly then the problem with that is that it takes far longer to do the _FileListToArray then it does to copy the files which leaves the program appearing as though it is doing nothing for a few seconds. Then it copies all the files so quickly that there is no need for a progress bar. I want the progress bar to show the progress of the search and the copy. BTW i am using slightly different method for the file search. Here is my code. Opt("GUIOnEventMode", 1) ;-------------------------Includes-------------------------------------------- #Include <GUIConstants.au3> #Include <File.au3> #Include <Array.au3> #include <string.au3> ;-------------------------Variables-------------------------------------------- ;Global Const $CB_SETCURSEL = 0x14E Global $sAlbumName Global $iProgress Global $gcProgressBar Global $gcProgressLabel Global $increment Global $cardDrive Global $drives Global $top = 50 Global $left = 40 Global $offset = 40 ;-------------------------Gui Creation-------------------------------------------- $wMain = Guicreate("Picture Transfer", 300, 300) GUISetOnEvent($GUI_EVENT_CLOSE, "bClose") GUICtrlCreateLabel("Select the drive that has your pictures:", $left, $top, 200, 20) $cDrive = GUICtrlCreateCombo("", $left, $top + ($offset/2), 150, 20) $bTransfer = GUICtrlCreateButton("Transfer Pictures", $left, $top + ($offset*2), 100) GUICtrlSetTip(-1, "This will ask for an album name then transfer all pics on the selected drive" & @CRLF & "to My Pictures\Album. (NOTE: Drive must be named ""PICTURES"")") GUICtrlSetOnEvent(-1, "Transfer") $bRefresh = GUICtrlCreateButton("Refresh", $left, $top + ($offset*3), 50) GUICtrlSetTip(-1, "This will check for any newly added drives.") GUICtrlSetOnEvent(-1, "Refresh") $bRename = GUICtrlCreateButton("Rename Drive", $left, $top + ($offset*4), 100) GUICtrlSetTip(-1, "This change the name of the selected drive to ""PICTURES"".") GUICtrlSetOnEvent(-1, "Rename") ;~ $drives[0] = 3 ;~ $drives[1] = "g:" ;~ $drives[2] = "a:" ;~ $drives[3] = "c:" ;ConsoleWrite("----1----" & @CRLF) Refresh() GUICtrlSetState($bTransfer, $GUI_FOCUS) GUISetState() ;Refresh() While 1 Sleep(100) WEnd ;-------------------------Functions-------------------------------------------- Func bClose() Exit EndFunc Func Rename() ConsoleWrite("GetCardDrive() = " & GetCardDrive() & @CRLF) DriveSetLabel(GetCardDrive(), "PICTURES") Refresh() EndFunc Func Refresh() ResetCombo($cDrive) $drives = GetDrives() If $drives[0] <> 0 Then GUICtrlSetState($bTransfer, $GUI_ENABLE) For $i = 1 to $drives[0] GUICtrlSetData($cDrive, StringUpper($drives[$i]) & " """ & DriveGetLabel($drives[$i])& """") Next SetComboSelection($cDrive, 0) ;GUICtrlSetData(-1, "", $drives[1] & "\" & DriveGetLabel($drives[1])) Else GUICtrlSetData($cDrive, "No Cards Detected", "No Cards Detected") GUICtrlSetState($bTransfer, $GUI_DISABLE) EndIf EndFunc Func GetDriveLabel() Return StringUpper(DriveGetLabel($drives[GetComboSelection($cDrive)+1])) EndFunc Func Transfer() $driveLabel = GetDriveLabel() If $driveLabel = "PICTURES" Then $sAlbumName = InputBox("Picture Transfer", "Please Enter Album Name", Default, Default, 300, 120) If Not @error Then $increment = 100/GetFileTotal() $wProgress = GUICreate("Copying...", 500, 70, Default, Default, $WS_CAPTION) $gcProgressLabel = GUICtrlCreateLabel("", 10, 10, 480, 40) $gcProgressBar = GUICtrlCreateProgress(10, 40, 480, 20, $PBS_SMOOTH) GUISetState(@SW_SHOW, $wProgress) If DirCreate(@MyDocumentsDir & "\My Pictures\" & $sAlbumName) Then TransferFiles("avi") TransferFiles("jpg") TransferFiles("bmp") TransferFiles("wav") TransferFiles("mov") Else MsgBox(48, "Error!", "Could not create album.") EndIf GuiDelete($wProgress) EndIf $iProgress = 0 Else MsgBox(48, "No Memory Card", "This memory card is not labeled as PICTURES.") EndIf EndFunc Func TransferFiles($sFileType) Local $aFileList $aFileList = _FileSearch(GetCardDrive() & "*." & $sFileType, 1) ;_ArrayDisplay($aFileList) ConsoleWrite("UBound($aFileList) = " & UBound($aFileList) & @CRLF) For $i = 1 to UBound($aFileList)-1 $iProgress = $iProgress + $increment GUICtrlSetData($gcProgressLabel, "Copying " & @CRLF & $aFileList[$i]) FileCopy($aFileList[$i],@MyDocumentsDir & "\My Pictures\" & $sAlbumName & "\" & $sAlbumName & $i & "." & $sFileType) ConsoleWrite("$aFileList[$i] = " & $aFileList[$i] & @CRLF) GUICtrlSetData ($gcProgressBar,$iProgress) ConsoleWrite("$iProgress = " & $iProgress & @CRLF) ConsoleWrite("Dir = " & @MyDocumentsDir & "\My Pictures\" & $sAlbumName & "\" & $sAlbumName & $i & "." & $sFileType & @CRLF) Next EndFunc Func GetFileTotal() ;~ Local $total ;~ $array = _FileSearch(GetCardDrive() & "*." & "avi", 1) ;~ $total = $total + $array[0] ;~ $array = _FileSearch(GetCardDrive() & "*." & "jpg", 1) ;~ If $array[0] = 0 Then ;~ ConsoleWrite("No jpgs!!!!!!!!!!!" & @CRLF) ;~ EndIf ;~ $total = $total + $array[0] ;~ $array = _FileSearch(GetCardDrive() & "*." & "bmp", 1) ;~ $total = $total + $array[0] ;~ $array = _FileSearch(GetCardDrive() & "*." & "wav", 1) ;~ $total = $total + $array[0] ;~ $array = _FileSearch(GetCardDrive() & "*." & "mov", 1) ;~ $total = $total + $array[0] Return 300 ;$total EndFunc ;~ Func GetCardDrive() ;~ Local $aDrives ;~ Local $sCardDrive = "None" ;~ ;~ ;~ $aDrives = DriveGetDrive("removable") ;~ ;ConsoleWrite("$aDrives[1] = " & $aDrives[2] & @CRLF) ;~ ;~ If Not @error then ;~ For $drive = 1 to $aDrives[0] ;~ If StringUpper(DriveGetLabel($aDrives[$drive])) = "PICTURES" Then ;~ $sCardDrive = $aDrives[$drive] ;~ EndIf ;~ Next ;~ EndIf ;~ ;~ If $sCardDrive = "None" Then ;~ MsgBox(48, "No Memory Card", "There is no memory card labeled PICTURES currently inserted.") ;~ EndIf ;~ ;~ ;~ ConsoleWrite("$sCardDrive = " & $sCardDrive & @CRLF) ;~ ;~ Return $sCardDrive ;~ EndFunc Func GetCardDrive() ;Uncomment when done testing with USB drive!! Return $drives[GetComboSelection($cDrive)+1] ;Return "G:\Documents\Pictures\" EndFunc Func _FileSearch($sQuery, $iSubdir=0) ConsoleWrite("query = " & $sQuery & @CRLF) $iLine = 0 $sLine = "" $aLine = "" Dim $aFiles[100000] $aFiles[0] = 0 $sArguments = "/a-d /b /on" If $iSubDir Then $sArguments = $sArguments & " /s" $aRaw = Run(@ComSpec & ' /c dir "' & $sQuery & '" ' & $sArguments, @SystemDir, @SW_HIDE, $STDOUT_CHILD) While 1 $sLine = StdoutRead($aRaw) If @error Then ExitLoop $aLine = StringSplit($SLine, @CRLF) If $aLine[0] > 1 Then For $i = 1 To $aLine[0] - 1 If $aLine[$i] = "" Then Continueloop $iLine = $iLine + 1 $aFiles[$iLine] = $aLine[$i] Next ElseIf $aLine[0] = 1 Then If $aLine[1] = "" Then Continueloop If $aLine[1] = "File Not Found" Then Exitloop $iLine = $iLine + 1 $aFiles[$iLine] = $aLine[1] Else ExitLoop EndIf Wend $aFiles[0] = $iLine ReDim $aFiles[$iLine + 1] Return $aFiles EndFunc Func GetDrives() Local $nonFloppydrives[1] Local $removableDrives $removableDrives = DriveGetDrive( "removable" ) If NOT @error Then For $i = 1 to $removableDrives[0] $key = Regread("HKLM\System\MountedDevices","\DosDevices\" & $removableDrives[$i]) If not StringInStr(_HexToString(StringReplace ($key, "00", "")),"Floppy") Then _ArrayAdd($nonFloppydrives, $removableDrives[$i]) EndIf Next $nonFloppydrives[0] = UBound($nonFloppydrives) - 1 EndIf return $nonFloppydrives EndFunc Func SetComboSelection($hWnd, $iIndex = -1) If Not IsHWnd($hWnd) Then $hWnd = GUICtrlGetHandle($hWnd) Return _SendMessage($hWnd, $CB_SETCURSEL, $iIndex) EndFunc Func GetComboSelection($hWnd) If Not IsHWnd($hWnd) Then $hWnd = GUICtrlGetHandle($hWnd) Return _SendMessage($hWnd, $CB_GETCURSEL) EndFunc Func ResetCombo($hWnd) If Not IsHWnd($hWnd) Then $hWnd = GUICtrlGetHandle($hWnd) _SendMessage($hWnd, $CB_RESETCONTENT) EndFunc -
I have a program that copies pictures from a flash drive to the My Pictures directory. My problems is that right now i do 2 search queries for each type of file, one to determine how many files of each type and one in the copy function. Does anyone know a good way to determine how many increments my progress bar will need without having to do a query to determine the number of files? I could easily remove the first query to speed up the program, but then it is impossible to determine the number of increments that will be needed. I could be copying 20 files or 400 files. The intent of the program is to be used with an SD card, so if there is a way to determine number of files on disk, that may be close enough. Any help is appreciated.
-
Multiple Child Guis with same control on each
momar33 replied to momar33's topic in AutoIt GUI Help and Support
I tried that. I am using OnEventMode and i put the GuiSwitch in the checkall button's event using @GUI_WINHANDLE. Func _CheckAllLevels() GUISwitch(@GUI_WINHANDLE) ConsoleWrite("Handle = " & @GUI_WINHANDLE & @CRLF) For $i = 1 to 9 _GUICtrlTreeView_SetChecked($levelTV, $levelItem[$i]) Next EndFunc This did not work, it still affects only the most recently created gui. -
I have a program that can have many child guis at the same time that have the same controls on them. The problem i am having is that it seems that only the most recently created guis controls are working. Example, i have a button, on each gui, that will check all of a bunch of checkboxes in a treeview control, it works fine for the most recently create gui, but if i hit the button on a previously created gui, the checkboxes get checked in the most recently create one. I know this could be solved using arrays for the controls since thats is how i am handling the multiple guis. Is there an easier way? Ideally something like gui2.control1 Any suggestions would be great. I would post the code but it is big and it requires a database to work properly.