|
-
Dec 20th, 2014, 07:10 PM
#1
[RESOLVED] Per-Monitor DPI Awareness & VB
I don't have Win8.1 to try it else I would & post the results to this forum.
Background: Per-Monitor DPI Awareness (PMDA) is new with Win8.1. It kinda works this way: User moves your app from say a 96 DPI monitor to a 144 DPI monitor. Without declaring PMDA, Windows will scale your app as needed for the new DPI. However, if you did declare your app as PMDA with a manifest, then no DPI virtualization occurs, but you are responsible for scaling your project to the new DPI. You'll know when a different DPI applies by subclassing a main-level window & looking for a WM_DPIChanged message.
Now. I doubt many have played with this new option. It does require a lot of work, manual scaling, multiple monitors, and Win8.1 to play with. Probably too much to hope for, this early in Win8.1's lifetime.
If, however, you have, here's what I'm curious about...
1) Internally, how does VB receive mouse X,Y coordinates thru its events? Does VB scale them, not knowing it is in a different DPI environment? May depend on the object's ScaleMode property? In other words, using a picbox, and if the cursor was on the right edge of the picbox, would the X,Y coordinates received in a MouseMove event, be equal the physical right edge of the picbox or scaled somehow, giving 'false' values?
2) Are VB-related measurements hosed, can they be trusted? For example, I'd think Screen.Width/Height would be broken. Maybe picBox.ScaleWidth would return good values for anything other than a Twips scalemode?
3) Externally, do coordinate-related APIs work. Example: using picbox again with mouse over right or left edges, would WindowFromPoint API return the picbox.hWnd in both cases? Would the reverse work, i.e.,
WindowFromPoint ScaleX(picBox.Left+1,Me.ScaleMode,vbPixels), ScaleY(picBox.Top+1,Me.ScaleMode,vbPixels)?
4) From what I've read, in multi-monitor environments,the X,Y coordinates can be negative. This isn't Win8.1 restricted. Wonder how that effects VB, internally/externally?
Again, just curious.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|