Re: how can i get the handle of a window's textbox
Originally Posted by HopeZ
it's textbox of another window
try this code Add A timer and set interval property to 1 and drop a Label too named Label1
and move your mouse around the screen to know the Hwnd
Code:
Option Explicit
Private Declare Function WindowFromPoint Lib "user32" (ByVal xPoint As Long, ByVal yPoint As Long) As Long
Private Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long
Private Type POINTAPI
X As Long
Y As Long
End Type
Dim MousePNT As POINTAPI
Dim X As Integer, Y As Integer, curWindow As Long
Private Sub Form_Load()
Label1.Caption = "Hwnd = "
End Sub
Private Sub Timer1_Timer()
Call GetCursorPos(MousePNT)
X = MousePNT.X
Y = MousePNT.Y
curWindow = WindowFromPoint(X, Y)
Me.Caption = X & "/" & Y
Label1.Caption = curWindow
End Sub
Re: how can i get the handle of a window's textbox
Originally Posted by HopeZ
it's textbox of another window
You can either use FindWindowEx API or the EnumChildWindows API. Take a look at www.allapi.net for the examples on these APIs.
Use [code]your code here[/code] tags when you post source code
Search here before you post your question, someone might have already asked it before. My Articles
Bookmarks