| View previous topic :: View next topic |
| Author |
Message |
dmonckton Contributor


Joined: 09 Aug 2002 Posts: 117 Location: Lewes, U.K.
|
Posted: Mon Jul 06, 2009 8:00 am Post subject: Get self handle |
|
|
Hi
Does anybody know how to get the handle/identifier of the application
that has been scripted? I want to paste it to the clipboard once the dialog
is visible. I remember you can do something with the ~ but I don't know what!
| Code: |
Title Test
DIALOG CREATE,Test,-1,0,210,133
DIALOG ADD,BUTTON,BUTTON1,71,76,64,24,Press
DIALOG SHOW
%%hwnd = handle of this application
clipboard set,%%hwnd
:Evloop
wait event
goto @event()
:BUTTON1BUTTON
info Hello World
goto evloop
:Close
exit
|
Thanks
David. |
|
| Back to top |
|
 |
Hooligan VDS Developer


Joined: 28 Oct 2003 Posts: 480 Location: California
|
Posted: Mon Jul 06, 2009 12:56 pm Post subject: |
|
|
Hi David,
You can assign a class name on the Dialog create line or you can get the identifier using @winexists(), or both... The tilde is normally used to reference elements within another window...
Hooligan _________________ Hooligan
Why be normal? |
|
| Back to top |
|
 |
vdsalchemist Admin Team

Joined: 23 Oct 2001 Posts: 1448 Location: Florida, USA
|
Posted: Mon Jul 06, 2009 3:29 pm Post subject: |
|
|
Here ya go...
| Code: |
Title Test
DIALOG CREATE,Test,-1,0,210,133
DIALOG ADD,BUTTON,BUTTON1,71,76,64,24,Press
DIALOG SHOW
# Give @winexists() the Title bar text and it will return the window handle
%%hwnd = @winexists(Test)
# Use the ~ in front of a element name to get the window ID
%%button1hwnd = @winexists(~BUTTON1)
clipboard set,%%hwnd
:Evloop
wait event
goto @event()
:BUTTON1BUTTON
info Hello World
goto evloop
:Close
exit
|
_________________ Home of
Give VDS a new purpose!
 |
|
| Back to top |
|
 |
dmonckton Contributor


Joined: 09 Aug 2002 Posts: 117 Location: Lewes, U.K.
|
Posted: Thu Jul 09, 2009 2:42 pm Post subject: |
|
|
Thanks that worked fine. What about if your script does not create a window how do you get the process handle. I'm asking all this because I'm going to attempt to write some call-back function and I need handles for these.
| Code: |
Title BoringBeep
%%hwnd = @winexists(BoringBeep)
clipboard set,@strdel(%%hwnd,1)
Beep
exit
|
That does not get the handle!
Thanks
David |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You can attach files in this forum You can download files in this forum
|
|