I apologize if this is a very basic question, but I'm just starting to learn about pixels, resolution, DPI-awareness, etc.
I'm creating a File Explorer extension that positions windows and text over specific Explorer UI elements. It's implemented as a browser helper object, so my code is called from within Explorer's process space.
In order to position windows and elements for my extension, I'll typically get a bounding RECT
from a specific IUIAutomationElement
within Explorer's UI, then perhaps move or deflate that RECT
slightly, and then use the RECT
to position a text control over Explorer. I haven't been able to find any system metrics that correspond to the correct positions for my elements, so I determine the correct placement after trial and error with specific numeric values, like 1, 2, or 5, etc.
Here's my question: Let's say I find the correct position values on my computer. What I'm unclear on is whether those values will be correct on other machines (and other versions of Windows). I don't quite understand if the coordinates or pixels may be off depending on other users' resolution. Is it relevant that my code is being called by Explorer?
So for example, let's say the appropriate placement for an element (on my machine) is the vertical scrollbar's bounding rectangle, but deflated by 2. Will that translate appropriately to others' machines?
Thank you very much for any guidance.