Valhalla Legends Forums Archive | Visual Basic Programming | Getting the handle

AuthorMessageTime
Networks
Does anyone know how to get the handle of a label, I am assuming this is through API since the label in VB6 doesn't hold the property for you to directly access. Thank you in advance.
August 1, 2005, 8:18 PM
UserLoser.
GetDlgItem is most likely what you need.
August 1, 2005, 10:50 PM
Grok
UserLoser is correct.  Networks if you are getting the handle using the ID, you can get the ID by running Spy++.  If the dialog is dynamically created, you will need to iterate the dialog items and decide which is correct by examining its properties.  I've never had to do that, every application dialog I've needed to access has been a resource, or the order of build is consistent so that the ID doesn't change.
August 2, 2005, 1:52 PM
Networks
I am not sure if the ID is:

nIDDlgItem
    [in] Specifies the identifier of the control to be retrieved.

but I don't know what exactly this is or how to get it.
August 2, 2005, 2:30 PM
Grok
Running Spy++ you can view the contents of a dialog window such as this:

[img]http://www.valhallalegends.com/images/misc/spy1000.jpg[/img]

Hmm well nevermind this is a bad example because it's VB.  You're probably working with non-VB created dialogs.
August 2, 2005, 8:26 PM

Search