Sign in to follow this  
Followers 0
remin

How to check if window is on top?

16 posts in this topic

#1 ·  Posted (edited)

How can I check if a window is on top or not?

I thought WinGetState would do it but there is no value for on top window.

any idea?

Edited by remin

Share this post


Link to post
Share on other sites



remin,

WinList returns the windows in z-order (topmost first). But you need to trim the list a bit to get sensible results: ;)

#include <Array.au3>

; Get a list of all windows
$aList = WinList()

; Loop up through the array
For $i = $aList[0][0] To 1 Step -1
    ; If there is no title or the window is not visible
    If $aList[$i][0] = "" Or (Not BitAND(WinGetState($aList[$i][1]), 2)) Then
        ; Remove it
        _ArrayDelete($aList, $i)
    EndIf
Next

; Results are in z-list order
_ArrayDisplay($aList)
All clear? :)

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Oeps... :(

Thank you for your reply Melba.  :)

I find this very difficult.

On my list ($aList) I had 2 windows before the one I made "On top" using an .ahk script:

^SPACE::  Winset, Alwaysontop, , A 

What I want to do is to create a simple Always On Top toggle hotkey in autoit (like the one above)   :)

Edited by remin

Share this post


Link to post
Share on other sites

remin,

Perhaps if you use the WinSetOnTop function when running the HotKey:

#include <GUIConstantsEx.au3>

HotKeySet("^t", "_SendToTop")

$hGUI = GUICreate("Test", 500, 500)

GUISetState()

While 1
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch
WEnd

Func _SendToTop()
    ; Send to top
    Winactivate($hGUI)
    ; And keep it there
    WinSetOnTop($hGUI, "", 1)
EndFunc
How is that? :)

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

Thank again for your nice reply :)

This only set the "on top" status, isn't it?

How can I remove this status when the window has already an "on top" status?

Share this post


Link to post
Share on other sites

remin,

Have you discovered the excellent Help file yet? :huh:

If not then I do recommend that you use it - it would tell you that you can use WinSetOnTop to change the ONTOP status:

Determines whether the window should have the "TOPMOST" flag set.
1=set on top flag, 0 = remove on top flag
So all you need do is use the correct parameter and Robert is your mother's brother. ;)

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

Oh yes I started to read the excellent help file.

True, it is done very well.

But I couldn't find out how to toggle the On Top status

and detect the status of a window.

Still don't understand it, sorry.

I started to be an autohotkey user.

Then I found out that I prefer the autoit code.

Easier and more like Basic and even more important,

Autoit scripts seems to create less problems (in my case).

(Maybe because an .au3 file seems to be active even in non-active

mode (it always has an 0,05 % cpu usage), unlike an .ahk file

which seems to go in sleep mode and doesn't react always as 

it has to do).

But I noted that a few things are more difficult to obtain in 

autoit p.e. Toggle on top mode (is only 1 line code in AHK)

and a few more things.

Maybe I have to stop trying to convert all my AHK scripts

to Autoit and use the best Script language for every need

I have.

Both can run together isn't it?

BTW.. thank you for your time you've dedicated to my question. :)

Edited by remin

Share this post


Link to post
Share on other sites

remin,

If this a GUI you are creating then I suggest you use a flag of some sort to indicate the current status of the GUI - then the HotKey can adjust its action. I use a label in this snippet:

#include <GUIConstantsEx.au3>

HotKeySet("^t", "_SendToTop")

$hGUI = GUICreate("Test", 100, 100)
$cLabel = GUICtrlCreateLabel("Not on Top", 10, 10, 80, 80)

GUISetState()

While 1
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch
WEnd

Func _SendToTop()
    ; Check status of GUI
    If GUICtrlRead($cLabel) = "On Top" Then
        ; Remove OnTop attribute
        WinSetOnTop($hGUI, "", 0)
        ; Change label
        GUICtrlSetData($cLabel, "Not on Top")
    Else
        ; Send to top
        Winactivate($hGUI)
        ; And keep it there
        WinSetOnTop($hGUI, "", 1)
        ; Change label
        GUICtrlSetData($cLabel, "On Top")
    EndIf
EndFunc
How does that work for you? Please ask if you have any questions. :)

 

I noted that a few things are more difficult to obtain

Always the case when comparing languages - something simple in one is ofter more complicated in the other. I am sure we could find examples where AutoIt is much simpler than AHK - but then as this is not a competition, I am not really bothered. ;)

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

remin,

If this a GUI you are creating then I suggest you use a flag of some sort to indicate the current status of the GUI - then the HotKey can adjust its action. I use a label in this snippet:

How does that work for you? Please ask if you have any questions. :)

 

Thank you again for your kind answer and sorry for the fact that I'm not clear enough.

Yes that works fine. Very nice. I would like to use the code not for my own GUI but for all windows that I occasionally want to set "on top"

Would that be possible?

Always the case when comparing languages - something simple in one is ofter more complicated in the other. I am sure we could find examples where AutoIt is much simpler than AHK - but then as this is not a competition, I am not really bothered. ;)
 
M23

 

 

Yes, sure, you're right.

I already found a few things which can be done easier in autoit.

I like your comment saying that it is not a competition.

It seems to me the right approach ;)

Share this post


Link to post
Share on other sites

remin,,

The same basic process will work on third party GUIs as well, all you need to do is create a suitable flag. This script works on the SciTE editor: :)

HotKeySet("^t", "_SendToTop")

; Get handle of SciTe GUI
$hSciTE = WinGetHandle("[CLASS:SciTEWindow]")

; Create flag to follow state
$fSciTEOnTop = False

; Keep script alive
While 1
    Sleep(10)
WEnd

Func _SendToTop()
    ; Check status of SciTE
    If $fSciTEOnTop Then
        ; Remove OnTop attribute
        WinSetOnTop($hSciTE, "", 0)
        ; Clear flag
        $fSciTEOnTop = False
    Else
        ; Send to top
        Winactivate($hSciTE)
        ; And keep it there
        WinSetOnTop($hSciTE, "", 1)
        ; Set flag
        $fSciTEOnTop = True
    EndIf
EndFunc
M23

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

Thanks :D

I changed 

$hSciTE = WinGetHandle("[CLASS:SciTEWindow]")

to

$hSciTE = WinGetHandle("[ACTIVE]")

and now it works also for a third party GUI. :)

But it seems to me that we must add to the script the code to update the Active window, isn't it?

Because every time I use the shortcut on whatever active window, it puts the previous active window at top (the 1st one I used the shortcut on).

Share this post


Link to post
Share on other sites

remin,

I would add another HotKey to the script which identifies the active GUI and then you can use that handle as the one to action from then on. Give it a go yourself and see what you can come up with - you know where I am if you get stuck. ;)

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

remin,

I would add another HotKey to the script which identifies the active GUI and then you can use that handle as the one to action from then on. Give it a go yourself and see what you can come up with - you know where I am if you get stuck. ;)

M23

 

I haven't fully understand what you mean with this.

I will not profit of you knowledge of autoit, so will try to create the code myself, but please tell me a little bit more what you mean with this.

One hotkey to check which GUI is the current active GUI (I'll do a search on the net to find it out) and another one to use above code, is that what you mean?

Or can it be integrated in one function?

BTW are all people on this forum so nice and helpful as you are? ;)

Thanks for everything.

Share this post


Link to post
Share on other sites

remin,

Everything is in the one script. Use one HotKey to identify the current active window and store its handle. Then another HotKey will use that handle to either set or remove the ONTOP attribute. You just need to separate the 2 parts of the function you already have. :)

 

are all people on this forum so nice and helpful as you are?

I would like to think that we are a helpful community to those who try to help themselves and who stick to the Forum rules - you have read them I hope. ;)

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

This might be useful to you too...

#include <Constants.au3>
#include <WindowsConstants.au3>
#include <WinAPI.au3>

Example()

Func Example()
    Local $hGUI = GUICreate('')
    GUISetState(@SW_SHOW, $hGUI)

    ; Set the GUI as being on top using the handle returned by GUICreate.
    WinSetOnTop($hGUI, '', 1)

    MsgBox($MB_SYSTEMMODAL, '', 'Is the GUI on top: ' & _IsOnTop($hGUI) & ', this should be True')
    GUIDelete($hGUI)
EndFunc   ;==>Example

; Check if a window is on top.
Func _IsOnTop($sTitle, $sText = '')
    Return BitAND(_WinAPI_GetWindowLong(WinGetHandle($sTitle, $sText), $GWL_EXSTYLE), $WS_EX_TOPMOST) = $WS_EX_TOPMOST
EndFunc   ;==>_IsOnTop
1 person likes this

_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 04/09/2015

Share this post


Link to post
Share on other sites

#16 ·  Posted (edited)

Yes it seems to work!

This is my final code:

#include <GUIConstantsEx.au3>

HotKeySet("^h", "_WhichActive")
HotKeySet("^t", "_SendToTop")

; Keep script alive
While 1
    Sleep(10)
WEnd


Func _WhichActive()
  ; Get handle of Active GUI
  global $hActivE = WinGetHandle("[ACTIVE]")
  ; Create flag to follow state
  global $fActivEOnTop = False
Endfunc


Func _SendToTop()
    ; Check status of Active GUI
    If $fActivEOnTop Then
        ; Remove OnTop attribute
        WinSetOnTop($hActivE, "", 0)
        ; Clear flag
        $fActivEOnTop = False
    Else
        ; Send to top
        Winactivate($hActivE)
        ; And keep it there
        WinSetOnTop($hActivE, "", 1)
        ; Set flag
        $fActivEOnTop = True
    EndIf
EndFunc

Thanks Melba

Thanks guinness too for your reply.

I'll look into it.

Edited by remin

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0

  • Similar Content

    • Shirdish_chakravarthi
      By Shirdish_chakravarthi
      Hello Friends i am new to autoit and i am stuck in middle of automation of flashing tool..
      my requirement is i have a window and i have to get the value present in that window (below is the picture)

      in the above window i need to get the value of the highlighted field.the value of this filed keeps on changing...ii need to get the current value present in the field..below are the details of the window and field..

       
      CAN it be done?
       
      thanks

    • Shirdish_chakravarthi
      By Shirdish_chakravarthi
      Hello Guys i am working on automating a flashing tool..When flashing is started if there is any error in connection it pops's up a error window...(as shown below)

       whenever this popup appears i need a msgbox to appear saying "error occured" how can i do this?
      Thanks

    • Jibberish
      By Jibberish
      Hi,
      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?
      Thanks
      Jibberish
    • nacerbaaziz
      By nacerbaaziz
      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,
      e.g :
      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 .
      Note:  
       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
    • WoodGrain
      By WoodGrain
      Hi guys,
      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).
      Thanks all!