AutoHotkey Community

It is currently May 27th, 2012, 2:41 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 7 posts ] 
Author Message
PostPosted: November 23rd, 2009, 2:42 am 
Offline

Joined: June 9th, 2005, 5:00 pm
Posts: 3
For years I have used this macro in Windows XP to close a window:
`::send, !{F4}
The ` is the key just left of the number 1.
It has always worked fine in XP but in Windows 7 it only works on some windows and some programs, but not on others. Strangely, using the regular keyboard Alt-F4 always works. I am puzzled. I would think they would be equivalent but apparently they are not.

Any suggestions? All help appreciated.

dezrat1242


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 23rd, 2009, 2:49 am 
Offline

Joined: December 21st, 2008, 7:29 pm
Posts: 181
Hmm, I'm not sure why that is but hopefully someone can explain it. In the meantime you can try

Code:
`::WinClose, A


or SendInput might work.
Code:
`::SendInput, !{F4}


if neither of those work WinKill may.
Code:
`::WinKill, A


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 23rd, 2009, 7:52 am 
Offline

Joined: April 8th, 2009, 7:49 pm
Posts: 6071
Location: San Diego, California
Quote:
it only works on some windows and some programs, but not on others.
I have Win Vista-32
Can you give specific examples about the programs that will & won't close?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 24th, 2009, 2:28 am 
Offline

Joined: June 9th, 2005, 5:00 pm
Posts: 3
entropic wrote:
Hmm, I'm not sure why that is but hopefully someone can explain it. In the meantime you can try

Code:
`::WinClose, A


or SendInput might work.
Code:
`::SendInput, !{F4}


if neither of those work WinKill may.
Code:
`::WinKill, A




I tried those, one at a time of course, but no help. they worked just like my original macro.

dezrat1242


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 24th, 2009, 2:30 am 
Leef_me wrote:
Quote:
it only works on some windows and some programs, but not on others.
I have Win Vista-32
Can you give specific examples about the programs that will & won't close?


I am running Windows 7, not Vista, but the same problem may exist there.

Try this: Open Control Panel, click System and Security, then under the System paragraph, click Device Manager. When Device Manager opens try closing it wilt the `::send, !{F4} macro. It won't close, yet you CAN close it with the regular keyboard Alt-F4 command.

After you manually close Device Manager, the macro WILL close the remaining active window.

dezrat1242


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: November 24th, 2009, 2:56 am 
Offline

Joined: August 21st, 2006, 7:07 pm
Posts: 2925
Location: The Shell
This is a shot in the dark but can you try puting a SetKeyDelay in front of it?

Also consider using the extended format
Code:
`::SendInput, {ALTDOWN}{F4}{ALTUP}


Just some thoughts..

_________________
Imageparadigm.shift:=(•_•)┌П┐RTFM||^.*∞


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 25th, 2009, 4:05 am 
Offline

Joined: June 9th, 2005, 5:00 pm
Posts: 3
TLM wrote:
This is a shot in the dark but can you try puting a SetKeyDelay in front of it?

Also consider using the extended format
Code:
`::SendInput, {ALTDOWN}{F4}{ALTUP}


Just some thoughts..


I tried this with no luck: `::SendInput, {ALTDOWN}{F4}{ALTUP}
It works the same as my regular macro.
I could not get the SetKeyDelay to work, probably a syntax problem. Can you give me an example of how to use it?

Thanks,

dezrat1242


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Alpha Bravo, Bing [Bot], Google [Bot], rbrtryn and 19 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group