Getting Windows-Window Resolution

Just starting out? Need help? Post your questions and find answers here.
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Cantor.

Hi!

How can I get the resolution results of the system (Windows Desktop) screen?
It is necessary as I want to open an application window that has the sizes of the Windows Desktop.


--
Best regards,
Martin
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by PB.

GetSystemMetrics_(#SM_CXSCREEN) ; Gives the width (in pixels) of the Desktop.
GetSystemMetrics_(#SM_CYSCREEN) ; Gives the height (in pixels) of the Desktop.

Thus, to open a full-screen window:

Code: Select all

If OpenWindow(0,0,0,GetSystemMetrics_(#SM_CXSCREEN),GetSystemMetrics_(#SM_CYSCREEN),#PB_Window_SystemMenu|#PB_Window_MinimizeGadget,"Title")
  Repeat
    ev=WaitWindowEvent()
  Until ev=#PB_EventCloseWindow
EndIf

Edited by - PB on 04 November 2001 21:35:19
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Cantor.
GetSystemMetrics_(#SM_CXSCREEN) ; Gives the width (in pixels) of the Desktop.
GetSystemMetrics_(#SM_CYSCREEN) ; Gives the height (in pixels) of the Desktop.
Many thanks for Your help. That's what I've searched for.

Do You also know how I can get the height of the taskbar at the bottom of the desktop? I want to open a maximized window but the taskbar should be visible.

--
Best regards,
Martin
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by PB.
Do You also know how I can get the height of the taskbar at the bottom of the desktop? I want to open a maximized window but the taskbar should be visible.
I don't know how to get the Taskbar height, but one thing you should be aware of is that the Taskbar can be on any edge of the screen -- not just the bottom. So it's probably better just to open your window and then maximize it with this code: ShowWindow_(WindowID(),#SW_MAXIMIZE)


Edited by - PB on 05 November 2001 01:29:52
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Franco.

Hi Cantor,
look at my post's on 'Trick 'n' Tips' and you will find 2 sources:
Application Bar Information (September 21)
and
Put a Window in a Corner (September 22)

Hope this helps.




Have a nice day...
Franco
Post Reply