Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.
Keywords: winmetrics screen resolution mouse coordinates double click mouseclick lclick rclick
To change resolution. Gee. Umm get the control manager extender and beat on the Control panel Display applet till it gives up.
See the WinMetrics function, (request codes # -6, -5). Winmetrics request codes as follows:
Req# Return value -6 pixels per horizontal dialog unit (rounded to an integer) -5 pixels per vertical dialog unit (rounded to an integer) -4 Windows Platform 0 = Other 1 = Windows 2 = Windows for Workgroups 3 = Win32s 4 = Windows NT 5 = Windows 95 -3 WIL EXE type 0=Win16, 1=Intel32, 2=Alpha32, 3=Mips32, 4=PowerPC32 -2 WIL platform 1=Win16, 2=Win32 -1 Number of colors supported by video driver 0 Width of screen, in pixels 1 Height of screen, in pixels 2 Width of arrow on vertical scrollbar 3 Height of arrow on horizontal scrollbar 4 Height of window title bar 5 Width of window border lines 6 Height of window border lines 7 Width of dialog box frame 8 Height of dialog box frame 9 Height of thumb box on scrollbar 10 Width of thumb box on scrollbar 11 Width of an icon 12 Height of an icon 13 Width of a cursor 14 Height of a cursor 15 Height of a one line menu bar 16 Width of full screen window 17 Height of a full screen window 18 Height of Kanji window (Japanese) 19 Is a mouse present (0 = No, 1 = Yes) 20 Height of arrow on vertical scrollbar 21 Width of arrow on horizontal scrollbar 22 Is debug version of Windows running (0 = No, 1 = Yes) 23 Are Left and Right mouse buttons swapped (0 = No, 1 = Yes) 24 Reserved 25 Reserved 26 Reserved 27 Reserved 28 Minimum width of a window 29 Minimum height of a window 30 Width of bitmaps in title bar 31 Height of bitmaps in title bar 32 Width of sizeable window frame 33 Height of sizeable window frame 34 Minimum tracking width of a window 35 Minimum tracking height of a window Additional request #'s for WinMetrics (32-bit version only): 41 TRUE or non-zero if the Microsoft Windows for Pen computing extensions are installed; zero, or FALSE, otherwise. 42 TRUE or non-zero if the double-byte character set (DBCS) version of USER.EXE is installed; FALSE, or zero otherwise. 43 Number of buttons on mouse, or zero if no mouse is installed. 44 (Win95 only) TRUE if security is present, FALSE otherwise. 63 (Win95 only) The least significant bit is set if a network is present; otherwise, it is cleared. The other bits are reserved for future use. 67 (Win95 only) Value that specifies how the system was started: 0 - Normal boot 1 - Fail-safe boot 2 - Fail-safe with network boot Fail-safe boot (also called SafeBoot) bypasses the user's startup files. 70 TRUE or non-zero if the user requires an application to present information visually in situations where it would otherwise present the information only in audible form; FALSE, or zero, otherwise. 73 (Win95 only) TRUE if the computer has a low-end (slow) processor. 74 (Win95 only) TRUE if the system is enabled for Hebrew/Arabic languages. There are a number of other request #'s which can be specified, but are of limited usefulness and therefore not documented here. Details on these can be obtained from Win32 programming references, available from Microsoft (and others).NB: Use the WinParmGet function to get a bunch of information about the users' mouse, like how they have it configured, mouse sensitivity, DoubleClickSpeed, MouseButtonSwap, etc.
ScreenWidth =WinMetrics(0)/WinMetrics(-6) ;Determine screen width
ScreenHeight=WinMetrics(1)/WinMetrics(-5) ;Determine screen height
DlgWidth =ScreenWidth*0.663 ;Make splash screen 2/3 width of screen
DlgHeight=ScreenHeight*0.5 ;Make splash screen 1/2 height of screen
DlgX=(ScreenWidth-DlgWidth) /2 ;Determine X co-ordinate for splash screen to be centered
DlgY=(ScreenHeight-DlgHeight)/2 ;Determine Y co-ordinate for splash screen to be centered
TextWidth=162
TextHeight=30
TextX=(DlgWidth-TextWidth) /2 ;Determine X co-ordinate for label to be centered
TextY=(DlgHeight-TextHeight)/2 ;Determine Y co-ordinate for label to be centered
DlgCaption="Splash Test" ;Get name of dialog window for later reference
DlgCount=5 ;Set length of display in seconds
;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~;
;FixBox : Sets window style. ;
;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~;
;Win : window name ;
;flags : Use '&' to combine flags ;
; ~262144 unresizable ;
; ~65536 remove maximize ;
; ~131072 remove minimize ;
; ~12582912 remove caption ;
; ~524288 remove system menu ;
; 2147483648 pop up mode ;
; 8388608 pop up mode with border ;
;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~;
#DefineFunction FixBox(Win,Flags) ;Originally by Guido, with some liberties taken by Marc Worrel
hwnd=DllHwnd (Win) ;Get window handle
User32 = StrCat(DirWindows(1),"USER32.DLL")
OldStyle=DllCall(User32, long:"GetWindowLongA",long:hwnd,long:-16)
NewStyle=OldStyle & Flags
Result = DllCall(User32,long:"SetWindowLongA",long:hwnd,long:-16,long:NewStyle)
;Display can glitch until window is refreshed, so convince it has moved by moving it to its own current position
CurPos = Arrayize(WinPosition(Win),",")
WinPlace (CurPos[0],CurPos[1],CurPos[2],CurPos[3],Win)
IntControl (54,Win,1,0,0)
Return (Result)
#EndFunction
#DefineSubRoutine DlgCallback (DlgName,DlgEvent,DlgCtrlNo,param4,param5)
InitDialog = 0
TimerTick = 1
Switch DlgEvent
Case InitDialog
Count=DlgCount ;Set initial count
FixBox (DlgCaption,8388608) ;Get rid of window caption and create frame
DialogProcOptions(DlgName,TimerTick,1000) ;Set 1 second timer event
Return (-2)
Case TimerTick
Count=Count-1
If Count==0 Then Return (1)
Return(-2)
EndSwitch
Return(-2)
#EndSubRoutine
frmSplashFormat=`WWWDLGED,6.1`
frmSplashCaption=DlgCaption
frmSplashX=DlgX
frmSplashY=DlgY
frmSplashWidth=DlgWidth
frmSplashHeight=DlgHeight
frmSplashNumControls=002
frmSplashProcedure=`DlgCallback`
frmSplashFont=`DEFAULT`
frmSplashTextColor=`DEFAULT`
frmSplashBackground=`DEFAULT,DEFAULT`
frmSplashConfig=123
frmSplash001=`201,155,034,014,PUSHBUTTON,DEFAULT,"OK",1,1,1,DEFAULT,DEFAULT,DEFAULT`
frmSplash002=`%TextX%,%TextY%,%TextWidth%,%TextHeight%,STATICTEXT,DEFAULT,"Insert text here",DEFAULT,2,DEFAULT,"Microsoft Sans Serif|24576|40|34","0|0|128",DEFAULT`
frmSplashButtonPushed=Dialog("frmSplash",1)
Exit
Article ID: W13121
Filename: WinMetrics and Screen Resolution.txt
File Created: 2003:05:28:10:20:34
Last Updated: 2003:05:28:10:20:34