I know nothing about windows scripting, but hopefully someone can point me in the right direction. I need to open a browser on a keypress, and then close the browser after the keyboard/mouse have been inactive for 1 minute or so. After the browser closes, I need to switch back to the application that was minimized when the browser was opened. The broswer will be google chrome if that makes a difference.

Is this feasible to do? Any tips on where to startRunning windows 7.

Thanks.

Recommended Answers

All 2 Replies

Not a simple situation. You need to write a program (in C, C#, or C++) to monitor all system keyboard activity for all windows (passing valid input events through to the proper window), and only send a shutdown event to the revelant window when the specified time expires. Not a good idea in any case, in my opinion. So, just exactly WHY do you want to do this?

This vbs will check if Ie is working or not, and will show a message box with the results.

sName = "iexplore"
iDelay = 10000
Set oWMIService = GetObject("winmgmts:\\.\root\CIMV2") 
K = GetKernel
WScript.sleep(iDelay)
If GetKernel = K _
Then MsgBox sName & " appears to be idle" _
Else MsgBox sName & " is busy"

Function GetKernel
   Set cItems = oWMIService.ExecQuery("SELECT * FROM Win32_Process", , 48)
   For Each oItem In cItems 
      if instr(1, oItem.Name, sName, 1) = 1 then _
      GetKernel = oItem.KernelModeTime
   Next
End Function
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.