Dmitry Timoshkov : explorer: Store current display mode in the registry on startup.

Alexandre Julliard julliard at winehq.org
Tue Dec 4 13:25:23 CST 2007


Module: wine
Branch: master
Commit: e5488648056dba83d420aff88f27c67b51852211
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=e5488648056dba83d420aff88f27c67b51852211

Author: Dmitry Timoshkov <dmitry at codeweavers.com>
Date:   Mon Dec  3 22:14:35 2007 +0800

explorer: Store current display mode in the registry on startup.

---

 programs/explorer/desktop.c |   13 ++++++++++++-
 1 files changed, 12 insertions(+), 1 deletions(-)

diff --git a/programs/explorer/desktop.c b/programs/explorer/desktop.c
index 4b1d041..e67f680 100644
--- a/programs/explorer/desktop.c
+++ b/programs/explorer/desktop.c
@@ -38,7 +38,7 @@ static BOOL using_root;
 /* window procedure for the desktop window */
 static LRESULT WINAPI desktop_wnd_proc( HWND hwnd, UINT message, WPARAM wp, LPARAM lp )
 {
-    WINE_TRACE( "got msg %x wp %lx lp %lx\n", message, wp, lp );
+    WINE_TRACE( "got msg %04x wp %lx lp %lx\n", message, wp, lp );
 
     switch(message)
     {
@@ -123,6 +123,7 @@ static void initialize_display_settings( HWND desktop )
     GUID guid;
     LPWSTR guid_str;
     ATOM guid_atom;
+    DEVMODEW dmW;
 
     UuidCreate( &guid );
     UuidToStringW( &guid, &guid_str );
@@ -132,6 +133,16 @@ static void initialize_display_settings( HWND desktop )
     SetPropW( desktop, display_device_guid_propW, ULongToHandle(guid_atom) );
 
     RpcStringFreeW( &guid_str );
+
+    /* Store current display mode in the registry */
+    if (EnumDisplaySettingsExW( NULL, ENUM_CURRENT_SETTINGS, &dmW, 0 ))
+    {
+        WINE_TRACE( "Current display mode %ux%u %u bpp %u Hz\n", dmW.dmPelsWidth,
+                    dmW.dmPelsHeight, dmW.dmBitsPerPel, dmW.dmDisplayFrequency );
+        ChangeDisplaySettingsExW( NULL, &dmW, 0,
+                                  CDS_GLOBAL | CDS_NORESET | CDS_UPDATEREGISTRY,
+                                  NULL );
+    }
 }
 
 /* main desktop management function */




More information about the wine-cvs mailing list