mirror of
https://github.com/reactos/reactos.git
synced 2025-08-06 12:23:14 +00:00
some small warning fixes
svn path=/trunk/; revision=25189
This commit is contained in:
parent
564debb90d
commit
3b3aadac55
4 changed files with 37 additions and 37 deletions
|
@ -4,7 +4,7 @@
|
||||||
* PROJECT: ReactOS Display Control Panel
|
* PROJECT: ReactOS Display Control Panel
|
||||||
* FILE: lib/cpl/desk/background.c
|
* FILE: lib/cpl/desk/background.c
|
||||||
* PURPOSE: Background property page
|
* PURPOSE: Background property page
|
||||||
*
|
*
|
||||||
* PROGRAMMERS: Trevor McCort (lycan359@gmail.com)
|
* PROGRAMMERS: Trevor McCort (lycan359@gmail.com)
|
||||||
* Alexey Minnekhanov (minlexx@rambler.ru)
|
* Alexey Minnekhanov (minlexx@rambler.ru)
|
||||||
*/
|
*/
|
||||||
|
@ -267,7 +267,7 @@ InitBackgroundDialog(HWND hwndDlg, PGLOBAL_DATA pGlobalData)
|
||||||
SendDlgItemMessage(hwndDlg, IDC_PLACEMENT_COMBO, CB_SETCURSEL, PLACEMENT_CENTER, 0);
|
SendDlgItemMessage(hwndDlg, IDC_PLACEMENT_COMBO, CB_SETCURSEL, PLACEMENT_CENTER, 0);
|
||||||
pGlobalData->placementSelection = PLACEMENT_CENTER;
|
pGlobalData->placementSelection = PLACEMENT_CENTER;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_ttoi(szBuffer) == 2)
|
if (_ttoi(szBuffer) == 2)
|
||||||
{
|
{
|
||||||
SendDlgItemMessage(hwndDlg, IDC_PLACEMENT_COMBO, CB_SETCURSEL, PLACEMENT_STRETCH, 0);
|
SendDlgItemMessage(hwndDlg, IDC_PLACEMENT_COMBO, CB_SETCURSEL, PLACEMENT_STRETCH, 0);
|
||||||
|
@ -292,7 +292,7 @@ InitBackgroundDialog(HWND hwndDlg, PGLOBAL_DATA pGlobalData)
|
||||||
|
|
||||||
RegCloseKey(regKey);
|
RegCloseKey(regKey);
|
||||||
|
|
||||||
pGlobalData->hBitmap = LoadImage(hApplet, MAKEINTRESOURCE(IDC_MONITOR), IMAGE_BITMAP, 0, 0, LR_LOADTRANSPARENT);
|
pGlobalData->hBitmap = (HBITMAP) LoadImage(hApplet, MAKEINTRESOURCE(IDC_MONITOR), IMAGE_BITMAP, 0, 0, LR_LOADTRANSPARENT);
|
||||||
if (pGlobalData->hBitmap != NULL)
|
if (pGlobalData->hBitmap != NULL)
|
||||||
{
|
{
|
||||||
GetObject(pGlobalData->hBitmap, sizeof(BITMAP), &bitmap);
|
GetObject(pGlobalData->hBitmap, sizeof(BITMAP), &bitmap);
|
||||||
|
@ -408,7 +408,7 @@ OnBrowseButton(HWND hwndDlg, PGLOBAL_DATA pGlobalData)
|
||||||
|
|
||||||
LoadString(hApplet, IDS_BACKGROUND_COMDLG_FILTER, filter, sizeof(filter) / sizeof(TCHAR));
|
LoadString(hApplet, IDS_BACKGROUND_COMDLG_FILTER, filter, sizeof(filter) / sizeof(TCHAR));
|
||||||
|
|
||||||
/* Set lpstrFile[0] to '\0' so that GetOpenFileName does not
|
/* Set lpstrFile[0] to '\0' so that GetOpenFileName does not
|
||||||
* use the contents of szFile to initialize itself */
|
* use the contents of szFile to initialize itself */
|
||||||
ofn.lpstrFile[0] = TEXT('\0');
|
ofn.lpstrFile[0] = TEXT('\0');
|
||||||
ofn.nMaxFile = MAX_PATH;
|
ofn.nMaxFile = MAX_PATH;
|
||||||
|
@ -623,7 +623,7 @@ SetWallpaper(PGLOBAL_DATA pGlobalData)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
SystemParametersInfo(SPI_SETDESKWALLPAPER, 0, TEXT(""), SPIF_UPDATEINIFILE);
|
SystemParametersInfo(SPI_SETDESKWALLPAPER, 0, (void*) TEXT(""), SPIF_UPDATEINIFILE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -648,7 +648,7 @@ SetDesktopBackColor(HWND hwndDlg, PGLOBAL_DATA pGlobalData)
|
||||||
if( result != ERROR_SUCCESS )
|
if( result != ERROR_SUCCESS )
|
||||||
{
|
{
|
||||||
/* Key open failed; maybe it does not exist? create it! */
|
/* Key open failed; maybe it does not exist? create it! */
|
||||||
result = RegCreateKeyEx( HKEY_CURRENT_USER, TEXT("Control Panel\\Colors"), 0, NULL, 0,
|
result = RegCreateKeyEx( HKEY_CURRENT_USER, TEXT("Control Panel\\Colors"), 0, NULL, 0,
|
||||||
KEY_ALL_ACCESS, NULL, &hKey, NULL );
|
KEY_ALL_ACCESS, NULL, &hKey, NULL );
|
||||||
/* Now key must be created and opened and hKey must point at newly created key */
|
/* Now key must be created and opened and hKey must point at newly created key */
|
||||||
/* On error result will not contain ERROR_SUCCESS. I don't know how to handle */
|
/* On error result will not contain ERROR_SUCCESS. I don't know how to handle */
|
||||||
|
@ -676,7 +676,7 @@ BackgroundPageProc(HWND hwndDlg,
|
||||||
switch (uMsg)
|
switch (uMsg)
|
||||||
{
|
{
|
||||||
case WM_INITDIALOG:
|
case WM_INITDIALOG:
|
||||||
pGlobalData = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(GLOBAL_DATA));
|
pGlobalData = (GLOBAL_DATA*) HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(GLOBAL_DATA));
|
||||||
SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)pGlobalData);
|
SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)pGlobalData);
|
||||||
InitBackgroundDialog(hwndDlg, pGlobalData);
|
InitBackgroundDialog(hwndDlg, pGlobalData);
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -133,15 +133,15 @@ POWER_ACTION GetPowerActionFromPolicy(POWER_ACTION_POLICY * Policy)
|
||||||
/*
|
/*
|
||||||
|
|
||||||
TCHAR szBuffer[MAX_PATH];
|
TCHAR szBuffer[MAX_PATH];
|
||||||
|
|
||||||
// Note: Windows XP SP2+ does not return the PowerAction code
|
// Note: Windows XP SP2+ does not return the PowerAction code
|
||||||
// for PowerActionWarmEject + PowerActionShutdown but sets it
|
// for PowerActionWarmEject + PowerActionShutdown but sets it
|
||||||
// to PowerActionNone and sets the Flags & EventCode
|
// to PowerActionNone and sets the Flags & EventCode
|
||||||
|
|
||||||
|
|
||||||
_stprintf(szBuffer, L"Action: %x EventCode %x Flags %x",Policy->Action, Policy->EventCode, Policy->Flags);
|
_stprintf(szBuffer, L"Action: %x EventCode %x Flags %x",Policy->Action, Policy->EventCode, Policy->Flags);
|
||||||
MessageBoxW(NULL, szBuffer, NULL, MB_OK);
|
MessageBoxW(NULL, szBuffer, NULL, MB_OK);
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (Policy->Action == PowerActionNone)
|
if (Policy->Action == PowerActionNone)
|
||||||
|
@ -166,13 +166,13 @@ POWER_ACTION GetPowerActionFromPolicy(POWER_ACTION_POLICY * Policy)
|
||||||
{
|
{
|
||||||
poAction = Policy->Action;
|
poAction = Policy->Action;
|
||||||
}
|
}
|
||||||
|
|
||||||
return poAction;
|
return poAction;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ShowCurrentPowerActionPolicy(HWND hDlgCtrl,
|
void ShowCurrentPowerActionPolicy(HWND hDlgCtrl,
|
||||||
POWER_ACTION * lpAction,
|
POWER_ACTION * lpAction,
|
||||||
DWORD dwActionSize,
|
DWORD dwActionSize,
|
||||||
POWER_ACTION_POLICY * Policy)
|
POWER_ACTION_POLICY * Policy)
|
||||||
{
|
{
|
||||||
int poActionIndex;
|
int poActionIndex;
|
||||||
|
@ -243,9 +243,9 @@ void ShowCurrentPowerActionPolicies(HWND hwndDlg)
|
||||||
{
|
{
|
||||||
#if 0
|
#if 0
|
||||||
/* expiremental code */
|
/* expiremental code */
|
||||||
// ShowCurrentPowerButtonAcAction(hList2,
|
// ShowCurrentPowerButtonAcAction(hList2,
|
||||||
ShowCurrentPowerActionPolicy(GetDlgItem(hwndDlg, IDC_POWERBUTTON),
|
ShowCurrentPowerActionPolicy(GetDlgItem(hwndDlg, IDC_POWERBUTTON),
|
||||||
g_SystemBatteries,
|
g_SystemBatteries,
|
||||||
sizeof(g_SystemBatteries) / sizeof(POWER_ACTION),
|
sizeof(g_SystemBatteries) / sizeof(POWER_ACTION),
|
||||||
&gGPP.user.LidCloseAc);
|
&gGPP.user.LidCloseAc);
|
||||||
#else
|
#else
|
||||||
|
@ -257,15 +257,15 @@ void ShowCurrentPowerActionPolicies(HWND hwndDlg)
|
||||||
(LPARAM)szAction);
|
(LPARAM)szAction);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
ShowCurrentPowerActionPolicy(GetDlgItem(hwndDlg, IDC_POWERBUTTON),
|
ShowCurrentPowerActionPolicy(GetDlgItem(hwndDlg, IDC_POWERBUTTON),
|
||||||
g_PowerButton,
|
g_PowerButton,
|
||||||
sizeof(g_PowerButton) / sizeof(POWER_ACTION),
|
sizeof(g_PowerButton) / sizeof(POWER_ACTION),
|
||||||
&gGPP.user.PowerButtonAc);
|
&gGPP.user.PowerButtonAc);
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
/* expiremental code */
|
/* expiremental code */
|
||||||
ShowCurrentPowerActionPolicy(GetDlgItem(hwndDlg, IDC_SLEEPBUTTON),
|
ShowCurrentPowerActionPolicy(GetDlgItem(hwndDlg, IDC_SLEEPBUTTON),
|
||||||
g_SleepButton,
|
g_SleepButton,
|
||||||
sizeof(g_SleepButton) / sizeof(POWER_ACTION),
|
sizeof(g_SleepButton) / sizeof(POWER_ACTION),
|
||||||
&gGPP.user.SleepButtonAc);
|
&gGPP.user.SleepButtonAc);
|
||||||
#else
|
#else
|
||||||
|
@ -282,18 +282,18 @@ void ShowCurrentPowerActionPolicies(HWND hwndDlg)
|
||||||
{
|
{
|
||||||
#if 0
|
#if 0
|
||||||
|
|
||||||
ShowCurrentPowerActionPolicy(GetDlgItem(hwndDlg, IDC_LIDCLOSE),
|
ShowCurrentPowerActionPolicy(GetDlgItem(hwndDlg, IDC_LIDCLOSE),
|
||||||
g_SleepButton,
|
g_SleepButton,
|
||||||
sizeof(g_SleepButton) / sizeof(POWER_ACTION),
|
sizeof(g_SleepButton) / sizeof(POWER_ACTION),
|
||||||
&gGPP.user.LidCloseDc);
|
&gGPP.user.LidCloseDc);
|
||||||
|
|
||||||
ShowCurrentPowerActionPolicy(GetDlgItem(hwndDlg, IDC_POWERBUTTON),
|
ShowCurrentPowerActionPolicy(GetDlgItem(hwndDlg, IDC_POWERBUTTON),
|
||||||
g_SleepButton,
|
g_SleepButton,
|
||||||
sizeof(g_SleepButton) / sizeof(POWER_ACTION),
|
sizeof(g_SleepButton) / sizeof(POWER_ACTION),
|
||||||
&gGPP.user.PowerButtonDc);
|
&gGPP.user.PowerButtonDc);
|
||||||
|
|
||||||
ShowCurrentPowerActionPolicy(GetDlgItem(hwndDlg, IDC_SLEEPBUTTON),
|
ShowCurrentPowerActionPolicy(GetDlgItem(hwndDlg, IDC_SLEEPBUTTON),
|
||||||
g_SleepButton,
|
g_SleepButton,
|
||||||
sizeof(g_SleepButton) / sizeof(POWER_ACTION),
|
sizeof(g_SleepButton) / sizeof(POWER_ACTION),
|
||||||
&gGPP.user.SleepButtonDc);
|
&gGPP.user.SleepButtonDc);
|
||||||
#else
|
#else
|
||||||
|
@ -318,7 +318,7 @@ void ShowCurrentPowerActionPolicies(HWND hwndDlg)
|
||||||
TRUE,
|
TRUE,
|
||||||
(LPARAM)szAction);
|
(LPARAM)szAction);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -358,7 +358,7 @@ void Adv_InitDialog()
|
||||||
hList1 = GetDlgItem(hAdv, IDC_LIDCLOSE);
|
hList1 = GetDlgItem(hAdv, IDC_LIDCLOSE);
|
||||||
SendMessage(hList1, CB_RESETCONTENT, 0, 0);
|
SendMessage(hList1, CB_RESETCONTENT, 0, 0);
|
||||||
|
|
||||||
memset(g_SystemBatteries, 0x0, sizeof(g_SystemBatteries));
|
memset(g_SystemBatteries, 0x0, sizeof(g_SystemBatteries));
|
||||||
if (spc.SystemBatteriesPresent)
|
if (spc.SystemBatteriesPresent)
|
||||||
{
|
{
|
||||||
AddItem(hList1, IDS_PowerActionNone1, (LPARAM)PowerActionNone, g_SystemBatteries);
|
AddItem(hList1, IDS_PowerActionNone1, (LPARAM)PowerActionNone, g_SystemBatteries);
|
||||||
|
@ -417,7 +417,7 @@ void Adv_InitDialog()
|
||||||
{
|
{
|
||||||
AddItem(hList3, IDS_PowerActionNone1, (LPARAM)PowerActionNone, g_SleepButton);
|
AddItem(hList3, IDS_PowerActionNone1, (LPARAM)PowerActionNone, g_SleepButton);
|
||||||
AddItem(hList3, IDS_PowerActionWarmEject, (LPARAM)PowerActionWarmEject, g_SleepButton);
|
AddItem(hList3, IDS_PowerActionWarmEject, (LPARAM)PowerActionWarmEject, g_SleepButton);
|
||||||
|
|
||||||
if (bSuspend)
|
if (bSuspend)
|
||||||
{
|
{
|
||||||
AddItem(hList3, IDS_PowerActionSleep, (LPARAM)PowerActionSleep, g_SleepButton);
|
AddItem(hList3, IDS_PowerActionSleep, (LPARAM)PowerActionSleep, g_SleepButton);
|
||||||
|
@ -464,7 +464,7 @@ void Adv_SaveData(HWND hwndDlg)
|
||||||
BM_GETCHECK,
|
BM_GETCHECK,
|
||||||
(WPARAM)0,
|
(WPARAM)0,
|
||||||
(LPARAM)0);
|
(LPARAM)0);
|
||||||
|
|
||||||
if (bSystrayBatteryMeter)
|
if (bSystrayBatteryMeter)
|
||||||
{
|
{
|
||||||
if (!(gGPP.user.GlobalFlags & EnableSysTrayBatteryMeter))
|
if (!(gGPP.user.GlobalFlags & EnableSysTrayBatteryMeter))
|
||||||
|
@ -529,5 +529,5 @@ void Adv_SaveData(HWND hwndDlg)
|
||||||
MessageBox(hwndDlg, L"WriteGlobalPwrPolicy failed", NULL, MB_OK);
|
MessageBox(hwndDlg, L"WriteGlobalPwrPolicy failed", NULL, MB_OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
Adv_InitDialog(hwndDlg);
|
Adv_InitDialog();
|
||||||
}
|
}
|
||||||
|
|
|
@ -176,7 +176,7 @@ GetNTPServerAddress(LPSTR* lpAddress)
|
||||||
&dwSize);
|
&dwSize);
|
||||||
if (Ret == ERROR_MORE_DATA)
|
if (Ret == ERROR_MORE_DATA)
|
||||||
{
|
{
|
||||||
buf = HeapAlloc(GetProcessHeap(),
|
buf = (LPWSTR) HeapAlloc(GetProcessHeap(),
|
||||||
0,
|
0,
|
||||||
dwSize);
|
dwSize);
|
||||||
if (buf == NULL)
|
if (buf == NULL)
|
||||||
|
@ -200,7 +200,7 @@ GetNTPServerAddress(LPSTR* lpAddress)
|
||||||
|
|
||||||
/* We still allocate same amount of space for ASCII storage,
|
/* We still allocate same amount of space for ASCII storage,
|
||||||
* as some chars may use several bytes */
|
* as some chars may use several bytes */
|
||||||
*lpAddress = HeapAlloc(GetProcessHeap(),
|
*lpAddress = (LPSTR) HeapAlloc(GetProcessHeap(),
|
||||||
0,
|
0,
|
||||||
sizeof(dwSize));
|
sizeof(dwSize));
|
||||||
if (*lpAddress == NULL)
|
if (*lpAddress == NULL)
|
||||||
|
|
|
@ -1006,7 +1006,7 @@ MonthCalWndProc(IN HWND hwnd,
|
||||||
|
|
||||||
case WM_CREATE:
|
case WM_CREATE:
|
||||||
{
|
{
|
||||||
infoPtr = HeapAlloc(GetProcessHeap(),
|
infoPtr = (MONTHCALWND*) HeapAlloc(GetProcessHeap(),
|
||||||
0,
|
0,
|
||||||
sizeof(MONTHCALWND));
|
sizeof(MONTHCALWND));
|
||||||
if (infoPtr == NULL)
|
if (infoPtr == NULL)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue