[EXPLORER]

* Rework the WIN7_COMPAT_MODE into actually just disabling the incompatible functions, and introduce WIN7_DEBUG_MODE which does the rest of the "hacks" I used to ease development.

svn path=/trunk/; revision=68580
This commit is contained in:
David Quintana 2015-07-29 01:29:29 +00:00
parent 184bf48b97
commit 0dfcc314e5
3 changed files with 22 additions and 12 deletions

View file

@ -59,7 +59,7 @@ static VOID InitializeAtlModule(HINSTANCE hInstance, BOOL bInitialize)
} }
} }
#if !WIN7_COMPAT_MODE #if !WIN7_DEBUG_MODE
static BOOL static BOOL
SetShellReadyEvent(IN LPCTSTR lpEventName) SetShellReadyEvent(IN LPCTSTR lpEventName)
{ {
@ -95,7 +95,9 @@ HideMinimizedWindows(IN BOOL bHide)
if (!SystemParametersInfo(SPI_SETMINIMIZEDMETRICS, sizeof(mm), &mm, 0)) if (!SystemParametersInfo(SPI_SETMINIMIZEDMETRICS, sizeof(mm), &mm, 0))
ERR("SystemParametersInfo failed with %lu\n", GetLastError()); ERR("SystemParametersInfo failed with %lu\n", GetLastError());
} }
#endif
#if !WIN7_COMPAT_MODE
static INT static INT
StartWithCommandLine(IN HINSTANCE hInstance) StartWithCommandLine(IN HINSTANCE hInstance)
{ {
@ -140,9 +142,11 @@ StartWithDesktop(IN HINSTANCE hInstance)
InitCommonControls(); InitCommonControls();
OleInitialize(NULL); OleInitialize(NULL);
#if !WIN7_COMPAT_MODE #if !WIN7_DEBUG_MODE
ProcessStartupItems(); ProcessStartupItems();
#endif
#if !WIN7_COMPAT_MODE
/* Initialize shell dde support */ /* Initialize shell dde support */
_ShellDDEInit(TRUE); _ShellDDEInit(TRUE);
#endif #endif
@ -156,7 +160,7 @@ StartWithDesktop(IN HINSTANCE hInstance)
CComPtr<ITrayWindow> Tray; CComPtr<ITrayWindow> Tray;
CreateTrayWindow(&Tray); CreateTrayWindow(&Tray);
#if !WIN7_COMPAT_MODE #if !WIN7_DEBUG_MODE
/* This not only hides the minimized window captions in the bottom /* This not only hides the minimized window captions in the bottom
left screen corner, but is also needed in order to receive left screen corner, but is also needed in order to receive
HSHELL_* notification messages (which are required for taskbar HSHELL_* notification messages (which are required for taskbar
@ -175,12 +179,12 @@ StartWithDesktop(IN HINSTANCE hInstance)
if (Tray != NULL) if (Tray != NULL)
{ {
TrayMessageLoop(Tray); TrayMessageLoop(Tray);
#if !WIN7_COMPAT_MODE #if !WIN7_DEBUG_MODE
HideMinimizedWindows(FALSE); HideMinimizedWindows(FALSE);
#endif #endif
} }
#if !WIN7_COMPAT_MODE #if !WIN7_DEBUG_MODE
if (hShellDesktop != NULL) if (hShellDesktop != NULL)
DesktopDestroyShellWindow(hShellDesktop); DesktopDestroyShellWindow(hShellDesktop);
#endif #endif
@ -201,17 +205,17 @@ _tWinMain(IN HINSTANCE hInstance,
IN LPTSTR lpCmdLine, IN LPTSTR lpCmdLine,
IN INT nCmdShow) IN INT nCmdShow)
{ {
#if !WIN7_COMPAT_MODE
BOOL CreateShellDesktop = FALSE;
TRACE("Explorer starting... Commandline: %S\n", lpCmdLine);
/* /*
* Set our shutdown parameters: we want to shutdown the very last, * Set our shutdown parameters: we want to shutdown the very last,
* but before any TaskMgr instance (which has a shutdown level of 1). * but before any TaskMgr instance (which has a shutdown level of 1).
*/ */
SetProcessShutdownParameters(2, 0); SetProcessShutdownParameters(2, 0);
#if !WIN7_COMPAT_MODE
BOOL CreateShellDesktop = FALSE;
TRACE("Explorer starting... Commandline: %S\n", lpCmdLine);
if (GetShellWindow() == NULL) if (GetShellWindow() == NULL)
CreateShellDesktop = TRUE; CreateShellDesktop = TRUE;

View file

@ -2,6 +2,12 @@
#define _EXPLORER_PRECOMP__H_ #define _EXPLORER_PRECOMP__H_
#define WIN7_COMPAT_MODE 0 #define WIN7_COMPAT_MODE 0
#define WIN7_DEBUG_MODE 0
#if WIN7_DEBUG_MODE && !WIN7_COMPAT_MODE
#undef WIN7_COMPAT_MODE
#define WIN7_COMPAT_MODE 1
#endif
#include <stdio.h> #include <stdio.h>
#include <tchar.h> #include <tchar.h>

View file

@ -986,7 +986,7 @@ ChangePos:
VOID ResizeWorkArea() VOID ResizeWorkArea()
{ {
#if !WIN7_COMPAT_MODE #if !WIN7_DEBUG_MODE
RECT rcTray, rcWorkArea; RECT rcTray, rcWorkArea;
/* If monitor has changed then fix the previous monitors work area */ /* If monitor has changed then fix the previous monitors work area */
@ -1098,7 +1098,7 @@ ChangePos:
/* FIXME: Are there more flags? */ /* FIXME: Are there more flags? */
#if WIN7_COMPAT_MODE #if WIN7_DEBUG_MODE
m_Position = ABE_LEFT; m_Position = ABE_LEFT;
#else #else
if (sr.Position > ABE_BOTTOM) if (sr.Position > ABE_BOTTOM)