ExtremeGrief Posted March 12, 2022 Share Posted March 12, 2022 Hello, does anyone know how to port GetDpiForMonitor to Windows 7? It's included in api-ms-win-shcore-scaling-l1-1-1.dll starting from WinBlue Windows 8.1 NT 6.3.9600. I need this DLL to run an app on Windows 7. It needed 2 functions, SetProcessDpiAwareness and GetDpiForMonitor. I already managed to port SetProcessDpiAwareness successfully but I'm stuck on GetDpiForMonitor... If some experienced user can help me I would be really thankful. Thanks! Link to comment Share on other sites More sharing options...
MikeyV Posted March 16, 2022 Share Posted March 16, 2022 Sorry I cant help you but i would greatly appreciate if you would pm me how to accomplish what you have already done. Thanks Link to comment Share on other sites More sharing options...
vxiiduu Posted March 18, 2022 Share Posted March 18, 2022 On 3/13/2022 at 1:24 AM, ExtremeGrief said: Hello, does anyone know how to port GetDpiForMonitor to Windows 7? It's included in api-ms-win-shcore-scaling-l1-1-1.dll starting from WinBlue Windows 8.1 NT 6.3.9600. I need this DLL to run an app on Windows 7. It needed 2 functions, SetProcessDpiAwareness and GetDpiForMonitor. I already managed to port SetProcessDpiAwareness successfully but I'm stuck on GetDpiForMonitor... If some experienced user can help me I would be really thankful. Thanks! For a quick and dirty solution to GetDpiForMonitor you can just set *dpiX and *dpiY both to 96, and return S_OK. Or, if you feel like doing it "properly" there are GDI functions you can use to get the real DPI for the system, which you can use instead. As for SetProcessDpiAwareness, there's SetProcessDPIAware on Windows 7 - or you can just return a success code and do nothing. These DPI functions really don't matter too much if you have a normal (96 dpi or thereabouts) screen. Link to comment Share on other sites More sharing options...
ExtremeGrief Posted March 18, 2022 Author Share Posted March 18, 2022 5 hours ago, vxiiduu said: For a quick and dirty solution to GetDpiForMonitor you can just set *dpiX and *dpiY both to 96, and return S_OK. Or, if you feel like doing it "properly" there are GDI functions you can use to get the real DPI for the system, which you can use instead. As for SetProcessDpiAwareness, there's SetProcessDPIAware on Windows 7 - or you can just return a success code and do nothing. These DPI functions really don't matter too much if you have a normal (96 dpi or thereabouts) screen. That is how I fixed the SetProcessDpiAwareness, I changed it to SetProcessDpiAware. Where should I do the edits for GetDpiForMonitor? Link to comment Share on other sites More sharing options...
vxiiduu Posted March 19, 2022 Share Posted March 19, 2022 (edited) On 3/18/2022 at 4:12 PM, ExtremeGrief said: That is how I fixed the SetProcessDpiAwareness, I changed it to SetProcessDpiAware. Where should I do the edits for GetDpiForMonitor? You just edited the PE import table? With like CFF explorer or something? That isn't a sustainable solution and it won't work for many functions. Which app are you trying to get running? Edited March 19, 2022 by vxiiduu Link to comment Share on other sites More sharing options...
ExtremeGrief Posted March 20, 2022 Author Share Posted March 20, 2022 14 hours ago, vxiiduu said: You just edited the PE import table? With like CFF explorer or something? That isn't a sustainable solution and it won't work for many functions. Which app are you trying to get running? I used HxD. I am trying to get OpenConsole.exe from Microsoft Windows Terminal GitHub because Windows 7 Console Host sucks. Link to comment Share on other sites More sharing options...
jmeno Posted May 7, 2022 Share Posted May 7, 2022 I used cff explorer. Just randomly deleted DPI substring, some older function was named simillary. And..it worked. Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now