Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  HOME    TRACKER    Visual Basic

Webpage Msgbox And MouseEvent


I am facing here a problem.Currntly I am writing a macro in excel to fill my web based software automatically.The code is working properly.But when I click a button then a MSGBOX appear and ask for process the command.Here I use setCursorPos and MouseLeftUp and MouseLeftDown function.But It did not work for MSGBOX.Any suggestion will be helpful me.

Thanks in advance,

View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Webpage Msgbox Click

I have a webbased software(Intranet) and I want to automatically fill its text boxes and command button.I have two issues at this time.
1-How can I select a 2nd option in a listbox
2-And how can I click process or cancel button on a message box

Here is my code:

Sub IECompletion()
While IE.readyState <> 4
Application.Wait Now + TimeSerial(0, 0, 1)
End Sub

Sub Datamanipulation()
Application.ScreenUpdating = False
Dim doc4 As HTMLDocument
Dim tblBlock As HTMLTable
Dim CallsBlock As HTMLCheckbox
Dim InOp As HTMLOptionElement
Set Doc = IE.Document
Set myIframe = Doc.getElementById("WorkFrame")
Set doc2 = myIframe.contentWindow.Document
Set cFrame = doc2.getElementById("CustomerInfo")
Set doc3 = cFrame.contentWindow.Document


doc3.getElementById("tfcode").innerText = "51"
doc3.getElementById("tfNumber").innerText = "8260395"
Application.Wait Now + TimeSerial(0, 0, 2)
Set tblCus = doc3.all.Item("Table2", 1)
'Here is the list box ID
Set InOp = doc3.getElementById("sTD")

'MsgBox Trim("InnerText is" & tblCus.Rows(2).Cells(1).innerText)
If tblCus.Rows(2).Cells(1) = " None" Then
Set tblBlock = doc3.getElementById("TableNewBlockList")
doc3.getElementById("cb_a_b5").Checked = True
'MsgBox tblBlock.Rows(5).Cells(1).ID 'End If
'And here is the msgbox appear and I want to click its yes option.
End If
End Sub

Webpage Msgbox And Mouse_event

I am facing here a problem.Currntly I am writing a macro in excel to fill my web based software automatically.The code is working properly.But when I click a button then a MSGBOX appear and show proccess done.Here I use setCursorPos and MouseLeftUp and MouseLeftDown/Sendmessage/Sendkeys functions.But It did not work for MSGBOX.Any suggestion will be helpful me(image attached).

Thanks in advance,

Public Const WM_LBUTTONDOWN As Integer = &H201
Public Const WM_LBUTTONUP As Integer = &H202
Public Const BM_CLICK = &HF5
Public Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Public Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Public 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
Public Declare Function ShowWindow Lib "user32" (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long

Public Declare Function SetCursorPos Lib "user32" (ByVal x As Long, ByVal y As Long) As Long

Public Declare Sub mouse_event Lib "user32" (ByVal dwFlags As Long, ByVal dx As Long, ByVal dy As Long, ByVal cButtons As Long, ByVal dwExtraInfo As Long)

Public Declare Function GetMessageExtraInfo Lib "user32" () As Long

Dim h1wnd As Long
Dim swnd As Long
Dim fhwnd As Long
h1wnd = FindWindow("IEFrame", vbNullString)
swnd = ShowWindow(hwnd, 1)
'fhwnd = FindWindowEx(hwnd, 0, vbNullString, "VBScript")
'ShowWindow fhwnd, 1
SetCursorPos 515, 420
SendMessage h1wnd, WM_LBUTTONDOWN, 0, 0
SendMessage h1wnd, WM_LBUTTONUP, 0, 0
mouse_event MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0
mouse_event MOUSEEVENTF_LEFTUP, 0, 0, 0, 0
Application.SendKeys "{Enter}", True

End Sub

Webpage Will Only Load, If A Msgbox Is In The Code
Hi All,

When I navigate to a webpage using:


I can wait for the page to load in my web browser control by doing:

VB Code:
While brWeb.ReadyState <> SHDocVw.tagREADYSTATE.READYSTATE_COMPLETE            Application.DoEvents()           End While

Now i need to click a button in the web browser programatically by doing (to call the next page):

(where item is the submit button)

The problem is now if I call:

VB Code:
While brWeb.ReadyState <> SHDocVw.tagREADYSTATE.READYSTATE_COMPLETE            Application.DoEvents()           End While

straight after this it thinks readyState is already complete because it doesn't seem to load the new webbpage in the first place(the url is still the same). It will only load the web page if I put a messagebox in my code after the "".

Why is this? Any ideas what I can do about it? I can't have a message box in there and if I don't it doesn't load the page?!?

JournalPlayBack And MouseEvent
When ever I call mouse_event it never registers while i'm executing Playback

but when I call to abort the hook the click go's through, Is this normal?

Private Function JournalPlaybackProc(ByVal Code As Long, ByVal wParam As Long, ByRef lParam As Long) As Long
Dim iX As Integer, iY As Integer, lTime As Long
On Error GoTo LogError

Select Case Code


'Select the Next Event Message
lMsgCount = lMsgCount + 1
If lMsgCount >= lMsgCountMax Then
'Last Message processed, so remove the Journal Hook
tEVENTMSG = tEventList(lMsgCount)
End If
JournalPlaybackProc = 0


'Grab the Event Message Structure and Process the Message
lParam = VarPtr(tEVENTMSG)

If .message = Mouse_LeftDown Then
lTime = (.time - tEventList(lMsgCount - 1).time) - 7
'Pause can't be less than 0
If lTime < 0 Then lTime = 0
Debug.Print ("Got Left Down")

Call UnhookWindowsHookEx(lAppHookID)
Call UnhookWindowsHookEx(lHookID)


If lMsgCount > 1 Then
Sleep lTime
End If
End If

If .message = WM_MOUSEMOVE Then
iX = .paramL
iY = .paramH
'Pause time for processing lag (calculated as time between this and prev.message)
lTime = (.time - tEventList(lMsgCount - 1).time) - 7
'Pause can't be less than 0
If lTime < 0 Then lTime = 0
'Move the Cursor accordingly
SetCursorPos iX, iY
'If this isn't the 1st message pause before processing the next message
If lMsgCount > 1 Then
Sleep lTime
End If
End If
End With

Case Else

'Pass this message along...
Debug.Print (tEVENTMSG.message)
JournalPlaybackProc = CallNextHookEx(lHookID, Code, wParam, ByVal lParam)
Exit Function

End Select

Exit Function

Debug.Print "Error in JournalPlaybackProc():" & Err.Description, lMsgCount, lMsgCountMax
End Function
It looks as if the Windows Message pump is being blocked from clicks until all the mouse movments that been fofilled

Shell IE, Load Webpage && Log Whether Webpage Loads Or Not
Dear all,

How would I go about opening up Internet Explorer, loading a webpage ( and reporting back to VB whether the request was successful or not.

I'd like to perform this routine as a way of checking that my PC can connect to the internet... as if it can't, it would be a big indicator that our proxy server has gone down or needs restarting. (I'm writing a network monitoring program)

I'm getting as far as shelling IEXPLORE.exe... but I am then lost as to how to request a website and also a way of checking whether the website loads or not.. Could anyone please offer me some assistance?

Thanks in advance....

How To Get Msgbox's Static Handle? How To Kill Or Skip Msgbox?
i now know how to send WM_COMMAND into normal buttons.
but i cant send it to a popup msgbox's "OK" button.
the reason is because it's handle keeps on changes everytime it pops up.
so, is there anyway to skip the error msgbox?

MsgBox VbSystemModal - How To Show Icon In The Msgbox?
When showing a msgbox as vbsystemmodal, how can you show the apps icon in the msgbox like if a msgbox was shown normally?

Ok, I have a browser and when a user is at a page like yahoo and he pushes like search. I need that to trigger an event. Does anybody know how I would do that?


Best Way To Get Vb Onto A Webpage
I want to write a program that I want to be accessible via a web page. What's the best route to take for something like that?

I've looked into activex, but don't know too much about it. Is that the only option?

Gday all
Is someone able to tell me how to translate a simple VB program into VB Script for publication on a website?
Is someone able to tell me if this is possible?

VB In Webpage
Can someone tell me how i can make a registration form for a webpage in VB? I am talking about a form that people fill out information and click submit and it is sent in. I have no experience in web programming...I suspect that VB doesnt do any web apps. I hope I am wrong. Any help is appreciated.

VB And Webpage
Is it possible to build webpages with Visual Basic code? I'm a beginner and I'm looking to create a simple websites with all the normal VB objects like text boxes, drop menu's, and even databases. Is this possible? I think there's a option to choose a form called DHTML? Is this what I'd use? Or is the process of using VB to create webpages extremley difficult?

So to reiterate my question is how do you build webpages using VB, or which programs do you need to use??

Is There Any Way To Use VB On A Webpage...
Is there any way to use vb code on a web page or with html?

VB App From A Webpage
Is there any way to call a vb application from a web page?
for instance if I click a button on the page, I want an app to open where I can print a report.

Webpage With Asp
How do I fix so my home-built webserver supports asp?

AS/400 Webpage
I'm looking for a way to get a website up that will mainly display records from an AS/400. I've been trying to use a program called ProGen WebSmart, but it's being a pain. Is there a Visual Studio 6.0 Pro solution? I know I could do these tasks in VB6 but the goal is to have this done from a webpage.
Any ideas/thoughts would be greatly welcomed! Thanks

I wanna do this cheap.

I want to register and have it forward to my att site. Is there a way I could do it for FREE. So that no service was involved? And if not, give me a address of a good free service for having a domain name. TY.

Get URL's From Webpage
How can I get urls from a webpage that's open in a form? Like, for example, there's 10 links on a page and I want the last nine of them. How would I get the URL's of those links and put them into an array?

Is there a way to have a label open a webpage in a broswer?

Help! Is This Possible In A Webpage?
hey guyz,,, i want to know if it is possible to call a vb program from a webpage. and if so, how? can someone please tell me. thanks very much in advance!

.jpg On Webpage?HELP
what im tryin to do is there is a .jpg on a webpage and it says somethin what im tryin to do is extract whatever it says in the .jpg and insert it into a textbox or somesort? is this possible or anything easier?

VPN From A Webpage
I would like to be able to create a MS VPN connection for a client from a webpage. I am sure it should be rather easy to do, but I do not have the coding experience at this time. Any help would be great.

VPN From A Webpage
I would like to be able to create a MS VPN connection for a client from a webpage. I am sure it should be rather easy to do, but I do not have the coding experience at this time. Any help would be great.

Getting HTML From A Webpage
After running several searches, and coming up with nothing but vague hints at the answer I need I'm just going to ask.

How do I get the HTML code form a webpage? Do I use WinSock?

Webpage Extract
I would like to be able to connect to a webpage and extract certain info from that page {example} goto and retrieve the current radar image and place it on my form in a picture or image box. How would i go about this once ive connected to there server, or can i> Thanks upfront for any advice.

Winsock On A Webpage
I am curious if i can use a winsock control of a webpage or a form on a webpage to make the page connect to a server somewhere. So i can make a chat on a webpage. Any advice or code or anything would be great.

Open Webpage
i simply want to hit a command button and have it open my default browser to the website

Connecting To A Webpage
I need to connect to a webpage, like$VBVARIABLE

without using the webcontrol, i dont want to use the webcontrol page cause when you navigate to a page, the mouse cursor turns into the hour glass.

i cant seem to get it to connect with winsock control, unless im using wrong port 1080?

how can i connect to a webserver

Using VB Code On A Webpage

This is a question which has been irritating me for a long time...

I want to make an online VB project, one that has an HTML page and a .dll controller. How do you install it to webhosting? The package and deployment wizard does not seem to do it correctly and the dll does not function.

How can I get a VB app working on my site online using VB code??

Webpage Title
I am thinking of writing a program that will read a title of a (will run on remote machine) webpage and store the title in a file. My program will check the title every hour. The reason for this is, I have a PCanywhere on one machine (ISP using DHCP) so if I want to connect I need to know the public IP Address. If the last and current IP Addresses are differnet it will email me the new Public IP Address.

1. Is there a way to read the title of a webpage without bringing up the browser? If so what controls do I need to use?

2. Is there another way besides what I am thinking to receive the current Public IP Address


Webpage Grab
i was wondering if anyone can help me on getting a source to grab the source code of a webpage and be able to grab all words on the page between this <script>work here</script> thanks

Webpage To Vb Server
i was wondering if ther was anyway i can have a register webpage that can connect to a vb server so people can create an account on the net and it will save it to my vb server if so are there any tuts out there to do this? thanks...

USB Output To A Webpage
Hi all,

I would like to seek help/ideas on how to continue with my project.
At present, I have a VB source code that outputs data coming from my USB device (a weighing scale).
So this VB form continuously displays the weight coming from the scale. The scale also sends data to my program continuously (no need to press any key on the scale or VB program to capture the weight).
The output coming from the scale is in HEX format and my VB program just parses and interprets this data.

My next task is to integrate this output (weight coming from the scale) to a web page.
Example, there is a text field in a web page for Weight. So once I put the cursor on this field, the weight will be placed on this text field automatically.
Do you think this can be done?
If yes, how? Please share your ideas or suggestions on how to accomplish this.

Many thanks,

VB6 To Refresh A Webpage
Hi all.

Is there a way which i can use VB6 to refresh a website, for eg.

I need to do this because my program needs to download a file from a webpage continuously in which the file will be updated constantly. We notice that after the file is downloaded by my program, my program can only download the file again after we press "Refresh" in Internet Explorer on that website. If we don't "Refresh", the file won't be there.

Since in future, nobody will be around the system, we need to refresh the website automatically with my program.

Please help.



Opening A Webpage?
Okay ive made my program but now i what to make my webpage come up in there default browser when they close the program. I could do it with WebBrowser1 but they had close the program so that would be pointless. I could have done it in another form but its not there default browser and i want the whole program to execute. Please could you help me with my dilemma!

Download Webpage?
Greetz everybody!

I've been doing amateur programming in VB6 and managed to get some data from certain websites with the use the following coding:

Public Function DownloadFile(URL As String, LocalFilename As String) As Boolean
Dim lngRetVal As Long
lngRetVal = URLDownloadToFile(0, URL, LocalFilename, 0, 0)
If lngRetVal = 0 Then DownloadFile = True
End Function

Private Declare Function URLDownloadToFile Lib "urlmon" Alias "URLDownloadToFileA" _
(ByVal pCaller As Long, ByVal szURL As String, ByVal szFileName As String, _
ByVal dwReserved As Long, ByVal lpfnCB As Long) As Long
Now I have a question for you professionals :
At certain Http I only downloaded incomplete web page (say in the form of xyz.html), while the most important data were missing out. If I save the web page (say name it "ABC") using Internet Explorer 6 save function, I got ONE main ABC.html file + ABC_files folder. Inside ABC_files folder there are 3 more htm files and one of them (named as "profile_page_c.htm") carries the text data I want.

If xyz.html was read as a text file, I found this :
<SCRIPT language=Javascript src="profile_page_e_files/javascript.js"></SCRIPT>

How can I use VB6 to capture all data, including java script?
I searched forums but couldn't find any clue to solve this. Thank you for your time!

Load A Webpage

I want to load in visual basic a webpage. I don't want to do anything with it, only load it. The page i want load contains a script what will executed then.
Is it possible, when yes, how can I load this webpage?

edit: I am now thinking, it is also handy to know how to load the site into a variable, can someone also tell me how i can do that?


Webpage In Picturebox?
Heres a snippet of code I found at:

'Add a picturebox
'Add 1 command button
'Add the below code inside the command button.


Private Sub Command1_Click()
Set WinHttpReq = CreateObject("WinHttp.WinHttpRequest.5.1")

Dim d() As Byte
WinHttpReq.Open "GET", "", False ' Send the HTTP Request.
Debug.Print WinHttpReq.Status & " - " & WinHttpReq.StatusText '200 means success

Open "temp.gif" For Binary As #1
d() = WinHttpReq.ResponseBody
Put #1, 1, d()

Picture1.Picture = LoadPicture("temp.gif")
Set WinHttpReq = Nothing

End Sub

The site says this works in VB6. But don't you have to make a reference to this WinHttp.WinhttpRequest.5.1 in your project? Where can you get this reference. It's not in the default list of references as far as I can tell.
I'm trying to download a web page and put it into a picture box instead of the web browser control. Will this snippet of code do that? or is there another way? Thanks.

Log Into A Webpage With Excel
Hi all,
I need the vba code to enter the User ID and password to a website automatically in excel. I'd like to print or paste a password protected webpage inside excel.


Shell Webpage
How would I open a local webpage(saved on PC) using internet explorer? I'm pretty sure it would involve the shell comand (of which I have little, or no experience), but I don't know the specifics. Thanks.

Displaying A Webpage
Hey guys i want to get a FAQ webpage displayed when a user clicks on a menu. Just a simple htm file. How would i go about doing that? Are there any alternatives?

Thankz guys...

BTW also, i have a listbox that is used as a playlist, is there a way that i can save it and load it again?

Activex Ctl And Webpage

I have a small ActiveX control I built with VB6, within the control a string is built. How can I get the contents of the string displayed in a webpage?

I'm ok with the webpage (HTMl/ASP) but how do I code the control so that I can get the string contents out of the control?



Create WebPage 2 Exe
I want to secure my html pages by converting the whole website to an Exe file.
I tried using the RESOURCE in VB by inserting all the in custom RESOUCE and using the webbrowser res: protocol to show it in the exe, but this way is not secure, RESOURCE can be easily open in any program that can open .exe, .dll like PEExplorer.
Can this be done by URLMoniker or BHO?
Any help please.....

Treeview Webpage
can someone help point me in the right direction for using the treeview control in a webpage for links?

I have done some searching but i seem to come up short for using it with frontpage

Webpage Snapshot

Anyone know of a quick way of getting a snapshot (image) of a webpage? I am not (currently) using the webbrowser control as I pass my stuff from regular IE.

TIA, Gavin

Write WebPage IN IE
Is There A Way To Write Into A WebPage That Its Bean Navigated?

Like Zone Labs Do?

<!-- ZoneLabs Popup Blocking Insertion -->
<script language='javascript'>postamble();</script>

VB Program On My Webpage
Hi all

I have a standard.exe VB6 application that I wish to put on my webpage, with the minimum amount of re-coding or fuss. The idea is that visitors can use the program, which will access a data file from their own PC as an input file, but I definitely do not want them to be able to download the program or save it to their PC.

I am very confused by talk of active x controls, active x documents, .vbd files etc etc. I have tried the migration wizard, but perhaps someone could walk me through exactly what to do, in nice easy steps.

Or perhaps Java would have been a better idea

Thanks very much in advance


Export To Webpage
Hi, all.

I cannot figure out how to export rtf to html. Does any know how to do it or can you direct me to where i need to go?

Running A .exe From A Webpage
well thats one thing i want to do

but basicaly i have ftp access to a webserver
really top quality one too

but i was wondering since this is a good quality server, if i could use it as a permanent server for a chat program i were to make

basically what i'm saying is
can i:

a. use php/asp/cgi/html/ java/vbscript
to run my server .exe

Copyright 2005-08, All rights reserved