-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
With desktop scaling enabled, icon is incorrectly placed #52
Comments
I've been working on this, so I figured I'd post an update. First stumbling block: A method that gives me a usable scale or DPI for a command line program. I tried many possibilities, but I finally found one that worked for me: GetDpiForWindow() in user32.dll. Divide by 96, and you get the scaling percentage; though note this requires Windows 10 1607. The manifest need not be adjusted to change DPI_AWARENESS. Now it's on to the second stumbling block: It seems the GDI surface needs to be resized as well somehow. Multiplying x, y, w, and h by the scaling factor moves the image out of the visible area. By multiplying just w and h, the problem becomes clear: EDIT: EDIT 2: However, I'm having difficulty so far reproducing the equivalent behavior by changing the app.manifest, App.config, or programatically. I could force the compatibility registry setting, but I'd rather not resort to that except as a last resort. |
This did the trick: EDIT: Fixed in PR #54 |
The text was updated successfully, but these errors were encountered: