GetSystemMetrics
Posted: Wed Oct 15, 2003 4:57 am
I have a problem that the SM_CYSCREEN returns the SM_CXSCREEN value instead of what it should be, SM_CXSCREEN works fine.
My screen resolution is 1024 by 768 and SM_CXSCREEN and SM_CYSCREEN both return 1024. Is this a bug or am I doing something wrong?
I was not sure what part of the forums I should have posted this in, it was either this or Beginners.
My screen resolution is 1024 by 768 and SM_CXSCREEN and SM_CYSCREEN both return 1024. Is this a bug or am I doing something wrong?
Code: Select all
;Gets Screen X and Y
ScreenX = GetSystemMetrics_(SM_CXSCREEN)
ScreenY = GetSystemMetrics_(SM_CYSCREEN)
;Creates window
If OpenWindow(0, ScreenX/2-Int(0.75*ScreenX/2), ScreenY/2-Int(0.4*ScreenY/2), Int(0.75*ScreenX), Int(0.4*ScreenY), #PB_Window_SystemMenu | #PB_Window_MinimizeGadget | #PB_Window_MaximizeGadget | #PB_Window_SizeGadget | #PB_Window_TitleBar , "GetSystemMetrics Example for Forum")
EndIf
MessageRequester("ScreenX",Str(ScreenX))
MessageRequester("ScreenY",Str(ScreenY))
Repeat
EventID = WaitWindowEvent()
Until EventID = #PB_EventCloseWindow
End