AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Macro works in Windows XP but not in Windows 7

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
dezrat1242



Joined: 09 Jun 2005
Posts: 3

PostPosted: Mon Nov 23, 2009 1:42 am    Post subject: Macro works in Windows XP but not in Windows 7 Reply with quote

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
Back to top
View user's profile Send private message
entropic



Joined: 21 Dec 2008
Posts: 161

PostPosted: Mon Nov 23, 2009 1:49 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
Leef_me



Joined: 08 Apr 2009
Posts: 1159
Location: San Diego, California

PostPosted: Mon Nov 23, 2009 6:52 am    Post subject: Reply with quote

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?
Back to top
View user's profile Send private message
dezrat1242



Joined: 09 Jun 2005
Posts: 3

PostPosted: Tue Nov 24, 2009 1:28 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
Guest






PostPosted: Tue Nov 24, 2009 1:30 am    Post subject: Reply with quote

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
Back to top
TLM



Joined: 21 Aug 2006
Posts: 767
Location: The Shell

PostPosted: Tue Nov 24, 2009 1:56 am    Post subject: Reply with quote

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..
_________________

Off diving into dll functions..
Back to top
View user's profile Send private message
dezrat1242



Joined: 09 Jun 2005
Posts: 3

PostPosted: Wed Nov 25, 2009 3:05 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group