Author: tfaber Date: Sun Dec 23 10:25:19 2012 New Revision: 57976
URL: http://svn.reactos.org/svn/reactos?rev=57976&view=rev Log: [EXPLORER_NEW] - Add a manifest file to support theming - Formatting fixes - Based on Andrew Green's GSoC branch
Added: trunk/reactos/base/shell/explorer-new/explorer.exe.manifest (with props) Modified: trunk/reactos/base/shell/explorer-new/explorer.rc trunk/reactos/base/shell/explorer-new/taskswnd.c trunk/reactos/base/shell/explorer-new/trayntfy.c
Added: trunk/reactos/base/shell/explorer-new/explorer.exe.manifest URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/explorer-new/exp... ============================================================================== --- trunk/reactos/base/shell/explorer-new/explorer.exe.manifest (added) +++ trunk/reactos/base/shell/explorer-new/explorer.exe.manifest [iso-8859-1] Sun Dec 23 10:25:19 2012 @@ -1,0 +1,22 @@ +<?xml version="1.0" encoding="UTF-8" standalone="yes"?> +<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"> +<assemblyIdentity + version="1.0.0.0" + processorArchitecture="X86" + name="ReactOS.Explorer" + type="win32" +/> +<description>This is ReactOS Explorer</description> +<dependency> + <dependentAssembly> + <assemblyIdentity + type="win32" + name="Microsoft.Windows.Common-Controls" + version="6.0.0.0" + processorArchitecture="X86" + publicKeyToken="6595b64144ccf1df" + language="*" + /> + </dependentAssembly> +</dependency> +</assembly>
Propchange: trunk/reactos/base/shell/explorer-new/explorer.exe.manifest ------------------------------------------------------------------------------ svn:eol-style = native
Modified: trunk/reactos/base/shell/explorer-new/explorer.rc URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/explorer-new/exp... ============================================================================== --- trunk/reactos/base/shell/explorer-new/explorer.rc [iso-8859-1] (original) +++ trunk/reactos/base/shell/explorer-new/explorer.rc [iso-8859-1] Sun Dec 23 10:25:19 2012 @@ -20,6 +20,7 @@ IDB_TASKBARPROP_NOLOCK_NOGROUP_NOQL BITMAP DISCARDABLE res/nolock_nogroup_noql.bmp IDB_TASKBARPROP_NOLOCK_NOGROUP_QL BITMAP DISCARDABLE res/nolock_nogroup_ql.bmp IDB_TASKBARPROP_NOLOCK_GROUP_QL BITMAP DISCARDABLE res/nolock_group_ql.bmp +CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST "explorer.exe.manifest"
// UTF-8 #pragma code_page(65001)
Modified: trunk/reactos/base/shell/explorer-new/taskswnd.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/explorer-new/tas... ============================================================================== --- trunk/reactos/base/shell/explorer-new/taskswnd.c [iso-8859-1] (original) +++ trunk/reactos/base/shell/explorer-new/taskswnd.c [iso-8859-1] Sun Dec 23 10:25:19 2012 @@ -1729,7 +1729,7 @@ GetCursorPos(&pt); cmd = TrackPopupMenu(hmenu, TPM_LEFTBUTTON|TPM_RIGHTBUTTON|TPM_RETURNCMD, pt.x, pt.y, 0, This->hWndToolbar, NULL); if (cmd) { - SetForegroundWindow(TaskItem->hWnd); // reactivate window after the context menu has closed + SetForegroundWindow(TaskItem->hWnd); // reactivate window after the context menu has closed PostMessage(TaskItem->hWnd, WM_SYSCOMMAND, cmd, 0); } }
Modified: trunk/reactos/base/shell/explorer-new/trayntfy.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/explorer-new/tra... ============================================================================== --- trunk/reactos/base/shell/explorer-new/trayntfy.c [iso-8859-1] (original) +++ trunk/reactos/base/shell/explorer-new/trayntfy.c [iso-8859-1] Sun Dec 23 10:25:19 2012 @@ -22,7 +22,7 @@
/* * TrayClockWnd - */ + */
static const TCHAR szTrayClockWndClass[] = TEXT("TrayClockWClass"); static LPCTSTR s_szRegistryKey = _T("Software\ReactOS\Features\Explorer"); @@ -40,46 +40,46 @@ {TRUE, 0, NULL}, {FALSE, 0, TEXT("dddd")}, {FALSE, DATE_SHORTDATE, NULL} -}; - -HRESULT RegGetDWord(HKEY hKey, LPCTSTR szValueName, DWORD * lpdwResult) -{ - LONG lResult; - DWORD dwDataSize = sizeof(DWORD); - DWORD dwType = 0; - - // Check input parameters... - if (hKey == NULL || lpdwResult == NULL) return E_INVALIDARG; - - // Get dword value from the registry... - lResult = RegQueryValueEx(hKey, szValueName, 0, &dwType, (LPBYTE) lpdwResult, &dwDataSize ); - - // Check result and make sure the registry value is a DWORD(REG_DWORD)... - if (lResult != ERROR_SUCCESS) return HRESULT_FROM_WIN32(lResult); - else if (dwType != REG_DWORD) return DISP_E_TYPEMISMATCH; - - return NOERROR; +}; + +HRESULT RegGetDWord(HKEY hKey, LPCTSTR szValueName, DWORD * lpdwResult) +{ + LONG lResult; + DWORD dwDataSize = sizeof(DWORD); + DWORD dwType = 0; + + // Check input parameters... + if (hKey == NULL || lpdwResult == NULL) return E_INVALIDARG; + + // Get dword value from the registry... + lResult = RegQueryValueEx(hKey, szValueName, 0, &dwType, (LPBYTE) lpdwResult, &dwDataSize ); + + // Check result and make sure the registry value is a DWORD(REG_DWORD)... + if (lResult != ERROR_SUCCESS) return HRESULT_FROM_WIN32(lResult); + else if (dwType != REG_DWORD) return DISP_E_TYPEMISMATCH; + + return NOERROR; }
void LoadSettings(void) { - HKEY hKey = NULL; - DWORD dwValue; - - if (RegOpenKey(HKEY_CURRENT_USER, s_szRegistryKey, &hKey) == ERROR_SUCCESS) - { - RegGetDWord(hKey, TEXT("blShowSeconds"), &dwValue); - if (dwValue == 1) - { - blShowSeconds = TRUE; - } - else - { - blShowSeconds = FALSE; - } - - RegCloseKey(hKey); - } + HKEY hKey = NULL; + DWORD dwValue; + + if (RegOpenKey(HKEY_CURRENT_USER, s_szRegistryKey, &hKey) == ERROR_SUCCESS) + { + RegGetDWord(hKey, TEXT("blShowSeconds"), &dwValue); + if (dwValue == 1) + { + blShowSeconds = TRUE; + } + else + { + blShowSeconds = FALSE; + } + + RegCloseKey(hKey); + } }
#define CLOCKWND_FORMAT_COUNT (sizeof(ClockWndFormats) / sizeof(ClockWndFormats[0])) @@ -94,7 +94,7 @@ HFONT hFont; RECT rcText; SYSTEMTIME LocalTime; - + union { DWORD dwFlags; @@ -276,11 +276,11 @@
if (iRet != 0 && i == 0) { - if (blShowSeconds == FALSE) - { - (This->szLines[0][5] = '\0'); - }; - + if (blShowSeconds == FALSE) + { + This->szLines[0][5] = '\0'; + } + /* Set the window text to the time only */ SetWindowText(This->hWnd, This->szLines[i]); @@ -344,10 +344,10 @@ /* Calculate the due time */ GetLocalTime(&This->LocalTime); uiDueTime = 1000 - (UINT)This->LocalTime.wMilliseconds; - if (blShowSeconds == TRUE) - uiDueTime += ( (UINT)This->LocalTime.wSecond) * 100; - else - uiDueTime += (59 - (UINT)This->LocalTime.wSecond) * 1000; + if (blShowSeconds == TRUE) + uiDueTime += (UINT)This->LocalTime.wSecond * 100; + else + uiDueTime += (59 - (UINT)This->LocalTime.wSecond) * 1000;
if (uiDueTime < USER_TIMER_MINIMUM || uiDueTime > USER_TIMER_MAXIMUM) uiDueTime = 1000; @@ -401,7 +401,7 @@ { UINT uiDueTime; BOOL Ret; - int intWait1, intWait2; + int intWait1, intWait2;
/* Kill the initialization timer */ KillTimer(This->hWnd, @@ -409,26 +409,26 @@ This->IsInitTimerEnabled = FALSE;
uiDueTime = TrayClockWnd_CalculateDueTime(This); - - if (blShowSeconds == TRUE) - { - intWait1 = 1000-200; - intWait2 = 1000; - } - else - { - intWait1 = 60*1000-200; - intWait2 = 60*1000; - } + + if (blShowSeconds == TRUE) + { + intWait1 = 1000 - 200; + intWait2 = 1000; + } + else + { + intWait1 = 60 * 1000 - 200; + intWait2 = 60 * 1000; + }
if (uiDueTime > intWait1) { /* The update of the clock will be up to 200 ms late, but that's acceptable. We're going to setup a timer that fires depending - intWait2. */ + intWait2. */ Ret = SetTimer(This->hWnd, ID_TRAYCLOCK_TIMER, - intWait2, + intWait2, NULL) != 0; This->IsTimerEnabled = Ret;
@@ -677,7 +677,7 @@ PTRAY_CLOCK_WND_DATA TcData; DWORD dwStyle; HWND hWnd = NULL; - LoadSettings(); + LoadSettings();
TcData = HeapAlloc(hProcessHeap, 0,