* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include <precomp.h>
+#include "precomp.h"
HINSTANCE hExplorerInstance;
HMODULE hUser32;
WORD wCodePage;
} LANGCODEPAGE, *PLANGCODEPAGE;
-/* undoc GUID */
-DEFINE_GUID(CLSID_RebarBandSite, 0xECD4FC4D, 0x521C, 0x11D0, 0xB7, 0x92, 0x00, 0xA0, 0xC9, 0x03, 0x12, 0xE1);
-
LONG
SetWindowStyle(IN HWND hWnd,
IN LONG dwStyleMask,
ASSERT((~dwStyleMask & dwStyle) == 0);
- PrevStyle = GetWindowLongPtr(hWnd,
- GWL_STYLE);
+ PrevStyle = GetWindowLong(hWnd,
+ GWL_STYLE);
if (PrevStyle != 0 &&
(PrevStyle & dwStyleMask) != dwStyle)
{
Style = PrevStyle & ~dwStyleMask;
Style |= dwStyle;
- PrevStyle = SetWindowLongPtr(hWnd,
- GWL_STYLE,
- Style);
+ PrevStyle = SetWindowLong(hWnd,
+ GWL_STYLE,
+ Style);
}
return PrevStyle;
ASSERT((~dwStyleMask & dwStyle) == 0);
- PrevStyle = GetWindowLongPtr(hWnd,
- GWL_EXSTYLE);
+ PrevStyle = GetWindowLong(hWnd,
+ GWL_EXSTYLE);
if (PrevStyle != 0 &&
(PrevStyle & dwStyleMask) != dwStyle)
{
Style = PrevStyle & ~dwStyleMask;
Style |= dwStyle;
- PrevStyle = SetWindowLongPtr(hWnd,
- GWL_EXSTYLE,
- Style);
+ PrevStyle = SetWindowLong(hWnd,
+ GWL_EXSTYLE,
+ Style);
}
return PrevStyle;
BOOL bRet = FALSE;
unsigned int i;
- dwLen = GetFileVersionInfoSize(szFileName,&dwHandle);
+ dwLen = GetFileVersionInfoSize(szFileName, &dwHandle);
if (dwLen > 0)
{
- lpData = HeapAlloc(hProcessHeap,0,dwLen);
+ lpData = HeapAlloc(hProcessHeap, 0, dwLen);
if (lpData != NULL)
{
(LPVOID *)&lpTranslate,
&cbTranslate);
- for (i = 0;i < (cbTranslate / sizeof(LANGCODEPAGE));i++)
+ for (i = 0; i < cbTranslate / sizeof(LANGCODEPAGE); i++)
{
/* If the bottom eight bits of the language id's
match, use this version information (since this
sizeof(szSubBlock) / sizeof(szSubBlock[0]),
TEXT("\\StringFileInfo\\%04X%04X\\%s"),
lpTranslate[i].wLanguage,
- lpTranslate[i].wCodePage,szVersionInfo);
+ lpTranslate[i].wCodePage,
+ szVersionInfo);
if (VerQueryValue(lpData,
szSubBlock,
(LPVOID *)&lpszLocalBuf,
&cbLen) != 0)
{
- wcsncpy(szBuffer,lpszLocalBuf,cbBufLen);
+ wcsncpy(szBuffer, lpszLocalBuf, cbBufLen);
bRet = TRUE;
break;
}
}
}
- HeapFree(hProcessHeap,0,lpData);
+ HeapFree(hProcessHeap, 0, lpData);
lpData = NULL;
}
}
return bRet;
}
+static VOID
+HideMinimizedWindows(IN BOOL bHide)
+{
+ MINIMIZEDMETRICS mm;
+
+ mm.cbSize = sizeof(mm);
+ if (!SystemParametersInfo(SPI_GETMINIMIZEDMETRICS, sizeof(mm), &mm, 0))
+ {
+ DbgPrint("SystemParametersInfo failed with %lu\n", GetLastError());
+ return;
+ }
+ if (bHide)
+ mm.iArrange |= ARW_HIDE;
+ else
+ mm.iArrange &= ~ARW_HIDE;
+ if (!SystemParametersInfo(SPI_SETMINIMIZEDMETRICS, sizeof(mm), &mm, 0))
+ DbgPrint("SystemParametersInfo failed with %lu\n", GetLastError());
+}
+
INT WINAPI
_tWinMain(IN HINSTANCE hInstance,
IN HINSTANCE hPrevInstance,
hExplorerInstance = hInstance;
hProcessHeap = GetProcessHeap();
+ LoadAdvancedSettings();
hUser32 = GetModuleHandle(TEXT("USER32.DLL"));
if (hUser32 != NULL)
InitCommonControls();
OleInitialize(NULL);
+ ProcessStartupItems();
+
if (GetShellWindow() == NULL)
CreateShellDesktop = TRUE;
if (RegisterTrayWindowClass() && RegisterTaskSwitchWndClass())
{
Tray = CreateTrayWindow();
+ /* This not only hides the minimized window captions in the bottom
+ left screen corner, but is also needed in order to receive
+ HSHELL_* notification messages (which are required for taskbar
+ buttons to work right) */
+ HideMinimizedWindows(TRUE);
if (Tray != NULL)
hShellDesktop = DesktopCreateWindow(Tray);
}
if (Tray != NULL)
+ {
+ RegisterHotKey(NULL, IDHK_RUN, MOD_WIN, 'R');
TrayMessageLoop(Tray);
+ HideMinimizedWindows(FALSE);
+ ITrayWindow_Release(Tray);
+ UnregisterTrayWindowClass();
+ }
if (hShellDesktop != NULL)
DesktopDestroyShellWindow(hShellDesktop);