\r\n\r\n
Go Back  Xtreme Visual Basic Talk > Legacy Visual Basic (VB 4/5/6) > API > SendMessage Problems


\r\n \r\n
 
 
Thread Tools Display Modes

\r\n\r\n\r\n
I\'ve written a little program that navigates around the web for you (not particularly useful, but I\'m just using it to learn) using a webcontrol. I want to run it in the background, when it wouldn\'t have focus, and I\'d be doing other things. I\'ve found the sendmessage and findwindow APIs, and the findwindow seems to work. My problem seems to be both the FindWindowEx (which always returns 0) and the sendmessage(which has a type mismatch error I can\'t seem to get rid of) All this code should do is tab through the page.
\r\n
\r\n
\r\n
\r\n
Code:
\r\n
Dim mWnd As Long\r\nmWnd = FindWindow(vbNullString, "Title")\r\nmWnd = FindWindowEx(mWnd, 0&, "Internet Explorer_Server", vbNullString)\r\ndo\r\n If WebBrowser1.Busy = False Then\r\n SendMessage mWnd, Val(vbKeyTab), 1, ByVal vbNullString\r\n DoEvents\r\n else\r\n DoEvents\r\n end if\r\nwhile bRunning=True
\r\n
\r\n \r\n\r\n
\r\n \r\n\r\n \r\n \r\n\r\n \r\n\r\n \r\n\r\n \r\n\r\n
\r\n \r\n \r\n \r\n \r\n Reply With Quote\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n\r\n \r\n\r\n
\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n \r\n \r\n \r\n \r\n\r\n\r\n\r\n\r\n'; pd[355845] = '\r\n\r\n \r\n\r\n
\r\n
\r\n
\r\n\r\n
\r\n \r\n\r\n\r\n\r\n\r\n\r\n \r\n\r\n\r\n\r\n \r\n
\r\n
\r\n  \r\n #2  \r\n \r\n \r\n \r\n \r\n \r\n
\r\n\r\n
\r\n \r\n Old\r\n \r\n 04-04-2003, 04:47 AM\r\n \r\n \r\n \r\n
\r\n
\r\n \r\n \r\n \r\n \r\n \r\n
Squirm\'s Avatar\r\n\r\n
\r\n \r\n Squirm\r\n Squirm is offline\r\n\r\n\r\n
Prev Previous Post   Next Post Next
  #1  
Old 04-03-2003, 07:59 PM
Nelda Nelda is offline
Regular
 
Join Date: Feb 2003
Location: TX
Posts: 53
Default SendMessage Problems


I've written a little program that navigates around the web for you (not particularly useful, but I'm just using it to learn) using a webcontrol. I want to run it in the background, when it wouldn't have focus, and I'd be doing other things. I've found the sendmessage and findwindow APIs, and the findwindow seems to work. My problem seems to be both the FindWindowEx (which always returns 0) and the sendmessage(which has a type mismatch error I can't seem to get rid of) All this code should do is tab through the page.


Code:
Dim mWnd As Long mWnd = FindWindow(vbNullString, "Title") mWnd = FindWindowEx(mWnd, 0&, "Internet Explorer_Server", vbNullString) do If WebBrowser1.Busy = False Then SendMessage mWnd, Val(vbKeyTab), 1, ByVal vbNullString DoEvents else DoEvents end if while bRunning=True
Reply With Quote
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Sending ReturnKey with SendMessage EpcH API 5 03-20-2003 12:31 AM
VB.net API SendMessage MyNuS API 1 12-06-2002 05:49 AM
SendMessage Problems Luber25 API 4 03-12-2002 04:32 PM
How to use SendMessage API pinster API 2 03-12-2002 04:26 AM

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
 
 
-->