somebody has an idea ? need to get the handle of a label....
(don write now: use LABEL1.HWND ... this will not work)
taLON
Printable View
somebody has an idea ? need to get the handle of a label....
(don write now: use LABEL1.HWND ... this will not work)
taLON
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...
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
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.
Here is a cheating way to get the handle. Well not exactly. Stick the label inside of a picture box. Picture control has hwnd.
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.