|
-
Nov 27th, 2001, 01:38 PM
#1
Thread Starter
Hyperactive Member
what API to get Label hWnd?
how can i find the hWnd of the label control?
-
Nov 27th, 2001, 02:48 PM
#2
Unless you use VB 4.0 or earlier, labels are not windows - they don't have a hWnd. They are a static or graphical control, not window-based.
-
Nov 27th, 2001, 04:27 PM
#3
Thread Starter
Hyperactive Member
how about checkbox and option box?
how about checkbox and option box?
-
Nov 27th, 2001, 05:36 PM
#4
ActiveX controls almost always have a hWnd, intrinsic VB controls probably do. Before you ask about every control in VB, use the Object Browser to find out for yourself.
Look up a a control in the Browser, like Label, you'll see it has no .hWnd property. While this is not a guarantee the object has no hWnd, it's an indicator. Check Box & option button controls do have a hWnd property.
-
Nov 28th, 2001, 01:28 AM
#5
Lively Member
everything has a hWnd... but not always as a property.... u'll have to use FindWindow and FindWindowEx functions....
-
Nov 28th, 2001, 03:51 AM
#6
PowerPoster
You can also use EnumChildWindows APi call
-
Nov 28th, 2001, 10:21 AM
#7
Albafa - according to MSDN VB6.0 label controls are not windows, they have no hWnd. Spy++ agrees. If you know differently on an absolute basis, please demonstrate.
And, you folks are right - almost all controls have a hWnd, even if it doesn't show in properties.
-
Nov 28th, 2001, 11:43 PM
#8
Lively Member
omg jim ur right ... i never noticed that shrugs
Guess I was just too used to reading from AOL's "static" labels..
-
Nov 29th, 2001, 07:41 AM
#9
Conquistador
Re: how about checkbox and option box?
Originally posted by FLasH3r
how about checkbox and option box?
VB Code:
Private Declare Function SetWindowText Lib "user32" Alias "SetWindowTextA" (ByVal hwnd As Long, ByVal lpString As String) As Long
Private Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" (ByVal hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, ByVal lpsz2 As String) As Long
Private Sub Command1_Click()
SetWindowText FindWindowEx(Me.hwnd, 0, "ThunderCheckBox", vbNullString), "Hello"
End Sub
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|