Jump to content

HELP: Program to close active window


Guest kewlsunman
 Share

Recommended Posts

Guest kewlsunman

Hi all, I'd like to see an example of a script that could perform an "Alt+F4" on the active window. Basically, all I want is something I can run, it will find the previous active window, and close it. For instance, I hotkey this program to my keyboard. While I'm surfing the net, I press the hotkey and Internet Explorer closes. Or I'm typing on AIM, I press the hotkey and AIM closes. And then, this script will exit out of itself.

Any and all help appreciated =)

-ksm

Edited by kewlsunman
Link to comment
Share on other sites

Guest kewlsunman

Wow, that was quick, I appreciate it =)

However... I guess that wasn't what I was looking for.... Let me explain further, I have a Multimedia Keyboard and I want one of those buttons to be able to perform a "Close Active Program" action. The buttons can only be programmed to either access a webpage or access an .exe. Thus, the only thing I can think of is to write a program that somehow determines what the active window at that moment is (not including itself) and closes it.

I went and wrote a program like this in VB and everything seemed great, until I actually linked the special button to the program. Then I realized that the program was actually closing the keyboard software that was linking the program to the keys.

What I'm thinking is just a quick program that can send keystrokes: specifically ALT+F4, and then it will immediately close itself.

Thanks again!

-ksm

Edited by kewlsunman
Link to comment
Share on other sites

However... I guess that wasn't what I was looking for....  Let me explain further, I have a Multimedia Keyboard and I want one of those buttons to be able to perform a "Close Active Program" action.  The buttons can only be programmed to either access a webpage or access an .exe.  Thus, the only thing I can think of is to write a program that somehow determines what the active window at that moment is (not including itself) and closes it.

<{POST_SNAPBACK}>

And the Larry program do not works? It is strange.

Make a program like

msgbox(0,'TEST',WinGetTitle("") )

compile it and test it with you keyboard.

So you'll know that is the active window when you press the button.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...