Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

checking 2 c if another ie window is open

Status
Not open for further replies.

bobo12

Programmer
Dec 26, 2004
74
US
hi,
how can i check 2 c if a ie window is open in vb? iow, suppose i want to know if a user is browsing using ie?

also,suppose i want to execute a certain action every 3 to 4 hours, how can i do this? i don't even know what to google for and this is why i ask it here.

 
First Part, Search this forum for "FindWindow API"

Second Part, Look into the VB Help Files for using the Timer Control.

Set the Timer Code to check how long has passed since the last execution of the timer, if 4 hours, execute your code, if not, do nothing.

A simplistic version of this would be below.

Insert a new Timer Control onto your form and set its
INTERVAL property to 31000 (31 Seconds) to ensure that it doesn't fire twice in one minute.

Code:
Private Sub Timer1_Timer()
    'Grab the 5 Leftmost Characters of the current time
    Select Case Left(Time, 5) 
        'Insert the times you want to check
        Case "00:00", "04:00", "08:00", "12:00", _
        "16:00", "20:00"
            'Execute Code
            MsgBox "Boo!! it's " & Left(Time, 5)
        Case Else
            'Do Nothing (or something, it's up to you)
            Debug.Print "31 seconds and I'm doing nothing"
    End Select
End Sub

Hope this helps.

P.S. To the techy ones, I know there are FAR more elegant ways of doing this, but this is an example for a newbie....




jgjge3.gif
[tt]'Very funny, Scotty... Now Beam down my clothes.'[/tt]
 
I don't understand the question. Is 2c some sort of program? I looked up iow in the dictionary and couldn't find it either.

If this is a foreign language please translate into English (that's the one with capital letters occasionally)

________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first

For tsunami relief donations

'If we're supposed to work in Hex, why have we only got A fingers?'

for steam enthusiasts
 
Thanks Hypetia - I must have slipped into Grumpy Old Man mode accidentally! I find it frustrating and time wasting to translate from L33TSP34k into English to answer a question [smile]

________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first

For tsunami relief donations

'If we're supposed to work in Hex, why have we only got A fingers?'

for steam enthusiasts
 
iow: In Other Words

Just a guess from context and initial letters - I don't speak the language myself.

Tracy Dryden

Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard. [dragon]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top