NO

Author Topic: Default Window Size  (Read 2884 times)

tpekar

  • Guest
Default Window Size
« on: July 30, 2013, 05:20:01 pm »
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

Offline Stefan Pendl

  • Global Moderator
  • Member
  • *****
  • Posts: 579
    • Homepage
Re: Default Window Size
« Reply #1 on: July 30, 2013, 09:14:25 pm »
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

  • Guest
Re: Default Window Size
« Reply #2 on: July 30, 2013, 10:02:56 pm »
Is DPI something that can be accessed within a Pelles C program?  So that adjustments can be made?

Offline Stefan Pendl

  • Global Moderator
  • Member
  • *****
  • Posts: 579
    • Homepage
Re: Default Window Size
« Reply #3 on: July 30, 2013, 10:31:07 pm »
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