 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
Lexikos
Joined: 17 Oct 2006 Posts: 4473 Location: Qld, Australia
|
Posted: Sun Nov 08, 2009 5:45 am Post subject: |
|
|
OK, I've confirmed the problem is to do with DPI Virtualisation, which requires Aero (also known as the DWM=Desktop Window Manager).
| Quote: | Windows Vista introduces a feature called DPI virtualization which provides some level of automatic scaling support to applications which are not DPI aware. Without this feature, the size of the text and UI elements of DPI unaware applications would typically be smaller on high DPI settings compared to rest of the system, potentially causing usability and readability problems.
This feature works by providing “virtualized” system metrics and UI elements to the application, as if it were running at 96 DPI. The application then renders to a 96-DPI off-screen surface and the Desktop Windows Manager then scales the resulting application window to match the DPI setting. For example, if the DPI display setting is 144, DWM scales the application’s window by 150%, or 144/96. The type of scaling that DPI virtualization uses is based on pixel stretching. As a result, blurring occurs due to the stretched pixels. The following screenshot shows the type of visual artifact caused by stretched pixels due to DPI virtualization.
Source: http://go.microsoft.com/fwlink/?LinkID=129586 |
On Windows 7 64-bit with DWM and 150% DPI, I see an interesting problem: some applications work correctly with WindowPad, and some do not.
For instance, Explorer and Calc, which appear to be DPI-aware, end up squashed into a scaled down portion of the screen, whereas Foxit Reader, SpeedCrunch and Reshacker, which do not appear to be DPI-aware, work correctly. This makes sense: AutoHotkey gets the virtualised system metrics (monitor co-ords), then applies them to other applications where they are correct only if the application is not DPI-aware.
However, when I tested with 200%, some applications (including SpeedCrunch) were positioned off-screen and in inconsistent sizes/positions. I couldn't figure it out; maybe Windows got confused and needed a reboot (though I still haven't rebooted).
The solution might be to scale by the DPI setting for applications which are DPI-aware, but I need to know how to determine DPI-awareness.
Btw, VirtualBox does not look nice at 150% DPI... (it has rendering issues within its UI, and also scales the VM).
Edit: I've been getting very inconsistent results while testing.
For instance,
- Though not ideal, I expect DPI-unaware applications to be positioned according to a rectangle like {0,0,A_ScreenWidth*dpi/96,A_ScreenHeight*dpi/96}; in other words, from the top-left of the screen to the bottom-right according to the "effective resolution" (which is lower with higher DPI settings). Sometimes it works this way, and sometimes they are instead positioned according to something more like {200,200,A_ScreenWidth,A_ScreenHeight}, which makes absolutely no sense.
- MouseGetPos will inconsistently fail to detect the appropriate window (for the OutputVarWin arg).
- My Mouse Gestures script was intermittently (i.e. at very close intervals) retrieving mouse co-ords in either DPI-scaled or DPI-unscaled co-ords (or perhaps scaled**2 vs scaled).
- Worst of all, I can change DPI settings to and fro, and any of the above behaviour (with the same DPI settings) will change.
In Windows 7, if you choose "Set custom text size (DPI)", there is an option for "Use Windows XP style DPI scaling". I believe enabling this option disables DPI Virtualisation. I suggest you try this, and see how it affects the script and your applications. On my system it seems to fix the script and typically improve rendering in in various applications. |
|
| Back to top |
|
 |
Guest
|
Posted: Mon Nov 09, 2009 6:16 am Post subject: |
|
|
thanks.
I set the xp flag and this resolved the windowpad problem! thanks! |
|
| Back to top |
|
 |
Guest
|
Posted: Tue Nov 10, 2009 12:12 am Post subject: |
|
|
| Hi again, Even though the XP flag solved the problem, I noticed the XP DPI mode doesn't really work that nice. I prefer the "new" DPI setting. However I understand that it seems to be to difficult to fix at the moment. |
|
| Back to top |
|
 |
homemadev Guest
|
Posted: Mon Nov 16, 2009 4:58 am Post subject: semicolon mapping in windowpad |
|
|
how can i set one of the keys to ; (semicolon) in the WindowPad.ini file?
I want to use this key because it's real close to capslock in the Dvorak keyset.. luckily all of ',.aoe;qj work, except for semicolon.
for use in autohotkey w/o windowpad, see http://www.autohotkey.com/forum/topic6248.html |
|
| Back to top |
|
 |
Lexikos
Joined: 17 Oct 2006 Posts: 4473 Location: Qld, Australia
|
Posted: Mon Nov 16, 2009 9:12 am Post subject: |
|
|
| WindowPad uses the GetPrivateProfileSection function to read the hotkey sections from the INI file. This strips out lines which begin with ;. You can get around it by prepending a modifier to the hotkey, or using the virtual keycode (vk) or scan code (sc). I would suggest either the *wildcard or $usehook hotkey modifier. If you're using Capslock as a modifier key, the keyboard hook is probably already in use and there shouldn't be any downside of using $. |
|
| Back to top |
|
 |
homemadev Guest
|
Posted: Mon Nov 16, 2009 2:32 pm Post subject: |
|
|
| thanks, that works on my winxp |
|
| Back to top |
|
 |
alexisfch
Joined: 09 Nov 2009 Posts: 64
|
Posted: Wed Nov 18, 2009 7:28 am Post subject: problems when i call the function |
|
|
Im tried to move my demul window (dreamcast emulator)
and I made aan script with this code:
| Code: | Run, C:\demul.exe
WindowPad.exe GatherWindows,1 "WindowPadMove, X, Y [, -5, +5, DEMUL ]" |
but it doesn't work, where is the problem, im doint this as the configuration say.
Thanks |
|
| Back to top |
|
 |
Lexikos
Joined: 17 Oct 2006 Posts: 4473 Location: Qld, Australia
|
Posted: Wed Nov 18, 2009 10:37 am Post subject: |
|
|
Please read the "WindowPadMove" section of WindowPad.html, and note the following:
- As in the AutoHotkey help file, [ brackets ] are used to denote optional parameters; i.e. parameters between [ and ] may be omitted, and the brackets themselves should not be used.
- X and Y must be replaced with the appropriate value: -1, 0 or +1.
- WidthFactor and HeightFactor, if specified, must be between 0.0 and 1.0.
- WindowPad.exe is not a command. Use Run WindowPad.exe.
|
|
| Back to top |
|
 |
alexisfch
Joined: 09 Nov 2009 Posts: 64
|
Posted: Wed Nov 18, 2009 3:13 pm Post subject: |
|
|
Many thanks Lexikos, I modified my .ahk to this:
| Code: | Run, C:\demul.exe
Run C:\WindowPad.exe GatherWindows,1 WindowPadMove, -1, -1, 0.5, 0.5, DEMUL |
But it doesn't work,  |
|
| Back to top |
|
 |
Lexikos
Joined: 17 Oct 2006 Posts: 4473 Location: Qld, Australia
|
Posted: Thu Nov 19, 2009 9:53 am Post subject: |
|
|
Why did you remove the quotation marks???
| WindowPad.html wrote: | | If a command's parameters contain spaces, the command and its arguments must be enclosed in quotation marks. |
|
|
| Back to top |
|
 |
edbert
Joined: 22 Nov 2009 Posts: 2
|
Posted: Sun Nov 22, 2009 11:37 pm Post subject: |
|
|
Lexikos, I've been noticing some weird stuff when I try to minimize MediaMonkey in my scripts. Basically it does not minimize correctly for me when I used WinMinimize, but with WindowPad, it works perfectly.
I noticed that in your windowpad code, you minimize a window using this command:
| Code: | | PostMessage, 0x112, 0xF020 ; WM_SYSCOMMAND, SC_MINIMIZE |
When I changed that to WinMinimize, the same problem occurred using WindowPad to minimize the window. So something about your PostMessage is special. Obviously it works the best. Can you comment on why it's so good?
Thanks!
Note: Apparently one can't just replace WinMinimize with PostMessage...you need to get the window first... |
|
| Back to top |
|
 |
Lexikos
Joined: 17 Oct 2006 Posts: 4473 Location: Qld, Australia
|
Posted: Mon Nov 23, 2009 8:59 am Post subject: |
|
|
"PostMessage, WM_SYSCOMMAND, SC_MINIMIZE" replicates what happens when you click the minimize button on the window or select Minimize from the window's system menu. The default handling of the message causes the window to be minimized (and also plays the system "minimize" sound), but each window may add its own handling for custom behaviour.
On the other hand, WinMinimize uses the Win32 API to directly minimize the window; it does something equivalent to this:
| Code: | | DllCall("ShowWindow", "uint", target_window_id, "int", SW_MINIMIZE:=0x6) |
It is possible that MediaMonkey doesn't actually minimize when you click minimize; for instance, it could hide the window and create a tray icon. In that case, WinMinimize will bypass the custom behaviour and therefore won't be consistent with the PostMessage method.
| Quote: | | Apparently one can't just replace WinMinimize with PostMessage...you need to get the window first... | Actually, it is equally valid to omit the window title for WinMinimize in the same context; it will use the Last Found Window. Conversely, you can specify a window title with PostMessage, but you need a comma for each omitted parameter preceding it:
| Code: | | PostMessage, 0x112, 0xF020,,, WinTitle |
|
|
| Back to top |
|
 |
edbert
Joined: 22 Nov 2009 Posts: 2
|
Posted: Mon Nov 23, 2009 4:43 pm Post subject: |
|
|
Ah, right on, these music player apps seem to have an ability to minimize to a compact view. I had similar issue with iTunes.
So this would be the direct replacement for WinMimize,A
| Code: | | PostMessage, 0x112, 0xF020,,,A |
Thanks so much for your help. I've been using Autohotkey & WindowPad for over a year, never fails. And each time I play with it, it just gets better.  |
|
| Back to top |
|
 |
TP Guest
|
Posted: Tue Dec 01, 2009 8:20 am Post subject: Thank you! |
|
|
Thank you guys, this is just what I need!  |
|
| Back to top |
|
 |
ossandcad
Joined: 18 Feb 2010 Posts: 5
|
Posted: Thu Feb 18, 2010 5:32 pm Post subject: Unable to get WindowPad to work with ONE specific Window |
|
|
Thanks for this great script. Makes working with multiple windows on "older" PC (i.e. Vista) enjoyable.
But I found that WindowPad doesn't work for ONE specific Application Window. I am trying to figure out why. Any suggestions you have to help me debug this behavior would be most helpful.
If it helps then the Application Window is ScottradeElite (from www.scottrade.com). |
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|