forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Get self handle

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
dmonckton
Contributor
Contributor


Joined: 09 Aug 2002
Posts: 117
Location: Lewes, U.K.

PostPosted: Mon Jul 06, 2009 8:00 am    Post subject: Get self handle Reply with quote

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
View user's profile Send private message
Hooligan
VDS Developer
VDS Developer


Joined: 28 Oct 2003
Posts: 480
Location: California

PostPosted: Mon Jul 06, 2009 12:56 pm    Post subject: Reply with quote

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
View user's profile Send private message
vdsalchemist
Admin Team


Joined: 23 Oct 2001
Posts: 1448
Location: Florida, USA

PostPosted: Mon Jul 06, 2009 3:29 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
dmonckton
Contributor
Contributor


Joined: 09 Aug 2002
Posts: 117
Location: Lewes, U.K.

PostPosted: Thu Jul 09, 2009 2:42 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help All times are GMT
Page 1 of 1

 
Jump to:  
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

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group