| View previous topic :: View next topic |
| Author |
Message |
599033 Master Cheater
Reputation: 0
Joined: 07 Jun 2007 Posts: 303 Location: West Midlands, England
|
Posted: Tue May 27, 2008 4:58 pm Post subject: Need some help in VB6 |
|
|
Im using VB 6, and want to automatically refresh IE for every 5 seconds.
How would I do this?
I know a timer is needed though.
Could someone tell me how i would do this, And what the code is
Also - Would it be possible to do this without it controling my mouse, I want the webpage actually in the .Exe, So i wouldnt have to open a Browser, the webpage would already in the file.
So i load the file up, the webpage is in there loading, I log into the website, and i click a button and it refreshes the webpage whilst i do somthing else on the computer.
I want
Thankyou.
Jack
|
|
| Back to top |
|
 |
atom0s Moderator
Reputation: 205
Joined: 25 Jan 2006 Posts: 8588 Location: 127.0.0.1
|
Posted: Tue May 27, 2008 10:29 pm Post subject: |
|
|
Use the web browser control and make your own little mini-web browser. You'd have full control over it and could do what ever you want with it then.
_________________
- Retired. |
|
| Back to top |
|
 |
sumnewdude Expert Cheater
Reputation: 0
Joined: 23 May 2007 Posts: 181 Location: Where you least expect me.
|
Posted: Wed May 28, 2008 12:52 pm Post subject: |
|
|
| Wiccaan wrote: | | Use the web browser control and make your own little mini-web browser. You'd have full control over it and could do what ever you want with it then. |
Or if you don't want to make your own you could use somthing like in a timer. F5 refreshes IE.[/b]
_________________
.erutangis ruoy ni siht esu neht ,sdrawkcab siht daer ot hguone trams erew uoy fI |
|
| Back to top |
|
 |
atom0s Moderator
Reputation: 205
Joined: 25 Jan 2006 Posts: 8588 Location: 127.0.0.1
|
Posted: Wed May 28, 2008 12:54 pm Post subject: |
|
|
SendKeys sends the key to the active window on the system, which in your case in a timer would be flawed if the user attempted to switch to a different window.
_________________
- Retired. |
|
| Back to top |
|
 |
Typhoon808 Expert Cheater
Reputation: 0
Joined: 27 Mar 2008 Posts: 175 Location: Wales
|
Posted: Wed May 28, 2008 1:03 pm Post subject: |
|
|
| Yeah, if you're going to use SendKeys, I would recommend using hotkeys to start and stop the timer so it doesn't interfere with other applications.
|
|
| Back to top |
|
 |
Trow Grandmaster Cheater
Reputation: 2
Joined: 17 Aug 2006 Posts: 957
|
Posted: Wed May 28, 2008 8:24 pm Post subject: |
|
|
If you're having your own IE control in your app, use
"WebBrowser1.refresh" in a timer
Otherwise you'll need to dig into EnumWindows or FindWindow/Ex APIs along with SendMessage/PostMessage/SendInput for your ways to send an F5 signal (and sorry, no code for you)
_________________
Get kidnapped often. |
|
| Back to top |
|
 |
minium haxor Advanced Cheater
Reputation: 0
Joined: 03 Dec 2007 Posts: 82 Location: Faroe islands
|
Posted: Mon Jun 02, 2008 2:54 pm Post subject: |
|
|
1 command button
2 timers
code:
Private Sub Command1_Click()
Timer2.Enabled = True
End Sub
Private Sub Timer1_Timer()
SendKeys (vbKeyF5)
End Sub
Private Sub Timer2_Timer()
Timer1.Enabled = True
End Sub
_________________
|
|
| Back to top |
|
 |
atom0s Moderator
Reputation: 205
Joined: 25 Jan 2006 Posts: 8588 Location: 127.0.0.1
|
Posted: Mon Jun 02, 2008 2:57 pm Post subject: |
|
|
| minium haxor wrote: | 1 command button
2 timers
code:
Private Sub Command1_Click()
Timer2.Enabled = True
End Sub
Private Sub Timer1_Timer()
SendKeys (vbKeyF5)
End Sub
Private Sub Timer2_Timer()
Timer1.Enabled = True
End Sub |
Firstly, this will cause issues with other programs and force you to keep the browser window infront at all times. SendKeys will only send the given keystrokes to the currently active window.
Second, why on earth would you use a timer to make another active..?
| Code: | Private Sub Command1_Click()
Timer1.Enabled = True
End Sub
Private Sub Timer1_Timer()
SendKeys "{F5}" ' // Not sure if thats the key, I dont use this function at all.
End Sub |
That would be all you need. Let alone with that, I would suggest using hotkeys instead then so you can toggle it on and off. But, either way I suggest not using SendKeys at all. Use other API that can achieve the same result, such as 'SendInput', 'PostMessage', etc.
_________________
- Retired. |
|
| Back to top |
|
 |
|