[1/2] explorer: Store current display mode in the registry on startup

Dmitry Timoshkov dmitry at codeweavers.com
Mon Nov 5 20:44:56 CST 2007


Hello,

Changelog:
    [1/2] explorer: Store current display mode in the registry on startup.
---
 programs/explorer/desktop.c |   14 +++++++++++++-
 1 files changed, 13 insertions(+), 1 deletions(-)

diff --git a/programs/explorer/desktop.c b/programs/explorer/desktop.c
index 7f2e23f..2c98990 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)
     {
@@ -166,6 +166,8 @@ void manage_desktop( char *arg )
                             0, 0, width, height, 0, 0, 0, NULL );
     if (hwnd == GetDesktopWindow())
     {
+        DEVMODEW dmW;
+
         SetWindowLongPtrW( hwnd, GWLP_WNDPROC, (LONG_PTR)desktop_wnd_proc );
         SendMessageW( hwnd, WM_SETICON, ICON_BIG, (LPARAM)LoadIconW( 0, MAKEINTRESOURCEW(OIC_WINLOGO)));
         SetWindowTextW( hwnd, desktop_nameW );
@@ -174,6 +176,16 @@ void manage_desktop( char *arg )
         initialize_diskarbitration();
         initialize_hal();
         initialize_systray();
+
+        /* 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 );
+        }
     }
     else
     {
-- 
1.5.3.4






More information about the wine-patches mailing list