News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

Use Caps Lock to perform Alt Tab switching

Started by jj2007, November 21, 2014, 02:08:21 AM

Previous topic - Next topic

jj2007

The Caps Lock key is a real nuisance. So is the fact that you have to do finger acrobatics to switch quickly between windows.
Thorough googling reveals that this is a tricky problem, and that installing gigabytes of AutoWhateverKey won't help, either.

So I wrote a little app that does the job. Usage is relatively simple:
- launch AltTabWithCapsLock.exe 8)
- activate some other window
- get used to switch between windows when pressing CapsLock
- and do all that at your own risk - this is dangerous assembler code! You have been warned!!

Give me feedback if it works on all Windows versions. Press right Ctrl CapsLock to exit the proggie.

Archive contains source (in *.asc format, usable only with a well-known idiosyncratic editor) and exe (2048 bytes - plain Masm32, no MasmBasic required). The exe will disappear in a few days, to limit the accessibility of this dangerous application to Masm32 members ;-)

anta40

Hi jj,

Pressing caps lock will make you switch between 2 windows only.
If that's what intended than I guess it works fine on my 32-bit Win 7 Pro.

jj2007

Yes, that's the intended use. And of course, it won't produce UPPERCASE letters any more.
Note if it does apparently nothing, then either you haven't yet activated any other window, or the last "other" window does no longer exist.

Gunther

Jochen,

works fine under Windows 7-64. I'll try it next weekend with Windows 8.1-64.

Gunther
You have to know the facts before you can distort them.

jj2007

New version attached on top of thread. Now it works also if the "other" window was closed. I stumbled over something really strange, though: My file manager, FreeCommander (generally a good proggie) gets two entries in the EnumWindows callback. They are both top level windows and bear the same caption, only the classname is different. According to Dennis Babkin's WinID, one of these two is a child of the other: The caption is class TfcForm with parent TApplication. It's weird because

a) EnumWindows is not supposed to list kids
b) only one FreeCommander window is in the task list.

I had to hardcode a workaround, see Mirror$("TApp") in the enw proc. Any ideas why there can be a non-hidden child window in the tasklist that reports zero when asked for GetParent? ::)