CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 15 of 28

Threaded View

  1. #23
    Join Date
    Sep 2002
    Posts
    924
    Originally posted by mce
    if i do not have the label ID, how? There is no windows handle in VB label.. it is not a windows class, is there a way out in this case??
    What do you mean there is no windows handle?
    Look at it is Spy++, and you will see the handle of the label control.

    BTW: I noticed that with every VB control I looked at, the Handle and Control ID value was the same.

    If you know the handle of the parent window, and you know the caption of the label (and if the caption is unique within the app), you can use FindWindowEx, to get the handle of the control by it's caption.

    Also, note that you can use the GetWindowText API function to get the "Caption" of a control as well (this is not necessarly the same text you would get when sending the WM_GETTEXT message).

    *edit*
    BTW: The Class Name I get for the labels I used for testing is "WindowsForms10.STATIC.app1"
    Last edited by RussG1; April 7th, 2004 at 11:19 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured