Thomas: You asked:
>I have scanned the MapBasic docs for any possibility to obtain the
current
>screen resolution, but could not find anything.
>How does the professional MapBasic programmer community solve this common
>problem ?
>screen resolution, but could not find anything.
>How does the professional MapBasic programmer community solve this common
>problem ?
I do it through a direct call to the Windows API function
GetSystemMetrics, like this:
' scrnsize.mb
' Ref: "Programming Windows 3.1"
' Charles Petzold
' Microsoft Press 1992
' Page 60
' Charles Petzold
' Microsoft Press 1992
' Page 60
Declare Sub main
Declare Function GetSystemMetrics
Lib "USER32" (ByVal hWnd As Integer) As SmallInt
Lib "USER32" (ByVal hWnd As Integer) As SmallInt
Declare Sub GetScreenSize(intW as smallInt,
intH as smallInt)
Sub Main
dim ix as smallInt
dim iy as smallInt
call GetScreenSize(ix,iy)
Note "Screen Resolution " + chr$(10) +
str$(ix) + " x " + str$(iy)
End Sub
dim ix as smallInt
dim iy as smallInt
call GetScreenSize(ix,iy)
Note "Screen Resolution " + chr$(10) +
str$(ix) + " x " + str$(iy)
End Sub
Sub GetScreenSize(intW as smallInt, intH as
smallInt)
define SCR_WIDTH 0
define SCR_HEIGHT 1
intW=GetSystemMetrics(SCR_WIDTH)
intH=GetSystemMetrics(SCR_HEIGHT)
End Sub
define SCR_WIDTH 0
define SCR_HEIGHT 1
intW=GetSystemMetrics(SCR_WIDTH)
intH=GetSystemMetrics(SCR_HEIGHT)
End Sub
Regards
David M Haycraft Phone/Fax: 61 + 2 + 6231 8104
Information Analysis Assocs P/L Mobile: 0412 001 134
ACN 085 516 105 Email: [EMAIL PROTECTED]
1 Cumming Place, Wanniassa Web: www.acslink.aone.net.au/actaa/iaa.htm
A.C.T. 2903, Australia A MapInfo Partner
