Default Window Size

Started by tpekar, July 30, 2013, 05:20:01 PM

Previous topic - Next topic

tpekar

I was wondering if anyone out there knew how Windows determines what size to make the default window.  On my desktop the window is one size, on my laptop a smaller size, and on my netbook even smaller, so small that my controls will not fit on the screen and they overlap the status bar at the bottom.  Any help would be greatly appreciated.

thanks,
--tom

Stefan Pendl

If you use a dialog type window, then the controls are placed in dialog base units and not in pixels.

The difference is due to the different DPI settings of the displays.
---
Stefan

Proud member of the UltraDefrag Development Team

tpekar

Is DPI something that can be accessed within a Pelles C program?  So that adjustments can be made?

Stefan Pendl

You would use the GetDeviceCaps API function with the LOGPIXELSX index to retrieve the current DPI settings for the display.

Dividing them by 96 (= 100%) would give you the scaling factor.

You would need the following additional API functions:

  • GetDC of the zero handle for the entire screen
  • ReleaseDC to release the device context

MSDN has all the information on how to use the API functions.
---
Stefan

Proud member of the UltraDefrag Development Team