diff options
Diffstat (limited to 'plugins/AutoShutdown/src')
| -rw-r--r-- | plugins/AutoShutdown/src/cpuusage.cpp | 12 | ||||
| -rw-r--r-- | plugins/AutoShutdown/src/frame.cpp | 16 | ||||
| -rw-r--r-- | plugins/AutoShutdown/src/shutdownsvc.cpp | 8 | ||||
| -rw-r--r-- | plugins/AutoShutdown/src/utils.cpp | 4 | 
4 files changed, 20 insertions, 20 deletions
diff --git a/plugins/AutoShutdown/src/cpuusage.cpp b/plugins/AutoShutdown/src/cpuusage.cpp index ba4ccd1107..7ca145d875 100644 --- a/plugins/AutoShutdown/src/cpuusage.cpp +++ b/plugins/AutoShutdown/src/cpuusage.cpp @@ -31,13 +31,13 @@ static BOOL WinNT_PerfStatsSwitch(TCHAR *pszServiceName, BOOL fDisable)  	DWORD dwData, dwDataSize;
  	BOOL fSwitched = FALSE;
  	/* Win2000+ */
 -	if (!RegOpenKeyEx(HKEY_LOCAL_MACHINE, _T("System\\CurrentControlSet\\Services"), 0, KEY_QUERY_VALUE | KEY_SET_VALUE, &hKeyServices)) {
 +	if (!RegOpenKeyEx(HKEY_LOCAL_MACHINE, L"System\\CurrentControlSet\\Services", 0, KEY_QUERY_VALUE | KEY_SET_VALUE, &hKeyServices)) {
  		if (!RegOpenKeyEx(hKeyServices, pszServiceName, 0, KEY_QUERY_VALUE | KEY_SET_VALUE, &hKeyService)) {
 -			if (!RegOpenKeyEx(hKeyService, _T("Performance"), 0, KEY_QUERY_VALUE | KEY_SET_VALUE, &hKeyPerf)) {
 +			if (!RegOpenKeyEx(hKeyService, L"Performance", 0, KEY_QUERY_VALUE | KEY_SET_VALUE, &hKeyPerf)) {
  				dwDataSize = sizeof(DWORD);
 -				if (!RegQueryValueEx(hKeyPerf, _T("Disable Performance Counters"), NULL, NULL, (BYTE*)&dwData, &dwDataSize))
 +				if (!RegQueryValueEx(hKeyPerf, L"Disable Performance Counters", NULL, NULL, (BYTE*)&dwData, &dwDataSize))
  					if ((dwData != 0) != fDisable)
 -						fSwitched = !RegSetValueEx(hKeyPerf, _T("Disable Performance Counters"), 0, REG_DWORD, (BYTE*)&fDisable, dwDataSize);
 +						fSwitched = !RegSetValueEx(hKeyPerf, L"Disable Performance Counters", 0, REG_DWORD, (BYTE*)&fDisable, dwDataSize);
  				RegCloseKey(hKeyPerf);
  			}
  			RegCloseKey(hKeyService);
 @@ -95,7 +95,7 @@ static void WinNT_PollThread(void *vparam)  	dwCounterId = 6;              /* '% processor time' counter */
  	pwszInstanceName = L"_Total"; /* '_Total' instance */
  	_itot_s(dwObjectId, wszValueName, 10);
 -	fSwitched = WinNT_PerfStatsSwitch(_T("PerfOS"), FALSE);
 +	fSwitched = WinNT_PerfStatsSwitch(L"PerfOS", FALSE);
  	/* poll */
  	for (;;) {
 @@ -171,7 +171,7 @@ static void WinNT_PollThread(void *vparam)  	if (pPerfData)
  		mir_free(pPerfData);
  	if (fSwitched)
 -		WinNT_PerfStatsSwitch(_T("PerfOS"), TRUE);
 +		WinNT_PerfStatsSwitch(L"PerfOS", TRUE);
  	/* return error for PollCpuUsage() if never succeeded */
  	if (param->hFirstEvent != NULL)
 diff --git a/plugins/AutoShutdown/src/frame.cpp b/plugins/AutoShutdown/src/frame.cpp index 7477c0c990..0f76cb66fa 100644 --- a/plugins/AutoShutdown/src/frame.cpp +++ b/plugins/AutoShutdown/src/frame.cpp @@ -73,7 +73,7 @@ static LRESULT CALLBACK ProgressBarSubclassProc(HWND hwndProgress, UINT msg, WPA  /************************* Window Class *******************************/
 -#define COUNTDOWNFRAME_CLASS  _T("AutoShutdownCountdown")
 +#define COUNTDOWNFRAME_CLASS  L"AutoShutdownCountdown"
  /* Data */
  struct CountdownFrameWndData
 @@ -124,17 +124,17 @@ static LRESULT CALLBACK FrameWndProc(HWND hwndFrame, UINT msg, WPARAM wParam, LP  	case WM_CREATE:  /*  create childs */
  		{
  			CREATESTRUCT *params = (CREATESTRUCT*)lParam;
 -			dat->hwndIcon = CreateWindowEx(WS_EX_NOPARENTNOTIFY, _T("Static"), NULL, WS_CHILD | WS_VISIBLE | SS_ICON | SS_CENTERIMAGE | SS_NOTIFY,
 +			dat->hwndIcon = CreateWindowEx(WS_EX_NOPARENTNOTIFY, L"Static", NULL, WS_CHILD | WS_VISIBLE | SS_ICON | SS_CENTERIMAGE | SS_NOTIFY,
  				3, 0, GetSystemMetrics(SM_CXICON), GetSystemMetrics(SM_CYICON), hwndFrame, NULL, params->hInstance, NULL);
  			dat->hwndProgress = CreateWindowEx(WS_EX_NOPARENTNOTIFY, PROGRESS_CLASS, (dat->fTimeFlags&SDWTF_ST_TIME) ? TranslateT("Shutdown at:") : TranslateT("Time left:"),
  				WS_CHILD | WS_VISIBLE | PBS_SMOOTH, GetSystemMetrics(SM_CXICON) + 5, 5, 90, (GetSystemMetrics(SM_CXICON) / 2) - 5, hwndFrame, NULL, params->hInstance, NULL);
  			if (dat->hwndProgress == NULL) return -1; /* creation failed, calls WM_DESTROY */
  			SendMessage(dat->hwndProgress, PBM_SETSTEP, 1, 0);
  			mir_subclassWindow(dat->hwndProgress, ProgressBarSubclassProc);
 -			dat->hwndDesc = CreateWindowEx(WS_EX_NOPARENTNOTIFY, _T("Static"), (dat->fTimeFlags&SDWTF_ST_TIME) ? TranslateT("Shutdown at:") : TranslateT("Time left:"),
 +			dat->hwndDesc = CreateWindowEx(WS_EX_NOPARENTNOTIFY, L"Static", (dat->fTimeFlags&SDWTF_ST_TIME) ? TranslateT("Shutdown at:") : TranslateT("Time left:"),
  				WS_CHILD | WS_VISIBLE | SS_LEFTNOWORDWRAP | SS_NOTIFY, GetSystemMetrics(SM_CXICON) + 5, (GetSystemMetrics(SM_CXICON) / 2), 75,
  				(GetSystemMetrics(SM_CXICON) / 2), hwndFrame, NULL, params->hInstance, NULL);
 -			dat->hwndTime = CreateWindowEx(WS_EX_NOPARENTNOTIFY, _T("Static"), NULL, WS_CHILD | WS_VISIBLE | SS_RIGHT | SS_NOTIFY | SS_ENDELLIPSIS,
 +			dat->hwndTime = CreateWindowEx(WS_EX_NOPARENTNOTIFY, L"Static", NULL, WS_CHILD | WS_VISIBLE | SS_RIGHT | SS_NOTIFY | SS_ENDELLIPSIS,
  				(GetSystemMetrics(SM_CXICON) + 80), (GetSystemMetrics(SM_CXICON) / 2), 35, (GetSystemMetrics(SM_CXICON) / 2), hwndFrame, NULL, params->hInstance, NULL);
  			if (dat->hwndTime == NULL)
  				return -1; /* creation failed, calls WM_DESTROY */
 @@ -223,9 +223,9 @@ static LRESULT CALLBACK FrameWndProc(HWND hwndFrame, UINT msg, WPARAM wParam, LP  	case M_REFRESH_COLORS:
  		COLORREF clrBar;
 -		if (FontService_GetColor(_T("Automatic shutdown"), _T("Progress bar"), &clrBar))
 +		if (FontService_GetColor(L"Automatic shutdown", L"Progress bar", &clrBar))
  			clrBar = GetDefaultColor(FRAMEELEMENT_BAR);
 -		if (FontService_GetColor(_T("Automatic shutdown"), _T("Background"), &dat->clrBackground))
 +		if (FontService_GetColor(L"Automatic shutdown", L"Background", &dat->clrBackground))
  			dat->clrBackground = GetDefaultColor(FRAMEELEMENT_BKGRND);
  		if (dat->hbrBackground != NULL) DeleteObject(dat->hbrBackground);
  		dat->hbrBackground = CreateSolidBrush(dat->clrBackground);
 @@ -240,7 +240,7 @@ static LRESULT CALLBACK FrameWndProc(HWND hwndFrame, UINT msg, WPARAM wParam, LP  	case M_REFRESH_FONTS:
  		{
  			LOGFONT lf;
 -			if (!FontService_GetFont(_T("Automatic shutdown"), _T("Countdown on frame"), &dat->clrText, &lf)) {
 +			if (!FontService_GetFont(L"Automatic shutdown", L"Countdown on frame", &dat->clrText, &lf)) {
  				if (dat->hFont != NULL) DeleteObject(dat->hFont);
  				dat->hFont = CreateFontIndirect(&lf);
  			}
 @@ -468,7 +468,7 @@ static LRESULT CALLBACK FrameWndProc(HWND hwndFrame, UINT msg, WPARAM wParam, LP  						if (dat->fTimeFlags&SDWTF_ST_TIME)
  							GetFormatedDateTime(szTime, _countof(szTime), dat->settingLastTime, FALSE);
  						else GetFormatedCountdown(szTime, _countof(szTime), dat->countdown);
 -						mir_sntprintf(ttdi->szText, _T("%s %s"), (dat->fTimeFlags&SDWTF_ST_TIME) ? TranslateT("Shutdown at:") : TranslateT("Time left:"), szTime);
 +						mir_sntprintf(ttdi->szText, L"%s %s", (dat->fTimeFlags&SDWTF_ST_TIME) ? TranslateT("Shutdown at:") : TranslateT("Time left:"), szTime);
  						ttdi->lpszText = ttdi->szText;
  					}
  					return 0;
 diff --git a/plugins/AutoShutdown/src/shutdownsvc.cpp b/plugins/AutoShutdown/src/shutdownsvc.cpp index 33ade1ff2d..7a6dafb468 100644 --- a/plugins/AutoShutdown/src/shutdownsvc.cpp +++ b/plugins/AutoShutdown/src/shutdownsvc.cpp @@ -87,9 +87,9 @@ static BOOL IsShutdownTypeEnabled(BYTE shutdownType)  			DWORD dwSetting, dwSize;
  			/* NoLogOff is BINARY on Win9x/ME and DWORD on Win2000+ */
  			bReturn = TRUE;
 -			if (RegOpenKeyEx(HKEY_CURRENT_USER, _T("Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer"), 0, KEY_QUERY_VALUE, &hKey) == ERROR_SUCCESS) {
 +			if (RegOpenKeyEx(HKEY_CURRENT_USER, L"Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer", 0, KEY_QUERY_VALUE, &hKey) == ERROR_SUCCESS) {
  				dwSize = sizeof(dwSetting);
 -				if (RegQueryValueEx(hKey, _T("NoLogOff"), 0, NULL, (LPBYTE)&dwSetting, &dwSize) == ERROR_SUCCESS)
 +				if (RegQueryValueEx(hKey, L"NoLogOff", 0, NULL, (LPBYTE)&dwSetting, &dwSize) == ERROR_SUCCESS)
  					if (dwSetting) bReturn = FALSE;
  				RegCloseKey(hKey);
  			}
 @@ -101,9 +101,9 @@ static BOOL IsShutdownTypeEnabled(BYTE shutdownType)  			DWORD dwSize, dwSetting;
  			/* DisableLockWorkstation is DWORD on Win2000+ */
  			bReturn = TRUE;
 -			if (RegOpenKeyEx(HKEY_CURRENT_USER, _T("Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\System"), 0, KEY_QUERY_VALUE, &hKey) == ERROR_SUCCESS) {
 +			if (RegOpenKeyEx(HKEY_CURRENT_USER, L"Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\System", 0, KEY_QUERY_VALUE, &hKey) == ERROR_SUCCESS) {
  				dwSize = sizeof(dwSetting);
 -				if (!RegQueryValueEx(hKey, _T("DisableLockWorkstation"), 0, NULL, (LPBYTE)&dwSetting, &dwSize))
 +				if (!RegQueryValueEx(hKey, L"DisableLockWorkstation", 0, NULL, (LPBYTE)&dwSetting, &dwSize))
  					if (dwSetting)
  						bReturn = FALSE;
  				RegCloseKey(hKey);
 diff --git a/plugins/AutoShutdown/src/utils.cpp b/plugins/AutoShutdown/src/utils.cpp index 73aed0d860..4433831a03 100644 --- a/plugins/AutoShutdown/src/utils.cpp +++ b/plugins/AutoShutdown/src/utils.cpp @@ -49,7 +49,7 @@ char* u2a(const WCHAR *pszUnicode)  void TrimString(TCHAR *pszStr)
  {
 -	TCHAR *psz, szChars[] = _T(" \r\n\t");
 +	TCHAR *psz, szChars[] = L" \r\n\t";
  	for (int i = 0; i < _countof(szChars); ++i) {
  		/* trim end */
  		psz = &pszStr[mir_tstrlen(pszStr) - 1];
 @@ -199,7 +199,7 @@ BOOL GetFormatedDateTime(TCHAR *pszOut, int nSize, time_t timestamp, BOOL fShowD  			return FALSE;
  		if (!GetDateFormat(locale, DATE_SHORTDATE, &st, NULL, szDate, _countof(szDate)))
  			return FALSE;
 -		mir_sntprintf(pszOut, nSize, _T("%s %s"), szTime, szDate);
 +		mir_sntprintf(pszOut, nSize, L"%s %s", szTime, szDate);
  		return TRUE;
  	}
  }
  | 
