Click to See Complete Forum and Search --> : Close Window Loop or Delay...
Morrow
October 7th, 2005, 05:34 PM
Hello World! :)
Hopefully someone can help me out here. I have the following code:
dim sh
set sh = createobject("wscript.shell")
if sh.appactivate("Microsoft Windows Messenger ") then
wscript.sleep 250
sh.sendkeys "%{f4}"
end if
set sh = nothing
That works just fine, but what I need to happen is for the window to close when/if it ever actually pops up. Can someone help me out here?
Thanks a bunch!!!!
PeejAvery
October 7th, 2005, 07:16 PM
If you don't want Windows Messenger to run then just uninstall it.
You could easily program this is Visual Basic. Why exactly are you using script for this?
Morrow
October 7th, 2005, 08:04 PM
Peej,
1. Replace Windows Messenger with any window name. Whatever the window might be, I would like a script to be able to do what my initial post indicates.
2. Although you're probably 100% right, I don't know the first thing about VB.
Thanks
PeejAvery
October 7th, 2005, 08:18 PM
The reason I mention it is because in order to detect windows as such I believe you need API. In Visual Basic it is extremely simple to use window functions. I am not sure that you can do the same in scripting.
Morrow
October 7th, 2005, 10:55 PM
I posted working code in my original post. Yes, it's a little sloppy, but it can be done. I just need a wrapper around it.
PeejAvery
October 7th, 2005, 11:15 PM
I posted working code in my original post. Yes, it's a little sloppy, but it can be done. I just need a wrapper around it.
Sorry, I didn't make myself clear. I mean pulling the windows HWND handle and closing it before it opens.
Morrow
October 10th, 2005, 08:59 AM
Peejavery,
What tools would I need to create this in VB? I would assume I can create it in textpad, but then it most likely needs to be compiled, right?
Thanks
PeejAvery
October 10th, 2005, 02:44 PM
Well, do you own Visual Basic? If so, the coding is extremely simple and I can even write most if not all for you in my free time.
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.