| View previous topic :: View next topic |
| Author |
Message |
dezrat1242
Joined: 09 Jun 2005 Posts: 3
|
Posted: Mon Nov 23, 2009 1:42 am Post subject: Macro works in Windows XP but not in Windows 7 |
|
|
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 |
|
 |
entropic
Joined: 21 Dec 2008 Posts: 161
|
Posted: Mon Nov 23, 2009 1:49 am Post subject: |
|
|
Hmm, I'm not sure why that is but hopefully someone can explain it. In the meantime you can try
or SendInput might work.
| Code: |
`::SendInput, !{F4}
|
if neither of those work WinKill may.
|
|
| Back to top |
|
 |
Leef_me
Joined: 08 Apr 2009 Posts: 1159 Location: San Diego, California
|
Posted: Mon Nov 23, 2009 6:52 am Post subject: |
|
|
| 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 |
|
 |
dezrat1242
Joined: 09 Jun 2005 Posts: 3
|
Posted: Tue Nov 24, 2009 1:28 am Post subject: |
|
|
| entropic wrote: | Hmm, I'm not sure why that is but hopefully someone can explain it. In the meantime you can try
or SendInput might work.
| Code: |
`::SendInput, !{F4}
|
if neither of those work WinKill may.
|
I tried those, one at a time of course, but no help. they worked just like my original macro.
dezrat1242 |
|
| Back to top |
|
 |
Guest
|
Posted: Tue Nov 24, 2009 1:30 am Post subject: |
|
|
| 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
|
Posted: Tue Nov 24, 2009 1:56 am Post subject: |
|
|
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 |
|
 |
dezrat1242
Joined: 09 Jun 2005 Posts: 3
|
Posted: Wed Nov 25, 2009 3:05 am Post subject: |
|
|
| 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 |
|
 |
|