It's global for any other apps the user happens to be using, even if you put it back when your app closes. Oops -- I see that the code apparently forces a reboot? Ugh.
Not that the user could have used Display Properties to make the same change (and possibly not need to reboot, depending on their OS, IIRC). Sounds like this is a case where a Windows Forms app built when small (or large) fonts were used (by the developer) don't work so well when the end user has large (or small) fonts set. I haven't tried that; anyone know if that's a generic problem? At 04:41 PM 9/8/2003 +0200, Paul Stevens wrote >fair enough, but make sure that the user understands the option is a global >setting and not application specific, unless you are planning to apply and >reset the option on the startup and exit of your application > >-----Original Message----- >From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] >Sent: 08 September 2003 03:56 >To: [EMAIL PROTECTED] >Subject: Re: [ADVANCED-DOTNET] Changing Screen DPI > > >And If you just want to enable this feature at your solution for letting a >user decide >For him self what his preferred dpi settings ? > >-----Original Message----- >From: Moderated discussion of advanced .NET topics. >[mailto:[EMAIL PROTECTED] On Behalf Of Paul Stevens >Sent: Thursday, September 04, 2003 1:57 PM >To: [EMAIL PROTECTED] >Subject: Re: [ADVANCED-DOTNET] Changing Screen DPI > >Thats Cool!, the question however is why would you want to do that and how >many users would be sending you hate-mail for having done it? > >-----Original Message----- >From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] >Sent: 04 September 2003 12:05 >To: [EMAIL PROTECTED] >Subject: Re: [ADVANCED-DOTNET] Changing Screen DPI > > >Problem solved ! > >I've found the way to change it ! > >First we might want to know what is the current dpi settings (are we using >small (96dpi) font or big fonts (120dpi)) LOGPIXELSY is the number of pixels >contained in a logical inch on the device (dpi). This value is obtained by >calling the GetDeviceCaps() function with the LOGPIXELSY index (const of >integer - 90). >int GetDeviceCaps( HDC hdc, // handle to DC > int nIndex // index of capability ); > >ok so we got the DPI... how do we set it to something else... here comes an >undocumented api by the name of SetupChangeFontSize which reside in >SysSetup.dll which let you change the font size from 96dpi to 120dpi >(changing small fonts to large fonts and vice versa) > >DWORD WINAPI SetupChangeFontSize( HANDLE HWindow, LPCWSTR lpszFontSize) >SetupChangeFontSize Gets two parameters: >Handle of the calling window (i used NULL) font size string in unicode >format: >"120" for Large fonts and "96" for Small fonts the return value in a win32 >Error code for example: >ERROR_SUCCESS ( Value == 0 ) The operation completed successfully. >ERROR_CANCELLED ( Value == 1223 ) The operation was canceled by the user. > >So the pattern of converting to 120dpi will be try to change the font size >using the SetupChangeFontSize api, checking the return code and if its 0 >(success) just do reboot of the system. >[snip] J. Merrill / Analytical Software Corp =================================== This list is hosted by DevelopMentor� http://www.develop.com NEW! ASP.NET courses you may be interested in: 2 Days of ASP.NET, 29 Sept 2003, in Redmond http://www.develop.com/courses/2daspdotnet Guerrilla ASP.NET, 13 Oct 2003, in Boston http://www.develop.com/courses/gaspdotnet View archives and manage your subscription(s) at http://discuss.develop.com
