Screen mode retrieval/trace tool for Windows

Matteo Italia matteo at mitalia.net
Tue Mar 4 16:57:02 CST 2008


I think that you could just write a Windows application that listens for
WM_DISPLAYCHANGE messages (that are generated when the
ChangeDisplaySettingsEx succeeds) and logs the parameters recieved somewhere
(keep in mind that wParam = new BPP; LOWORD(lParam) = new horizontal
resolution; HIWORD(lParam) = new vertical resolution). If you need other
infos about the screen settings just use the GetDeviceCaps API with the
handle returned by GetDC(NULL) (see the MSDN for info about these APIs).
If you need any help, I'm here. :-)

Bye

Matteo

-----Original Message-----
From: wine-devel-bounces at winehq.org [mailto:wine-devel-bounces at winehq.org]
On Behalf Of Denver Gingerich
Sent: Tuesday, March 04, 2008 11:09 PM
To: wine-devel at winehq.org
Subject: Screen mode retrieval/trace tool for Windows

I am trying to trace the sequence of screen mode (resolution/bpp/refresh
rate) changes that occur when StarCraft is run in Windows so that I can make
Wine emulate Windows' behavior.  Right now I'm trying to see exactly what
resolution, bits per pixel, and refresh rate StarCraft is using.
Unfortunately, I can't just go into Display Properties while StarCraft is
running because it switches the resolution back when you Alt-Tab out of the
game.

My current plan is to install an SSH or telnet server on the Windows machine
and run a command line tool to check the current screen mode
while StarCraft is running.   I have used a couple of command-line
tools for changing the screen mode [1] [2], but neither of them have an
option to list the current mode.  Does anyone know of a tool or can anyone
quickly create a tool that will list the resolution currently in use from
the command line?

I have tried using StraceNT [3] to see the parameters passed to
ChangeDisplaySettingsEx (which is the function StarCraft uses to change the
resolution), but it does not let me look at the DEVMODE structure that is
passed in.  Does anyone know of a trace tool that would let me do that?

Based on my testing so far, there appears to be a discrepancy in how Windows
and Wine set the refresh rate if none is specified on a resolution change.
Wine always picks the first mode with a matching resolution, while Windows
does not.  My tests in Windows have shown that even though StarCraft asks
for 640x480 and the first mode with that resolution has a 60 Hz refresh
rate, Windows chooses a higher refresh rate.  Unfortunately, I don't know
exactly which refresh rate, but I can verify by sight that 60 Hz is not
being used (the screen doesn't flicker as it would at 60 Hz).  This
discrepancy is why I wish to run further tests and acquire more precise
information about the refresh rate being used.

I am performing this testing according to a request in a previous thread
[4].  If you have any questions about my testing, please let me know.

Denver


1. http://www.vrdevelopers.de/content/view/15/44/
2. http://www.nirsoft.net/utils/nircmd.html
3. http://www.intellectualheaven.com/default.asp?BH=projects&H=strace.htm
4. http://www.winehq.org/pipermail/wine-devel/2008-March/063150.html

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 5113 bytes
Desc: not available
Url : http://www.winehq.org/pipermail/wine-devel/attachments/20080304/7f5c43c5/attachment.bin 


More information about the wine-devel mailing list