-
webbrowser Click
hi im useing this Code to Simulate Mouseclicks on the Screen
Code:
Module WinFromPoint
Public Declare Function PostMessage Lib "user32" Alias "PostMessageA" ( _
ByVal hwnd As IntPtr, _
ByVal wMsg As Int32, _
ByVal wParam As Int32, _
ByVal lParam As Int32) As Int32
Public Declare Function WindowFromPoint Lib "user32" ( _
ByVal stPoint As Point) As IntPtr
Public Const WM_LBUTTONDOWN = &H201
Public Const WM_LBUTTONUP = &H202
Public Sub DoClick()
Dim MyPoint As Point
MyPoint.X = 50
MyPoint.Y = 50
Dim ptHwnd As IntPtr = WindowFromPoint(MyPoint)
Dim retVal As Int32 = PostMessage(ptHwnd, WM_LBUTTONDOWN, 0, 0&)
retVal = PostMessage(ptHwnd, WM_LBUTTONUP, 0, 0&)
End Sub
End Module
but when i try to have it click a button in my form1.webbrowser it doesn't click it ? anyone know why ? it can click anything on my form1 but if i try to have it click a button inside my webbrowser at the x,y it is at it doesn't click it if anyone could Help me out the would be Great 
& i know how to Click buttons in a webbrowser but i just want to do it list way
-
Make sure that your forms scalemode property is set to pixels and that you add your forms left and top to where you want to return the windows hWnd from as the WindowFromPoint starts at the screens left and top, not your forms left and top.
Good Luck
-
 Originally Posted by vb5prgrmr
Make sure that your forms scalemode property is set to pixels and that you add your forms left and top to where you want to return the windows hWnd from as the WindowFromPoint starts at the screens left and top, not your forms left and top.
Good Luck
how do i do that ? sorry im a Noobie
-
look in properties window next to scalemode and using the api is not typical noob behavior
Similar Threads
-
Replies: 1
Last Post: 04-25-2007, 11:39 AM
-
Replies: 0
Last Post: 03-08-2007, 05:24 PM
-
By Keithuk in forum VB Classic
Replies: 2
Last Post: 10-29-2005, 08:57 AM
-
By Jacob Peter K in forum Open Source
Replies: 8
Last Post: 06-02-2004, 02:20 AM
-
By andriano in forum Enterprise
Replies: 1
Last Post: 10-02-2000, 03:54 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
-
Forum Rules
|
Development Centers
-- Android Development Center
-- Cloud Development Project Center
-- HTML5 Development Center
-- Windows Mobile Development Center
|