Results 1 to 6 of 6

Thread: Get the HWND of a label ....

  1. #1
    Guest
    somebody has an idea ? need to get the handle of a label....

    (don write now: use LABEL1.HWND ... this will not work)


    taLON

  2. #2
    Guest
    Before getting a label's HWND (Hwnd is Handle of the window, so more likel you want to say Handle of the label), yes you can get it, you can get it really easily, but the thing is to be able to really get any use out of that handle, you would have to understand how the label is set as, label is a CHILD under the window that it's in, I"m not going to totally go and explain to you how to do it, but here's one way of getting the handle of your label.. get some kinda "API SPY" program and then run your program and follow the instructions of the spy and it'll give you the class name, and the handle...

  3. #3
    Guest
    ok, ok... i thing i know something about the api.
    i only wanted a simple solution, because im really tired ( it now 5:30 am here).

    but... problem is now already solved... and i go to bed *g*

    greetz
    taLON

  4. #4
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649
    Sorry but you can't! The simple answer is that the label doesn't have a hWnd. The label and the image are windowless controls and therefor lack a hWnd. VB draws the text you add to a label caption directly to the form.

  5. #5
    Fanatic Member
    Join Date
    Jan 2000
    Location
    Nitro
    Posts
    633
    Here is a cheating way to get the handle. Well not exactly. Stick the label inside of a picture box. Picture control has hwnd.
    Chemically Formulated As:
    Dr. Nitro

  6. #6
    Addicted Member
    Join Date
    Aug 1999
    Location
    Ottawa,ON,Canada
    Posts
    217
    How about using a TextBox, locking it, setting its border style to nothing, and changing its backcolor to the window backcolor? Joacim Andersson's response is correct, so you won't get it out of the Label regardless of what anyone says.

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