Jump to content
Sign in to follow this  
kokoilie

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

Recommended Posts

kokoilie

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.

Share this post


Link to post
Share on other sites
FrancescoDiMuro

@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

Thoughts:

  • I will always thank you for the time you spent for me.
    I'm here to ask, and from your response, I'd like to learn.
    By my knowledge, I can help someone else, and "that someone" could help in turn another, and so on.

/*--------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/

ALWAYS GOOD TO READ:

 

Share this post


Link to post
Share on other sites
kokoilie

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

Share this post


Link to post
Share on other sites
kokoilie

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.

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  

  • Similar Content

    • Skeletor
      By Skeletor
      Hi Virtual People, 
      I'm trying to lock my screen in Windows 10 but to no avail. 
      Has Windows 10 forbidden this feature? 
      Send("#l") Above code does not work. Even sending Ctrl Alt Del does not work nor as an Admin. 
      Note: I want to lock my screen, not log off. Thanks for been kind.
       
    • astrionn
      By astrionn
      Hi Guys,
       
      I`m trying to record with my webcam in 5s intervalls and do some stuff between starting to record and stoping.
      I took code from here: https://www.autoitscript.com/forum/topic/27925-webcam-example/
      and took what looked relevant to me.
      I use 3 different files:
       Is called WMS.au3 and contains all the constants for the dll calls is called rec.au3 and does all necessary dll calls to start a webcam recording to a file Is called stopcam.exe and does the dll calls to stop recording into a file WMS.au3  :
      $WM_CAP_START = 0x400 $WM_CAP_UNICODE_START = $WM_CAP_START +100 $WM_CAP_PAL_SAVEA = $WM_CAP_START + 81 $WM_CAP_PAL_SAVEW = $WM_CAP_UNICODE_START + 81 $WM_CAP_UNICODE_END = $WM_CAP_PAL_SAVEW $WM_CAP_ABORT = $WM_CAP_START + 69 $WM_CAP_DLG_VIDEOCOMPRESSION = $WM_CAP_START + 46 $WM_CAP_DLG_VIDEODISPLAY = $WM_CAP_START + 43 $WM_CAP_DLG_VIDEOFORMAT = $WM_CAP_START + 41 $WM_CAP_DLG_VIDEOSOURCE = $WM_CAP_START + 42 $WM_CAP_DRIVER_CONNECT = $WM_CAP_START + 10 $WM_CAP_DRIVER_DISCONNECT = $WM_CAP_START + 11 $WM_CAP_DRIVER_GET_CAPS = $WM_CAP_START + 14 $WM_CAP_DRIVER_GET_NAMEA = $WM_CAP_START + 12 $WM_CAP_DRIVER_GET_NAMEW = $WM_CAP_UNICODE_START + 12 $WM_CAP_DRIVER_GET_VERSIONA = $WM_CAP_START + 13 $WM_CAP_DRIVER_GET_VERSIONW = $WM_CAP_UNICODE_START + 13 $WM_CAP_EDIT_COPY = $WM_CAP_START + 30 $WM_CAP_END = $WM_CAP_UNICODE_END $WM_CAP_FILE_ALLOCATE = $WM_CAP_START + 22 $WM_CAP_FILE_GET_CAPTURE_FILEA = $WM_CAP_START + 21 $WM_CAP_FILE_GET_CAPTURE_FILEW = $WM_CAP_UNICODE_START + 21 $WM_CAP_FILE_SAVEASA = $WM_CAP_START + 23 $WM_CAP_FILE_SAVEASW = $WM_CAP_UNICODE_START + 23 $WM_CAP_FILE_SAVEDIBA = $WM_CAP_START + 25 $WM_CAP_FILE_SAVEDIBW = $WM_CAP_UNICODE_START + 25 $WM_CAP_FILE_SET_CAPTURE_FILEA = $WM_CAP_START + 20 $WM_CAP_FILE_SET_CAPTURE_FILEW = $WM_CAP_UNICODE_START + 20 $WM_CAP_FILE_SET_INFOCHUNK = $WM_CAP_START + 24 $WM_CAP_GET_AUDIOFORMAT = $WM_CAP_START + 36 $WM_CAP_GET_CAPSTREAMPTR = $WM_CAP_START + 1 $WM_CAP_GET_MCI_DEVICEA = $WM_CAP_START + 67 $WM_CAP_GET_MCI_DEVICEW = $WM_CAP_UNICODE_START + 67 $WM_CAP_GET_SEQUENCE_SETUP = $WM_CAP_START + 65 $WM_CAP_GET_STATUS = $WM_CAP_START + 54 $WM_CAP_GET_USER_DATA = $WM_CAP_START + 8 $WM_CAP_GET_VIDEOFORMAT = $WM_CAP_START + 44 $WM_CAP_GRAB_FRAME = $WM_CAP_START + 60 $WM_CAP_GRAB_FRAME_NOSTOP = $WM_CAP_START + 61 $WM_CAP_PAL_AUTOCREATE = $WM_CAP_START + 83 $WM_CAP_PAL_MANUALCREATE = $WM_CAP_START + 84 $WM_CAP_PAL_OPENA = $WM_CAP_START + 80 $WM_CAP_PAL_OPENW = $WM_CAP_UNICODE_START + 80 $WM_CAP_PAL_PASTE = $WM_CAP_START + 82 $WM_CAP_SEQUENCE = $WM_CAP_START + 62 $WM_CAP_SEQUENCE_NOFILE = $WM_CAP_START + 63 $WM_CAP_SET_AUDIOFORMAT = $WM_CAP_START + 35 $WM_CAP_SET_CALLBACK_CAPCONTROL = $WM_CAP_START + 85 $WM_CAP_SET_CALLBACK_ERRORA = $WM_CAP_START + 2 $WM_CAP_SET_CALLBACK_ERRORW = $WM_CAP_UNICODE_START + 2 $WM_CAP_SET_CALLBACK_FRAME = $WM_CAP_START + 5 $WM_CAP_SET_CALLBACK_STATUSA = $WM_CAP_START + 3 $WM_CAP_SET_CALLBACK_STATUSW = $WM_CAP_UNICODE_START + 3 $WM_CAP_SET_CALLBACK_VIDEOSTREAM = $WM_CAP_START + 6 $WM_CAP_SET_CALLBACK_WAVESTREAM = $WM_CAP_START + 7 $WM_CAP_SET_CALLBACK_YIELD = $WM_CAP_START + 4 $WM_CAP_SET_MCI_DEVICEA = $WM_CAP_START + 66 $WM_CAP_SET_MCI_DEVICEW = $WM_CAP_UNICODE_START + 66 $WM_CAP_SET_OVERLAY = $WM_CAP_START + 51 $WM_CAP_SET_PREVIEW = $WM_CAP_START + 50 $WM_CAP_SET_PREVIEWRATE = $WM_CAP_START + 52 $WM_CAP_SET_SCALE = $WM_CAP_START + 53 $WM_CAP_SET_SCROLL = $WM_CAP_START + 55 $WM_CAP_SET_SEQUENCE_SETUP = $WM_CAP_START + 64 $WM_CAP_SET_USER_DATA = $WM_CAP_START + 9 $WM_CAP_SET_VIDEOFORMAT = $WM_CAP_START + 45 $WM_CAP_SINGLE_FRAME = $WM_CAP_START + 72 $WM_CAP_SINGLE_FRAME_CLOSE = $WM_CAP_START + 71 $WM_CAP_SINGLE_FRAME_OPEN = $WM_CAP_START + 70 $WM_CAP_STOP = $WM_CAP_START + 68 rec.au3  :
       
      #include <WMS.au3> #include <GUIConstants.au3> if not FileExists(@ScriptDir&"\vid\"&string(@MON)&"\"&string(@mday)) Then DirCreate(@ScriptDir&"\vid\"&"\"&string(@MON)&"\"&string(@mday)) EndIf $moviefile = @ScriptDir&"\vid"&"\"&string(@MON)&"\"&string(@mday)&"\test.avi" $avi = DllOpen("avicap32.dll") $user = DllOpen("user32.dll") FileWrite(@scriptdir&"\clop.clop",$user) $Main = GUICreate("Camera",350,270) $moviefile=@ScriptDir&"\test.avi" $cap = DllCall($avi, "int", "capCreateCaptureWindow", "str", "cap", "int", BitOR($WS_CHILD,$WS_VISIBLE), "int", 15, "int", 15, "int", 320, "int", 240, "hwnd", $Main, "int", 1) FileWrite(@scriptdir&"\clip.clip",$cap[0]) run(@scriptdir&"\stopcam.exe") DllCall($user, "int", "SendMessage", "hWnd", $cap[0], "int", $WM_CAP_DRIVER_CONNECT, "int", 0, "int", 0) DllCall($user, "int", "SendMessage", "hWnd", $cap[0], "int", $WM_CAP_SET_SCALE, "int", 1, "int", 0) DllCall($user, "int", "SendMessage", "hWnd", $cap[0], "int", $WM_CAP_SET_OVERLAY, "int", 1, "int", 0) DllCall($user, "int", "SendMessage", "hWnd", $cap[0], "int", $WM_CAP_SET_PREVIEW, "int", 1, "int", 0) DllCall($user, "int", "SendMessage", "hWnd", $cap[0], "int", $WM_CAP_SET_PREVIEWRATE, "int", 1, "int", 0) DllCall($user, "int", "SendMessage", "hWnd", $cap[0], "int", $WM_CAP_FILE_SET_CAPTURE_FILEA, "int", 0, "str", $moviefile) DllCall($user, "int", "SendMessage", "hWnd", $cap[0], "int", $WM_CAP_SEQUENCE, "int", 0, "int", 0) Stopcam.exe is the compiled version of this:
      #include "WMS.au3" #include <GUIConstants.au3> $cap = Int(FileRead(@scriptdir&"\clip.clip")) $user = int(fileread(@scriptdir&"\clop.clop")) Sleep(10000) DllCall($user, "int", "SendMessage", "hWnd", $cap, "int", $WM_CAP_STOP, "int", 0, "int", 0) DllCall($user, "int", "SendMessage", "hWnd", $cap, "int", $WM_CAP_END, "int", 0, "int", 0) DllCall($user, "int", "SendMessage", "hWnd", $cap, "int", $WM_CAP_DRIVER_DISCONNECT, "int", 0, "int", 0) DllClose($user) FileDelete(@scriptdir&"\clip.clip") FileDelete(@scriptdir&"\clop.clop")  
      Unfortunately this is not working as I thought it would be working.
      Does someone see what I´m doing wrong?
      It should record the webcam for about 10 seconds ( a little less) and save that to an .avi file.
      It does not stop the recording , I have to stop the process manually...
      Secondly, which confuses me more is that it creates the test.avi not in the location is specified in the script... its stored in the ScriptDir for whatever reason haha
      I hope you can help me
       
      ~HappyCoding
    • Daydreamer067
      By Daydreamer067
      Hi
      in windows 10 i create a new desktop.
      I want to run a script in this desktop, for exemple Mouseclick("left",x,y)
      I want the script to work in that desktop while i switch to the primary desktop.
      So far autoit clicks on the active desktop.
      Is there a way to make it run only on the other desktop ?
       
      Thank you for your response.
    • codingislife
      By codingislife
      Hi everyone, 
      I'm new to the autoit world and am trying to do something a little complicated and am having trouble developing a solution. My OS after reimaging comes up with two operating system choices during boot up, I'd like to delete the incorrect OS. I have noticed that the default OS is always the correct OS. My issue is I need a way to find the OS identifier before I can delete. I know that I  can use bcdedit to find this but it changes every time and it needs to be the correct identifier (i.e. not the Default or bootmgr). If someone knows of a way to parse through the output of bcdedit to find the identifier that would be greatly appreciated. Here is an example of what I am trying to do:
      https://scottiestech.info/2016/07/03/remove-the-choose-an-operating-system-message-when-starting-your-computer/
    • PramodR
      By PramodR
      Hello,
      i am new to AUTO IT development , I would like one help to read value from a POP up.
      i am able to read below values using inspect tool , information given below, I tried to create a script to read value but that does not help. any help is appreciated.
      Available Controls
      POPUP window Controls
      Auto Id = "UpdateNow_Btn"
      Name = Update Now
      Invoke - Button Control
      Below Controls i get when i move inspector tool to the text which i need to read. i need to read the text Name . Currently with my code i get only blank text 
      Auto Id = timeOutLb
      ClassName = TextBlock
      LegacyIAccess = GetName
      Name  = Read Value for Name
       
      My code.
       
×