Hi!

I'm developing an application which I want to be DPI aware. So, I have 2
DLL files with DPI specific resources (for 96 and 192 DPI). I followed
instructions on http://msdn.microsoft.com/en-us/library/ms838224.aspx
and I have 2 problems:

1) On my VGA device (PPC2003SE) and in the emulator with VGA image
(WM6), DPI returned by the following code sequence is always 96:

HDC hdcScreen = ::GetDC(NULL);
INT nSystemDPI = GetDeviceCaps(hdcScreen, LOGPIXELSX);
::ReleaseDC(NULL, hdcScreen);

How to detect the DPI in setup.dll used during the installation process?

2) On WM6 emulator, the following rows from the .inf file are not working:

[AddRegSection]
HKLM,Software\Microsoft\SetupDPI,%InstallDir%\Res_096.DLL,65537,0
HKLM,Software\Microsoft\SetupDPI,%InstallDir%\Res_192.DLL,65537,0

What I read from the registry is exactly %InstallDir%\Res_096.DLL,
meaning that the %InstallDir% is not substituted with the installation path.

On PPC2003 device and emulator this works ok.

Thank you for your answers,
--
David Andrs

Re: Installation with DPI-Specific Resources by beemer

beemer
Tue Jul 22 04:46:30 CDT 2008

On Jul 20, 2:26=A0pm, David Andrs <and...@seznam.cz> wrote:
> Hi!
>
> I'm developing an application which I want to be DPI aware. So, I have 2
> DLL files with DPI specific resources (for 96 and 192 DPI). I followed
> instructions onhttp://msdn.microsoft.com/en-us/library/ms838224.aspx
> and I have 2 problems:
>
> 1) On my VGA device (PPC2003SE) and in the emulator with VGA image
> (WM6), DPI returned by the following code sequence is always 96:
>
> =A0 =A0 =A0HDC hdcScreen =3D ::GetDC(NULL);
> =A0 =A0 =A0INT nSystemDPI =3D GetDeviceCaps(hdcScreen, LOGPIXELSX);
> =A0 =A0 =A0::ReleaseDC(NULL, hdcScreen);
>
> How to detect the DPI in setup.dll used during the installation process?
>
> 2) On WM6 emulator, the following rows from the .inf file are not working=
:
>
> [AddRegSection]
> =A0 =A0 HKLM,Software\Microsoft\SetupDPI,%InstallDir%\Res_096.DLL,65537,0
> =A0 =A0 HKLM,Software\Microsoft\SetupDPI,%InstallDir%\Res_192.DLL,65537,0
>
> What I read from the registry is exactly %InstallDir%\Res_096.DLL,
> meaning that the %InstallDir% is not substituted with the installation pa=
th.
>
> On PPC2003 device and emulator this works ok.
>
> Thank you for your answers,
> --
> David Andrs

setup.dll runs under a process that unfortunately is not DPI aware
(Maybe a Microsoft bug?), so you can't, because a QVGA and a VGA
device will report the same information.

What I do is to copy a small eecutable during the install process and
call it from setup.dll.This executable sets a registry value telling
if the device is VGA or QVGA. Then I read this value from setup.dll