Sign in to follow this  
Followers 0
UndeadHarlequin

controllgethandle vs wingethandle

9 posts in this topic

#1 ·  Posted (edited)

In case of using Controllclick, what are the differences between Controllgethandle and wingethandle??

--Edit-- ( winactive is not winwait ,.XD)--

Edited by UndeadHarlequin

Share this post


Link to post
Share on other sites



In case of using Controllclick, what are the differences between Controllgethandle and wingethandle??

--Edit-- ( winactive is not winwait ,.XD)--

WInGetHandle gets the handle for a window, whereas ControlGetHandle gets the handle for a... wait for it... Control (oh you guessed didn't you.) A control is something like a button or a label or an edit in the window.

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites

i didn´t guesse,.. and i didnt understand:-(

Hmm ok i understood, that a controll is a button, lable, combobox or something like that.

what the hell is a "wait 4 it"??

Where can i use the handle i got?, isnt it much easier to use the controll id classNN??

Isn´t it as identyfing as a controllhandle?

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Yes once you have a handle you can use it in place of the class instance etc

For example: ControlSend ( $WindowHandle, "", $ControlHandle, "abcd")

WinWait is pretty simple, did you look at the help file?

It will simply pause your script until a window that matches the

paramaters you specified exists.

Kenny

Edited by ken82m

My Contributions _StringMultiReplace PC Builders Console - Secure PDF Creator - Cisco VPN Installer MS DNS Server Backup Script - MS DHCP Backup Script IT Admin Console - Toggle Admin Mode - MyMovies-Add Discs Script - IT Help Desk and System Information Tool - Set On Lid Close Power Option - Streaming Media Server & Website "I believe that when we leave a place, part of it goes with us and part of us remains... Go anywhere, when it is quiet, and just listen.. After a while, you will hear the echoes of all our conversations, every thought and word we've exchanged.... Long after we are gone our voices will linger in these walls for as long as this place remains."

Share this post


Link to post
Share on other sites

Hmm, but i only use the controlklick 4 each button once a time. ,. so i gona declare Many $vars, 4 same effect?

or are there greate differents i cant see?:-)

Share this post


Link to post
Share on other sites

i didn´t guesse,.. and i didnt understand:-(

Hmm ok i understood, that a controll is a button, lable, combobox or something like that.

what the hell is a "wait 4 it"??

Where can i use the handle i got?, isnt it much easier to use the controll id classNN??

Isn´t it as identyfing as a controllhandle?

Most of the time the ID is what you need. GuiGetMsg() gives the ID of the control which caused an event for example. You need the handle when you use certain API functions.

ID's are allocated to controls in a given window as they are created and 2 different windows can have buttons which both have the ID of 13 say. Control handles are actually windows handles and are unique.


Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites

Usually you get handles if your going to use windows and/or controls more than once.

Unless you wanted to verify all the controls existing ahead of time.

If it's just one click for each button.

just get your window handle and then issue your controlclick() using the window handle

and the control information from the AutoIT Window Info Tool.

I usually use the "Advanced (Class)",

but you can comine multiple properties too if you want.

Kenny


My Contributions _StringMultiReplace PC Builders Console - Secure PDF Creator - Cisco VPN Installer MS DNS Server Backup Script - MS DHCP Backup Script IT Admin Console - Toggle Admin Mode - MyMovies-Add Discs Script - IT Help Desk and System Information Tool - Set On Lid Close Power Option - Streaming Media Server & Website "I believe that when we leave a place, part of it goes with us and part of us remains... Go anywhere, when it is quiet, and just listen.. After a while, you will hear the echoes of all our conversations, every thought and word we've exchanged.... Long after we are gone our voices will linger in these walls for as long as this place remains."

Share this post


Link to post
Share on other sites

ah,.. so it is only 4 using button more ofthan then once a time.

If i send only one command it is "stupid" to use the controllhandle, isnt it?

in this case:-) THANKS

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

Exactly.

Like I said you still might use it if for whatever you needed to

make sure all the controls were there before starting.

You could do this:

$Control1 = ControlGetHandle ( $WinHandle, "", "....controlinfo" )
$Control2 = ControlGetHandle ( $WinHandle, "", "....controlinfo" )
If $Control1 = "" OR $Control2 = "" Then MsgBox(0,"","Control Missing")

Kenny

Edited by ken82m

My Contributions _StringMultiReplace PC Builders Console - Secure PDF Creator - Cisco VPN Installer MS DNS Server Backup Script - MS DHCP Backup Script IT Admin Console - Toggle Admin Mode - MyMovies-Add Discs Script - IT Help Desk and System Information Tool - Set On Lid Close Power Option - Streaming Media Server & Website "I believe that when we leave a place, part of it goes with us and part of us remains... Go anywhere, when it is quiet, and just listen.. After a while, you will hear the echoes of all our conversations, every thought and word we've exchanged.... Long after we are gone our voices will linger in these walls for as long as this place remains."

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