Jump to content

Is there a way to make gui combo scrolling in win10 easier?


Recommended Posts

I'm making a program that has a combo control in a gui and back in win7 when the window was focused the scroll wheel could be used to scroll through it's contents, now i'm using win10 and i have to put the mouse on that control to scroll up and down.
Since now the scroll wheel works depending on where the mouse is, is there a way to make it no matter where on the gui the pointer is?
Also if the only way to do it is some complex hotkey functions will it work with pressing space to toggle a checkbox?
If you need to see what i have so far let me know and i'll copy it here.

Link to post
Share on other sites

@kokoilie

Hi and welcome to the AutoIt forum :)

When you ask for help, you should always what you did, in order to correct you ( if necessary ) or point you in the right direction :)

Show us what you did, and I think a lot of people would help you with your question :)

Click here to see my signature:

Spoiler

ALWAYS GOOD TO READ:

 

Link to post
Share on other sites

ok here it is
 

#NoTrayIcon
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <Crypt.au3>
Global $dir, $exe ;system
Global $cstart, $cmanage, $clist, $cexe, $crealm, $ccheck, $cserv ;main gui
Global $cadd1, $cadd2, $cremove1, $cremove2, $clist1, $clist2 ;acc manage gui
Global $count, $counts, $i, $list, $acc, $realm, $serv, $f, $key, $acci, $passi, $bad ;internal
$key = InputBox ("Decyption key", "Please input a incryption/decryption key.", "", "*M", 285, 180)
If $key = "" Then Exit
init()
make_main_window ()
Func make_main_window ()
    GUICreate ("Autologin",285 ,150)
    $clist = GUICtrlCreateCombo ("", 10, 10, 265, 20)
    $cstart = GUICtrlCreateButton ("Start", 10, 35, 50, 20, 0x0001)
    $cmanage = GUICtrlCreateButton ("Manage Accs", 65, 35, 80, 20)
    $cexe = GUICtrlCreateButton ($exe, 150, 35, 100, 20)
    GUICtrlCreateLabel ("Realmlist content", 10, 65, 100, 20)
    $crealm = GUICtrlCreateInput ($realm, 10, 80, 265, 20)
    $cserv = GUICtrlCreateCombo ("", 10, 110, 265, 20)
    $ccheck = GUICtrlCreateCheckbox ("", 255, 35, 20, 20)
    main_params ()
    GUISetState(@SW_SHOW)
    loop_main_window ()
EndFunc
Func loop_main_window ()
    While 1
        Switch GUIGetMsg ()
            Case $GUI_EVENT_CLOSE
                Exit
            Case $cstart
                $read = GUICtrlRead ($cserv)
                ;If $read <> $realm Then
                ;   If $realm = "Realmlist not found" Then start ()
                ;   $f = FileOpen ("data\engb\realmlist.wtf", 2)
                ;   FileWrite ($f, "set realmlist "&$read)
                ;   FileClose ($f)
                ;EndIf
                start ()
            Case $cexe
                manageexe ()
            Case $cmanage
                GUIDelete()
                make_acc_window ()
                loop_acc_window ()
        EndSwitch
    WEnd
EndFunc
Func make_acc_window ()
    GUICreate ("Accounts and servers",285 ,150)
    $cadd1 = GUICtrlCreateButton ("Add", 10, 10, 50, 20)
    $cadd2 = GUICtrlCreateButton ("Add", 145, 10, 50, 20)
    $cremove1 = GUICtrlCreateButton ("Remove", 65, 10, 50, 20)
    $cremove2 = GUICtrlCreateButton ("Remove", 200, 10, 50, 20)
    $clist1 = GUICtrlCreateList ("", 10, 35, 130, 105)
    $clist2 = GUICtrlCreateList ("", 145, 35, 130, 105)
    acc_params ()
    GUISetState(@SW_SHOW)
EndFunc
Func loop_acc_window ()
    While 1
        Switch GUIGetMsg ()
            Case $GUI_EVENT_CLOSE
                GUIDelete()
                init ()
                make_main_window ()
            Case $cadd1
                $count += 1
                $read = InputBox ("Add account", "Please input the account name", "", " M")
                IniWrite ("autologin.ini", "accs", $count, $read)
                GUICtrlSetData ($clist1, $read)
                $read = InputBox ("Add account", "Please input your password", "", "*M")
                $read = _Crypt_EncryptData($read, $key, $CALG_DES)
                IniWrite ("autologin.ini", "pass", $count, $read)
                IniWrite ("autologin.ini", "main", "c", $count)
                init ()
            Case $cadd2
                $counts += 1
                $read = InputBox ("Add server", "Please input the realmlist address", "", " M")
                IniWrite ("autologin.ini", "servers", $counts, $read)
                IniWrite ("autologin.ini", "main", "s", $counts)
                GUICtrlSetData ($clist2, $read)
                init ()
            Case $cremove1
                $read = GUICtrlRead ($clist1)
                If $read = "" Then ContinueLoop
                For $i = 0 To ($count - 1)
                    If $read = $acc[$i] Then
                        ExitLoop
                    EndIf
                Next
                $i += 1
                IniDelete ("autologin.ini", "accs", $i)
                IniDelete ("autologin.ini", "pass", $i)
                $count -= 1
                IniWrite ("autologin.ini", "main", "c", $count)
                GUICtrlSetData($clist1, "")
                If $count <> 0 Then
                    For $i = 1 To $count
                        GUICtrlSetData ($clist1, $acc[$i-1])
                    Next
                EndIf
            Case $cremove2
                $read = GUICtrlRead ($clist2)
                If $read = "" Then ContinueLoop
                For $i = 0 To ($counts - 1)
                    If $read = $serv[$i] Then
                        ExitLoop
                    EndIf
                Next
                $i += 1

                IniDelete ("autologin.ini", "servers", $i)
                $counts -= 1
                IniWrite ("autologin.ini", "main", "s", $counts)
                GUICtrlSetData($clist2, "")
                If $count <> 0 Then
                    For $i = 1 To $counts
                        GUICtrlSetData ($clist2, $serv[$i-1])
                    Next
                EndIf
        EndSwitch
    WEnd
EndFunc
Func acc_params ()
    If $count <> 0 Then
        For $i = 1 To $count
            GUICtrlSetData ($clist1, $acc[$i-1])
        Next
    EndIf
    If $counts <> 0 Then
        For $i = 1 To $counts
            GUICtrlSetData ($clist2, $serv[$i-1])
        Next
    EndIf
EndFunc
Func start ()
    HotKeySet ("{ESC}", "kill")
    HotKeySet ("{PAUSE}", "sent")
    $read = GUICtrlRead ($clist)
    If GUICtrlRead ($ccheck) = $GUI_CHECKED Then Run ($dir & $exe)
    For $i = 0 To ($count - 1)
        If $read = $acc[$i] Then
            ExitLoop
        EndIf
    Next
    $acci = $acc[$i]
    $passi = $pass[$i]
    While 1
        Sleep (100)
        ;ToolTip ("Welcome " & $read & @CRLF & "Press {Pause} to login.")
        ;ToolTip ("Welcome " & $read & "(" & $i & ")" & @CRLF & "Press {Pause} to login.")
        ToolTip ("Welcome " & $acci & @CRLF & "Press {Pause} to login.")
    WEnd
EndFunc
Func manageexe ()
    $file = FileOpenDialog ("Find WoW.exe", $dir, "wow.exe (*.exe)",3,"wow.exe")
    $array = StringSplit ($file, "\")
    $exe = $array[$array[0]]
    $file = StringTrimRight ($file, StringLen ($exe))
    If $dir <> $file Then
        $dir = $file
        IniWrite ("autologin.ini", "main", "path", $dir)
    EndIf
    GUICtrlSetData ($cexe, $exe)
    IniWrite ("autologin.ini", "main", "exe", $exe)
    GUICtrlSetState ($cstart, $GUI_ENABLE)
    GUICtrlSetTip ($cexe, "")
    main_params ()
EndFunc
Func init ()
    If FileExists ("autologin.ini") = 0 Then
        FileOpen ("autologin.ini", 1)
        FileClose (1)
        FileSetAttrib("autologin.ini", "+H")
    EndIf
    $count = IniRead ("autologin.ini", "main", "c", 0)
    If $count > 0 Then
        Global $acc[$count],$cryp[$count],$pass[$count],$bad[$count]
        For $i = 1 To $count
            $acc[$i-1] = IniRead ("autologin.ini", "accs", $i, "")
            $cryp[$i-1] = IniRead ("autologin.ini", "pass", $i, "")
        Next
        For $i = 1 To $count
            $pass[$i-1] = BinaryToString (_Crypt_DecryptData ($cryp[$i-1], $key, $CALG_DES))
            If $pass[$i-1] = "ÿÿÿÿ" Then
                $bad[$i-1] = True
            Else
                $bad[$i-1] = False
            EndIf
        Next
    EndIf
    $counts = IniRead ("autologin.ini", "main", "s", 0)
    If $counts > 0 Then
        Global $serv[$counts]
        For $i = 1 To $counts
            $serv[$i-1] = IniRead ("autologin.ini", "servers", $i, "")
        Next
    EndIf
    $dir = IniRead ("autologin.ini", "main", "path", @ScriptDir)
    $exe = IniRead ("autologin.ini", "main", "exe", "\wow.exe")
    $realm = FileRead ("data\engb\realmlist.wtf")
    If @error Then
        $realm = "Realmlist not found"
    EndIf
EndFunc
Func main_params ()
    If FileExists ($exe) = 0 Then
        GUICtrlSetState ($ccheck, $GUI_UNCHECKED)
        GUICtrlSetState ($ccheck, $GUI_DISABLE)
        GUICtrlSetTip ($cexe, "Exe is missing, please click here to find new one.")
    EndIf
    If $count = 0 Then
        GUICtrlSetState ($cstart, $GUI_DISABLE)
        GUICtrlSetState ($clist, $GUI_DISABLE)
        ToolTip ("There are no accounts, click here to add.", 800, 420, "",1, 1)
    Else
        For $i = 1 To $count
            If $bad[$i-1] = False Then
                $list = $list & "|" & $acc[$i-1]
            Else
                $list = $list & "|" & $acc[$i-1] & "!"
            EndIf
        Next
        GUICtrlSetData($clist, $list);, $acc[0])
    EndIf

    $list = ""
    If $counts = 0 Then
        GUICtrlSetState ($cserv, $GUI_DISABLE)
    Else
        For $i = 1 To $counts
            $list = $list & "|" & $serv[$i-1]
        Next
        GUICtrlSetData($cserv, $list, $serv[0])
    EndIf
EndFunc
Func sent ()
    Send ($acci & "{TAB}" & $passi & "{ENTER}")
    ToolTip ("")
    Exit
EndFunc
Func kill ()
    ToolTip ("")
    Exit
EndFunc

with "$cstart = GUICtrlCreateButton ("Start", 10, 35, 50, 20, 0x0001)" i managed to make it start without using hotkeys, hopefully there is something similar for the other ctrls

Link to post
Share on other sites
  • 2 months later...

Seeing how many answers I got, I decided to try a different approach on the issue. Got happy with the "low tech" fix by making the checkbox 1st and using the arrow keys to navigate to and in the combo list. Here is how it looks now:
 

#NoTrayIcon
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <Crypt.au3>
Global $dir, $exe ;system
Global $cstart, $cmanage, $clist, $cexe, $crealm, $ccheck, $cserv ;main gui
Global $cadd1, $cadd2, $cremove1, $cremove2, $clist1, $clist2 ;acc manage gui
Global $count, $counts, $i, $list, $acc, $realm, $serv, $f, $key, $acci, $passi, $pass, $bad ;internal
$key = InputBox ("Decyption key", "Please input a incryption/decryption key.", "", "*M", 285, 180)
If $key = "" Then Exit
init()
make_main_window ()
Func make_main_window ()
    GUICreate ("Autologin",285 ,150)
    $ccheck = GUICtrlCreateCheckbox ("", 255, 35, 20, 20)
    $clist = GUICtrlCreateCombo ("", 10, 10, 265, 20)
    $cstart = GUICtrlCreateButton ("Start", 10, 35, 50, 20, 0x0001)
    $cmanage = GUICtrlCreateButton ("Manage Accs", 65, 35, 80, 20)
    $cexe = GUICtrlCreateButton ($exe, 150, 35, 100, 20)
    GUICtrlCreateLabel ("Realmlist content", 10, 65, 100, 20)
    $crealm = GUICtrlCreateInput ($realm, 10, 80, 265, 20)
    $cserv = GUICtrlCreateCombo ("", 10, 110, 265, 20)
    ;$ccheck = GUICtrlCreateCheckbox ("", 255, 35, 20, 20)
    main_params ()
    GUISetState(@SW_SHOW)
    loop_main_window ()
EndFunc
Func loop_main_window ()
    While 1
        Switch GUIGetMsg ()
            Case $GUI_EVENT_CLOSE
                Exit
            Case $cstart
                $read = GUICtrlRead ($cserv)
                ;If $read <> $realm Then
                ;   If $realm = "Realmlist not found" Then start ()
                ;   $f = FileOpen ("data\engb\realmlist.wtf", 2)
                ;   FileWrite ($f, "set realmlist "&$read)
                ;   FileClose ($f)
                ;EndIf
                start ()
            Case $cexe
                manageexe ()
            Case $cmanage
                GUIDelete()
                make_acc_window ()
                loop_acc_window ()
        EndSwitch
    WEnd
EndFunc
Func make_acc_window ()
    GUICreate ("Accounts and servers",285 ,150)
    $cadd1 = GUICtrlCreateButton ("Add", 10, 10, 50, 20)
    $cadd2 = GUICtrlCreateButton ("Add", 145, 10, 50, 20)
    $cremove1 = GUICtrlCreateButton ("Remove", 65, 10, 50, 20)
    $cremove2 = GUICtrlCreateButton ("Remove", 200, 10, 50, 20)
    $clist1 = GUICtrlCreateList ("", 10, 35, 130, 105)
    $clist2 = GUICtrlCreateList ("", 145, 35, 130, 105)
    acc_params ()
    GUISetState(@SW_SHOW)
EndFunc
Func loop_acc_window ()
    While 1
        Switch GUIGetMsg ()
            Case $GUI_EVENT_CLOSE
                GUIDelete()
                init ()
                make_main_window ()
            Case $cadd1
                $count += 1
                $read = InputBox ("Add account", "Please input the account name", "", " M")
                IniWrite ("autologin.ini", "accs", $count, $read)
                GUICtrlSetData ($clist1, $read)
                $read = InputBox ("Add account", "Please input your password", "", "*M")
                $read = _Crypt_EncryptData($read, $key, $CALG_DES)
                IniWrite ("autologin.ini", "pass", $count, $read)
                IniWrite ("autologin.ini", "main", "c", $count)
                init ()
            Case $cadd2
                $counts += 1
                $read = InputBox ("Add server", "Please input the realmlist address", "", " M")
                IniWrite ("autologin.ini", "servers", $counts, $read)
                IniWrite ("autologin.ini", "main", "s", $counts)
                GUICtrlSetData ($clist2, $read)
                init ()
            Case $cremove1
                $read = GUICtrlRead ($clist1)
                If $read = "" Then ContinueLoop
                For $i = 0 To ($count - 1)
                    If $read = $acc[$i] Then
                        ExitLoop
                    EndIf
                Next
                $i += 1
                IniDelete ("autologin.ini", "accs", $i)
                IniDelete ("autologin.ini", "pass", $i)
                $count -= 1
                IniWrite ("autologin.ini", "main", "c", $count)
                GUICtrlSetData($clist1, "")
                If $count <> 0 Then
                    For $i = 1 To $count
                        GUICtrlSetData ($clist1, $acc[$i-1])
                    Next
                EndIf
            Case $cremove2
                $read = GUICtrlRead ($clist2)
                If $read = "" Then ContinueLoop
                For $i = 0 To ($counts - 1)
                    If $read = $serv[$i] Then
                        ExitLoop
                    EndIf
                Next
                $i += 1

                IniDelete ("autologin.ini", "servers", $i)
                $counts -= 1
                IniWrite ("autologin.ini", "main", "s", $counts)
                GUICtrlSetData($clist2, "")
                If $count <> 0 Then
                    For $i = 1 To $counts
                        GUICtrlSetData ($clist2, $serv[$i-1])
                    Next
                EndIf
        EndSwitch
    WEnd
EndFunc
Func acc_params ()
    If $count <> 0 Then
        For $i = 1 To $count
            GUICtrlSetData ($clist1, $acc[$i-1])
        Next
    EndIf
    If $counts <> 0 Then
        For $i = 1 To $counts
            GUICtrlSetData ($clist2, $serv[$i-1])
        Next
    EndIf
EndFunc
Func start ()
    HotKeySet ("{ESC}", "kill")
    HotKeySet ("{PAUSE}", "sent")
    $read = GUICtrlRead ($clist)
    If GUICtrlRead ($ccheck) = $GUI_CHECKED Then Run ($dir & $exe)
    For $i = 0 To ($count - 1)
        If $read = $acc[$i] Then
            ExitLoop
        EndIf
    Next
    $acci = $acc[$i]
    $passi = $pass[$i]
    While 1
        Sleep (100)
        ;ToolTip ("Welcome " & $read & @CRLF & "Press {Pause} to login.")
        ;ToolTip ("Welcome " & $read & "(" & $i & ")" & @CRLF & "Press {Pause} to login.")
        ;ToolTip ("Welcome " & $acci & @CRLF & "Press {Pause} to login.")
        ToolTip ("Welcome " & $acci & " " & $passi & @CRLF & "Press {Pause} to login.")
    WEnd
EndFunc
Func manageexe ()
    $file = FileOpenDialog ("Find WoW.exe", $dir, "wow.exe (*.exe)",3,"wow.exe")
    $array = StringSplit ($file, "\")
    $exe = $array[$array[0]]
    $file = StringTrimRight ($file, StringLen ($exe))
    If $dir <> $file Then
        $dir = $file
        IniWrite ("autologin.ini", "main", "path", $dir)
    EndIf
    GUICtrlSetData ($cexe, $exe)
    IniWrite ("autologin.ini", "main", "exe", $exe)
    GUICtrlSetState ($cstart, $GUI_ENABLE)
    GUICtrlSetTip ($cexe, "")
    main_params ()
EndFunc
Func init ()
    If FileExists ("autologin.ini") = 0 Then
        FileOpen ("autologin.ini", 1)
        FileClose (1)
        FileSetAttrib("autologin.ini", "+H")
    EndIf
    $count = IniRead ("autologin.ini", "main", "c", 0)
    If $count > 0 Then
        Global $acc[$count],$cryp[$count],$pass[$count],$bad[$count]
        For $i = 1 To $count
            $acc[$i-1] = IniRead ("autologin.ini", "accs", $i, "")
            $cryp[$i-1] = IniRead ("autologin.ini", "pass", $i, "")
        Next
        For $i = 1 To $count
            $pass[$i-1] = BinaryToString (_Crypt_DecryptData ($cryp[$i-1], $key, $CALG_DES))
            If $pass[$i-1] = "ÿÿÿÿ" Then
                $bad[$i-1] = True
            Else
                $bad[$i-1] = False
            EndIf
        Next
    EndIf
    $counts = IniRead ("autologin.ini", "main", "s", 0)
    If $counts > 0 Then
        Global $serv[$counts]
        For $i = 1 To $counts
            $serv[$i-1] = IniRead ("autologin.ini", "servers", $i, "")
        Next
    EndIf
    $dir = IniRead ("autologin.ini", "main", "path", @ScriptDir)
    $exe = IniRead ("autologin.ini", "main", "exe", "\wow.exe")
    $realm = FileRead ("data\engb\realmlist.wtf")
    If @error Then
        $realm = "Realmlist not found"
    EndIf
EndFunc
Func main_params ()
    If FileExists ($exe) = 0 Then
        GUICtrlSetState ($ccheck, $GUI_UNCHECKED)
        GUICtrlSetState ($ccheck, $GUI_DISABLE)
        GUICtrlSetTip ($cexe, "Exe is missing, please click here to find new one.")
    EndIf
    If $count = 0 Then
        GUICtrlSetState ($cstart, $GUI_DISABLE)
        GUICtrlSetState ($clist, $GUI_DISABLE)
        ToolTip ("There are no accounts, click here to add.", 800, 420, "",1, 1)
    Else
        For $i = 1 To $count
            If $bad[$i-1] = False Then
                $list = $list & "|" & $acc[$i-1]
            Else
                $list = $list & "|" & $acc[$i-1] & "!"
            EndIf
        Next
        GUICtrlSetData($clist, $list);, $acc[0])
    EndIf

    $list = ""
    If $counts = 0 Then
        GUICtrlSetState ($cserv, $GUI_DISABLE)
    Else
        For $i = 1 To $counts
            $list = $list & "|" & $serv[$i-1]
        Next
        GUICtrlSetData($cserv, $list, $serv[0])
    EndIf
EndFunc
Func sent ()
    Send ($acci & "{TAB}" & $passi & "{ENTER}")
    ToolTip ("")
    Exit
EndFunc
Func kill ()
    ToolTip ("")
    Exit
EndFunc

the commented part near the top of the main loop (rows 35 to 40) is the next thing i should work on but it's a different topic.

This script was meant to be for personal use but feel free to use it, might help you with games where you can login with more than 1 account and you don't/can't remember all the passwords.

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
  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By WilliamasKumeliukas
      2021.07.15 News: Project is NOT dead! I am still very devoted into accomplishing this project, I am spending my every bit of energy that is left at end of the day (when there is any) for this project and it really does challenge my knowledge in AutoIt language but I won't give up  
      Hi,
      I started this project alone in May 2020 as project in my spare time at work, I'm working for a IT company that started opening their services to residential customers few months ago and now my position in the company kind of drifted in the doom and gloom world of repetitive tasks like: Reinstallation + Configuration of Windows 10.
      The procedure is very repetitive and I started feeling like being a robot which is the main reason I started this project.
       
      ==============================FAQ==================================
      1. Q: Do you want this project to be accomplished with the usage of AutoIt ONLY or 3rd party tools / Scripts (BATCH / POWERSHELL / VB) ? A: No, if I cannot find a way using AutoIt to accomplish a task I will move to my Plan B which consist of automating an 3rd party tool to accomplish the affected task until a solution is found. 2. Q: What do I get from helping/collaborating in this project? A: I will personally take the responsibility to mention you in the credits of this project. 3. Q: If I have more questions, can I ask? A: Certainly! feel free to ask any questions related to this project! 4. Q: What is the main goal of this project? A: Automating Windows 10 configuration without user interaction needed (as much as possible) ______________________________________________________________________________________________________________________________
      Current progression of the project (more will be added in future)
      « Blue = Info || Yellow = Unfinished/Untested || Purple = Could be better || Green = Done ||Red = Not Yet Started »
      ***Very early Stage ***
      Connect Network Attached Storage(NAS) (Work but missing configuration in GUI - AutoIt only)
      Download & Install up to 600+ softwares (Tested & Working - using 3rd party tool + 50/50 Powershell/AutoIt)
       Auto prediction of Apps name of text typed inside input (Tested & Working - AutoIt Only)
      Change OEM Informations (Tested & Working -  AutoIt)
      Disable hibernation (Tested & Working - AutoIt only)
      Change Computer Name (Work but require testing - AutoIt only) 
      Show Computer Information and Smart status on GUI (Tested & Working - AutoIt Only)
      Change .pdf / .pdfxml from Edge to Adobe Reader DC (Tested & Working - using 3rd party tool)
      Change Edge to Google Chrome as Default Browser (Tested & Working - using 3rd party tool)
      Windows Updater (Seems to work but require further testing - AutoIt only)
      Install Office 365 / 2013 + Activation (To Do)
      Add L2TP VPN Configuration in Windows Built-in VPN (To Do)
      Save / Load tasks configuration profile in (.ini file) to avoid repeating same configuration twice (In progress - AutoIt Only)
      (EXPERIMENTAL) Install Apps from Microsoft Store with UIAutomation UDF made by: @junkew(Work if you know what your doing)
         P.S: Installing Apps from Microsoft Store will require usage of  UIA spy tool made by @LarsJ which you can download & learn how to use it on UIA Spy Tool thread.
      ***  If this project interest you, Reply here This will greatly help me to see if you'd like this project to become real  ***
       
      Download: W10-Configurator.zip  (2021-07-19) 
      Project Website: W10-Configurator on GitHub 
      ______________________________________________________________________________________________________________________________
      Best Regards,
      ~WilliamasKumeliukas
    • By beautifulsoup
      Hi All,
      I'm not sure if its possible that I'm trying to achieve, I've looked into https://www.autoitscript.com/autoit3/scite/docs/SciTE4AutoIt3/AutoIt3Wrapper.html and such resources for help, but I cant really find the answer to my question.
      So upon compiling the script in SciTE, the exe file is given a Description under file Properties>Details. I understand, that  one can enter info manually there and it can even implement the version automatically with each compilation.
       
      What I'm trying to achieve is to somehow include the "@ScriptName" in the Details>File Description Field. But as I see no variable can be taken after "#" in this case.
       
      Do You think its achievable? (Win 10)
       
      Much obliged for taking time on reading this.
       
      Kind Regards,
      Brave


    • By IndianSage
      Hi,
      I have a specific situation:
      Is it possible to run autoit script/.exe as a task which in turn is automating a desktop user interactive application on windows 10 where user will not be logged in - at best I can get user locked? 
      If so how will this work or is there any tool available to do this?
      I am trying z-cron task scheduler but it runs only some part also I tried windows 10 task schedule with option to allow task to run which is user interactive type but that too does not work.
      Looking forward to hear from you to help me out of this situation.
      Thanks,
       
    • By therks
      So I have no example code currently because I'm not sure where to even start.
      We're using the parental controls on the computer and the kids each have their own user profiles with limited time. The problem we're encountering is when their time runs out, or if they just hit Win+L and leave the computer, their games are still running in the background. I was hoping to write up a quick AutoIt script and throw it in a recurring scheduled task to just sign off any of the kid's profiles that's not currently active. I found some suggestions to use "query session" and then "logoff [user]" in the command line (which it seems I could easily automate with AutoIt) but that's only available on Win Pro and this system is running Home (and I even tried copying the query.exe from a Pro system but it errors out). Is there some AutoIt equivalent to the query and logoff functions or am I stuck?
      Edit: I'm adding some clarification to exactly what I'm hoping to get out of this script.
      I'd like to setup a scheduled task that runs outside of the current user (perhaps under the SYSTEM account?) in case NO user is currently active, that will detect which users are currently signed in. If users from a predefined list are not currently active, sign them off entirely.
      So let me give two examples:
      Example #1:
      - I am logged in, but not active (I left my browser open and locked the computer) - Nephew A is logged in, but not active (his time ran out while his game was running and the computer auto-locked) - Nephew B is logged in, and currently playing a game When script runs, ignore my profile (leave it signed in), log out Nephew A (closing his game), and ignore Nephew B because he's actively using the computer. Example #2:
      - I am logged in - Nephew A is logged in - Nephew B is logged in - No users are currently active (Windows is sitting on the choose user / sign in screen) When script runs, ignore my profile, log out Nephew A and Nephew B.  
      I would perceive pseudo code, going as such:
      $aChildUsers = [ 'NephewA', 'NephewB' ] $aUserList = GetSignedInUsers() For $i = 0 to UBound($aUserList)-1 If Not UserIsActive($aUserList[$i]) Then For $j = 0 to UBound($aChildUsers)-1 If $aUserList[$i] = $aChildUsers[$j] Then LogOffUser($aUserList[$i]) Next EndIf Next Obviously, GetSignedInUsers(), UserIsActive(), LogOffUser() are not real functions. What I'm searching for is something of their equivalent.
      Thanks for your time!
    • By paw
      I use SetSoundDevice to control my audio devices but the UI was either
       
      blurry like this:
      or unusable like this:

      so I made this horrible thing to add scaling to the GUI:
      #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Change2CUI=y #AutoIt3Wrapper_Res_HiDpi=y #AutoIt3Wrapper_AU3Check_Parameters=-w 3 -w 4 -w 5 #AutoIt3Wrapper_Run_Au3Stripper=y #Au3Stripper_Parameters=/sf /sv /rm #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** #include <File.au3> ;~ _convertGUI("") If $CmdLine[0] <> 0 Then _convertGUI($CmdLine[1]) Func _convertGUI($sFilePath) If $sFilePath <> "" Then Local $aArray = FileReadToArray($sFilePath) Else ;TEST DATA Local $aArray[6] = ['$H_Res_Language = GUICtrlCreateProgress(5, 120, 210 + 25, 480, 20, BitOR($GUI_SS_DEFAULT_COMBO, $CBS_SIMPLE)) ; $CBS_DROPDOWNLIST)', _ 'Local $h_Ok = GUICtrlCreateButton("Ok", 72, 224, 81, 33, 0)', _ 'GUICreate($Warning_TiTle, 700, 310, -1, -1, $WS_SIZEBOX + $WS_SYSMENU + $WS_MINIMIZEBOX)', _ 'GUICtrlCreateLabel("Output type: ", 30, 130, 65, 20) ;, $SS_RIGHT)', _ '$H_FieldNameEdit = GUICtrlCreateEdit($INP_FieldNameEdit, 100,260+25, 500, 150 - 25) ;comment', 'Local $H_CANCEL = GUICtrlCreateGraphic("Cancel", 224, 224, 97, 33, 0)'] EndIf Local $hTimer = TimerInit(), $iGUIElementCount = 0, $sResult = "", $sFileName = "", $sDrive = "", $sDir = "", $sExtension = "" If @Compiled Then _PathSplit($sFilePath, $sDrive, $sDir, $sFileName, $sExtension) $sFileName = StringRegExpReplace($sFilePath, "^.*\\", "") EndIf For $i = 0 To (UBound($aArray) - 1) If StringRegExp($aArray[$i], "GUICtrlCreate|GUICreate") Then $sResult = _splitComma($aArray[$i]) If Not @error Then $aArray[$i] = $sResult $iGUIElementCount += 1 EndIf Next ConsoleWrite("t = " & TimerDiff($hTimer) & " GUI elements = " & $iGUIElementCount & " lines = " & (UBound($aArray) - 1) & @CRLF) If $sFileName <> "" Then Local $hFile = FileOpen("edited." & $sFileName, 2) _FileWriteFromArray("edited." & $sFileName, $aArray) FileClose($hFile) EndIf Exit EndFunc ;==>_convertGUI Func _splitComma($sString) Local $sSplitResult = "", $sTrimmedR = "", $sTrimmedL = "" Local $aSplit = StringSplit($sString, ',') If Not @error Then $sTrimmedR = "" $sTrimmedL = "" For $j = 1 To $aSplit[0] If StringRegExp($aSplit[1], "(?:.GUICtrlCreateGraphic|GUICtrlCreateProgress|GUICtrlCreateSlider|GUICtrlCreateTab|GUICtrlCreateTreeView)") Then If $j = 1 Then While StringLeft($aSplit[$j], 1) <> '(' $sTrimmedL &= StringLeft($aSplit[$j], 1) $aSplit[$j] = StringTrimLeft($aSplit[$j], 1) WEnd $aSplit[$j] = StringTrimLeft($aSplit[$j], 1) EndIf EndIf If $j = $aSplit[0] Then While StringRight($aSplit[$j], 1) <> ')' $sTrimmedR &= StringRight($aSplit[$j], 1) $aSplit[$j] = StringTrimRight($aSplit[$j], 1) WEnd $aSplit[$j] = StringTrimRight($aSplit[$j], 1) EndIf If StringRegExp($aSplit[$j], "[0-9]") And $aSplit[$j] <> -1 And $aSplit[$j] <> 0 And $aSplit[$j] <> 1 And Not StringInStr($aSplit[$j], ')') Then If StringRegExp($aSplit[$j], "\-|\+") Then ;put parenthesis around + or - $aSplit[$j] = '(' & $aSplit[$j] & ")*$g_DPI" Else $aSplit[$j] = $aSplit[$j] & "*$g_DPI" EndIf EndIf If $j < $aSplit[0] Then $sSplitResult &= $aSplit[$j] & ',' ElseIf $j = $aSplit[0] Then $sSplitResult &= $aSplit[$j] & ')' Else $sSplitResult &= $aSplit[$j] EndIf Next If $sTrimmedR <> "" Then $sSplitResult &= StringReverse($sTrimmedR) If $sTrimmedL <> "" Then $sSplitResult = $sTrimmedL & '(' & $sSplitResult Else SetError(1) Return EndIf ConsoleWrite($sSplitResult & @CRLF) Return $sSplitResult EndFunc ;==>_splitComma
      And now it looks good: 
      but it doesn't work on everything, for example the "GUICtrlCreateLabel("Output type: ", 30, 130, 65, 20) ;, $SS_RIGHT)" (from the autoit3wrapper gui)
      because the comment contains a parenthesis and it would break completely if there were variables as parameters..
      Is there some kind of parser around that I could use instead or maybe someone who has already done something like this?
×
×
  • Create New...