Jump to content
EpicValor

How to convert script to send to minimized window

Recommended Posts

EpicValor

I see the ControlSend command, but not sure how to convert the keystrokes to a controlsend format. Does every line in the script need a controlsend equivalent line?


Sleep("5000")
Sleep("10000")
$i = 0
Do
If WinActive( "", "" ) Then
Send("{1 down}")
Sleep("1500")
Send("{1 up}")
Sleep("500")
Send("{- down}") 
Send("{- up}")
Sleep("2500")
EndIf
Until $i = 1

Share this post


Link to post
Share on other sites
JLogan3o13

@EpicValor yes, a ControlSend corresponds to a Send. But instead of sending blindly, you target a specific control on a window. If you can explain more what exactly you are trying to automate, and in what app, we can probably assist further.


√-1 2^3 ∑ π, and it was delicious!

How to get your question answered on this forum!

Share this post


Link to post
Share on other sites
Bilgus
;Sleep("5000")
;Sleep("10000")
$i = 0
Local $hWnd = 0
Const $_SEND_RAW = (1)
Opt("SendKeyDelay", 500)
Opt("SendKeyDownDelay", 1500)
Do
    $i += 1
    $hWnd = WinActive( "", "" )
    If $hWnd Then
        ControlSend($hWnd, "", "", "1-")
        ;ControlSend($hWnd, "", "", "1-", $_SEND_RAW );If you dont want/need special keys...
        Sleep(1000)
    Endif
    ;Send("{1 down}")
    ;Sleep("1500")
    ;Send("{1 up}")
    ;Sleep("500")
    ;Send("{- down}")
    ;Send("{- up}")
    ;Sleep("2500")
Until $i > 10

Opt("SendKeyDelay", 5) ;Defaults
Opt("SendKeyDownDelay", 5)

 

Share this post


Link to post
Share on other sites
Bilgus

Now as for the minimized window part WinActive("","") is not going to give you the handle of the minimized window

I'm assuming you are getting the handle prior to minimizing it

Share this post


Link to post
Share on other sites
EpicValor

Yeah, I have the minimized handle if it's the title of the active screen before I minimize it.  I had to remove the name, because asking about certain programs, even if they are defunct, and no longer in business, is against the rules.  The program itself has a macro tool to automate activities, but it's clunky.

The original script did work if it was the active screen. 

Thanks for the template. I really needed to see the format as it differs from the original. I'll try it when I get home.

Share this post


Link to post
Share on other sites
Melba23

EpicValor,

Quote

 I had to remove the name, because asking about certain programs, even if they are defunct, and no longer in business, is against the rules. 

I see you did not read those rules to which I linked very carefully - you missed the part that says:

"Do not repost the same question if the previous thread has been locked - particularly if you merely reword the question to get around one of the prohibitions listed above"

Do NOT start another thread on this - our patience has limits.

M23

 


Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see 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
Melba23

EpicValor,

And sending me snotty PMs does nothing to affect the outcome - you are not a "special case" anymore than any other gamer who has tried that line.

M23


Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see 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
JLogan3o13

@Bilgus one final addendum, as you are somewhat new to the forum. Typically, if a Mod has stepped into a thread to ask a user specifically what they are trying to automate, there is a reason. As you can see from the outcome above, we've seen most everything and heard most every argument, so have a pretty good idea on these kinds of things.

In the future we would appreciate it if you would hold off helping until that determination has been made.


√-1 2^3 ∑ π, and it was delicious!

How to get your question answered on this forum!

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.

×