20 posts in this topic
I am maybe an intermediate AutoIt script writer, but have no experience creating GUIs.
I have a script with two functions. One for Checkboxes and another with radio buttons. Each function creates it's own window.
I'd like to use one window with both checkboxes and radio buttons.
I pulled samples from AutoIt Help and other places and worked it into this: (RadioCheck still uses the example Case and MsgBoxes. I will clean this up soon)
Func CheckOptions() ; Create a GUI with various controls. Local $hGUI = GUICreate("SGX4CP Options", 275, 250) ; Create a checkbox control. Local $iLoopCheckbox = GUICtrlCreateCheckbox("Loop", 10, 10, 185, 25) Local $iFullScreenCheckbox = GUICtrlCreateCheckbox("Fullscreen", 10, 40, 185, 25) Local $iRestartPlaybackCheckbox = GUICtrlCreateCheckbox("Restart Playback from Sleep", 10, 70, 185, 25) GUICtrlSetState($iRestartPlaybackCheckbox, $GUI_CHECKED) Local $iDisableSleepCheckbox = GUICtrlCreateCheckbox("Disable Sleep", 10, 100, 185, 25) Local $iLogCheckbox = GUICtrlCreateCheckbox("Show Log", 10, 130, 185, 25) GUICtrlSetState($iLogCheckbox, $GUI_CHECKED) Local $idClose = GUICtrlCreateButton("Next", 110, 220, 85, 25) ; Display the GUI. GUISetState(@SW_SHOW, $hGUI) ; Loop until the user exits. While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE, $idClose ExitLoop Case $iLoopCheckbox If _IsChecked($iLoopCheckbox) Then $bLoopChecked = True Else $bLoopChecked = False EndIf Case $iFullScreenCheckbox if _IsChecked($iFullScreenCheckbox) Then $bFullScreenChecked = True Else $bFullScreenChecked = False EndIf Case $iRestartPlaybackCheckbox if _IsChecked($iRestartPlaybackCheckbox) Then $bRestartPlaybackChecked = True Else $bRestartPlaybackChecked = False EndIf Case $iDisableSleepCheckbox if _IsChecked($iDisableSleepCheckbox) Then $bDisableSleepChecked = True Else $bDisableSleepChecked = False EndIf Case $iLogCheckbox if _IsChecked($iLogCheckbox) Then $bLogChecked = True Else $bLogChecked = False EndIf EndSwitch WEnd ; Delete the previous GUI and all controls. GUIDelete($hGUI) EndFunc Func RadioCheck() GUICreate("Select Test",300,180) ; will create a dialog box that when displayed is centered Local $idRadio1 = GUICtrlCreateRadio("Loop Forever", 10, 10) Local $idRadio2 = GUICtrlCreateRadio("Play each video 3 times", 10, 40) Local $idRadio3 = GUICtrlCreateRadio("Play each video separately", 10, 70) GUICtrlSetState($idRadio1, $GUI_CHECKED) Local $idClose = GUICtrlCreateButton("Start Test", 120,100) GUISetState(@SW_SHOW) Local $idMsg ; Loop until the user exits. While 1 $idMsg = GUIGetMsg() Select Case $idMsg = $GUI_EVENT_CLOSE ExitLoop Case $idMsg = $idRadio1 And BitAND(GUICtrlRead($idRadio1), $GUI_CHECKED) = $GUI_CHECKED MsgBox($MB_SYSTEMMODAL, 'Info:', 'The app will run forever, playing each video once, then looping back to the first video.') $bTestSelectForever = True Case $idMsg = $idRadio2 And BitAND(GUICtrlRead($idRadio2), $GUI_CHECKED) = $GUI_CHECKED MsgBox($MB_SYSTEMMODAL, 'Info:', 'Each video will loop 3 times then move to the next video.') $bTestSelect3Times = True Case $idMsg = $idRadio3 And BitAND(GUICtrlRead($idRadio2), $GUI_CHECKED) = $GUI_CHECKED MsgBox($MB_SYSTEMMODAL, 'Info:', 'Player opens, first video plays, player closes. Player opens, second video plays, player closes, etc.') $bTestSelectSingleVideo = True EndSelect WEnd EndFunc I would like to combine the checkbox "Loop" and the radio button $idRadio2. Radio2 requires Loop to be checked.
I planned to remove the Loop checkbox and only enable it if Radio2 is selected.
Can I combine these two functions into one with one window with both Checkboxes and Radio Buttons?
Hi friends, I have a question, please.
I have created a window containing a edit box
I need to know how to change the keyboard language,
if a user open the script it will be change the keyBord language in window automatically into English
I found more examples but didn't work with me .
I use the windows 10 os
Please help me .
thanks in advance to all
with my Greetings and my appreciation for all users and admins
Internet Explorer 11, AutoIt 126.96.36.199
I want to download many files which are published with hyperlink on a web page. I use AutoIt and when there is a few files, it works even if It's on a website with secured links.
I have a script to download link items with the object method (I gave a partial sample), but when the number of link exceed the web page, there is not an auto scroll, then the links which are not on displayed without scroll are not downloaded.
I'm trying to move and resize a program call CPUID HWMonitor (http://www.cpuid.com/softwares/hwmonitor.html) but WinMove() doesn't work. Can someone tell me how to get this to work for this program? I've successfully moved other programs using WinMove(), and I've used WinGetTitle ("[ACTIVE]") to confirm the title is correct. WinActivate("CPUID HWMonitor") does work.
If I run the following code nothing happens, doesn't move or resize, but AutoIt doesn't complain about the code either:
WinMove("CPUID HWMonitor", 0, 0, 475, 715) The class changes every time the program opens (and I've nevery had a lot of success with classes tbh, bit hit and miss for me).
I want to create a program that resizes and changes style/exstyles of other windows.
The problem is that i don`t know why my script doesn`t work.
Here is an example:
#RequireAdmin #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> Global $setStyle, $getStyle, $outputString='', $getHandle, $setState $getHandle = WinGetHandle("[CLASS:Notepad]") $outputString &= $getHandle & @LF $setState = GUISetState(@SW_SHOWNORMAL, $getHandle) $outputString &= $setState & @LF $getStyle = GUIGetStyle($getHandle) If IsArray($getStyle) = 1 Then $outputString &= $getStyle& ' ' &$getStyle& @LF Else $outputString &= "NOTHING" & @LF EndIf $setStyle = GUISetStyle($WS_POPUPWINDOW, -1, $getHandle) $outputString &= $setStyle & @LF MsgBox(0,"OUTPUT", $outputString) It doesn`t work... At least not for me
I noticed that $getHandle is "0x0021023A" and AutoIt Window Info shows : "0x000000000021023A"
I don`t know if that`s a problem . If it is, idk how to fix it