mirror of
https://github.com/reactos/reactos.git
synced 2024-08-19 18:02:55 +00:00
[FORMATTING] Use a consistent indentation (TABs) for all parts of sysdm.cpl
No code changes svn path=/trunk/; revision=27785
This commit is contained in:
parent
b17938545b
commit
e2cb9802d4
|
@ -15,72 +15,71 @@ static TCHAR BugLink[] = _T("http://www.reactos.org/bugzilla");
|
|||
/* Property page dialog callback */
|
||||
INT_PTR CALLBACK
|
||||
AdvancedPageProc(HWND hwndDlg,
|
||||
UINT uMsg,
|
||||
WPARAM wParam,
|
||||
LPARAM lParam)
|
||||
UINT uMsg,
|
||||
WPARAM wParam,
|
||||
LPARAM lParam)
|
||||
{
|
||||
UNREFERENCED_PARAMETER(lParam);
|
||||
UNREFERENCED_PARAMETER(lParam);
|
||||
|
||||
switch (uMsg)
|
||||
{
|
||||
case WM_INITDIALOG:
|
||||
break;
|
||||
switch (uMsg)
|
||||
{
|
||||
case WM_INITDIALOG:
|
||||
break;
|
||||
|
||||
case WM_COMMAND:
|
||||
{
|
||||
switch(LOWORD(wParam))
|
||||
{
|
||||
case IDC_PERFOR:
|
||||
{
|
||||
DialogBox(hApplet,
|
||||
MAKEINTRESOURCE(IDD_VIRTMEM),
|
||||
hwndDlg,
|
||||
(DLGPROC)VirtMemDlgProc);
|
||||
}
|
||||
break;
|
||||
case WM_COMMAND:
|
||||
{
|
||||
switch(LOWORD(wParam))
|
||||
{
|
||||
case IDC_PERFOR:
|
||||
{
|
||||
DialogBox(hApplet,
|
||||
MAKEINTRESOURCE(IDD_VIRTMEM),
|
||||
hwndDlg,
|
||||
(DLGPROC)VirtMemDlgProc);
|
||||
}
|
||||
break;
|
||||
|
||||
case IDC_USERPROFILE:
|
||||
{
|
||||
DialogBox(hApplet,
|
||||
MAKEINTRESOURCE(IDD_USERPROFILE),
|
||||
hwndDlg,
|
||||
(DLGPROC)UserProfileDlgProc);
|
||||
}
|
||||
break;
|
||||
case IDC_USERPROFILE:
|
||||
{
|
||||
DialogBox(hApplet,
|
||||
MAKEINTRESOURCE(IDD_USERPROFILE),
|
||||
hwndDlg,
|
||||
(DLGPROC)UserProfileDlgProc);
|
||||
}
|
||||
break;
|
||||
|
||||
case IDC_STAREC:
|
||||
{
|
||||
DialogBox(hApplet,
|
||||
MAKEINTRESOURCE(IDD_STARTUPRECOVERY),
|
||||
hwndDlg,
|
||||
(DLGPROC)StartRecDlgProc);
|
||||
}
|
||||
break;
|
||||
case IDC_STAREC:
|
||||
{
|
||||
DialogBox(hApplet,
|
||||
MAKEINTRESOURCE(IDD_STARTUPRECOVERY),
|
||||
hwndDlg,
|
||||
(DLGPROC)StartRecDlgProc);
|
||||
}
|
||||
break;
|
||||
|
||||
case IDC_ENVVAR:
|
||||
{
|
||||
DialogBox(hApplet,
|
||||
MAKEINTRESOURCE(IDD_ENVIRONMENT_VARIABLES),
|
||||
hwndDlg,
|
||||
(DLGPROC)EnvironmentDlgProc);
|
||||
}
|
||||
break;
|
||||
case IDC_ENVVAR:
|
||||
{
|
||||
DialogBox(hApplet,
|
||||
MAKEINTRESOURCE(IDD_ENVIRONMENT_VARIABLES),
|
||||
hwndDlg,
|
||||
(DLGPROC)EnvironmentDlgProc);
|
||||
}
|
||||
break;
|
||||
|
||||
case IDC_ERRORREPORT:
|
||||
{
|
||||
ShellExecute(NULL,
|
||||
_T("open"),
|
||||
BugLink,
|
||||
NULL,
|
||||
NULL,
|
||||
SW_SHOWNORMAL);
|
||||
}
|
||||
break;
|
||||
case IDC_ERRORREPORT:
|
||||
{
|
||||
ShellExecute(NULL,
|
||||
_T("open"),
|
||||
BugLink,
|
||||
NULL,
|
||||
NULL,
|
||||
SW_SHOWNORMAL);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
return FALSE;
|
||||
break;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -14,60 +14,60 @@
|
|||
|
||||
typedef struct _IMGINFO
|
||||
{
|
||||
HBITMAP hBitmap;
|
||||
INT cxSource;
|
||||
INT cySource;
|
||||
HBITMAP hBitmap;
|
||||
INT cxSource;
|
||||
INT cySource;
|
||||
} IMGINFO, *PIMGINFO;
|
||||
|
||||
|
||||
void
|
||||
ShowLastWin32Error(HWND hWndOwner)
|
||||
{
|
||||
LPTSTR lpMsg;
|
||||
DWORD LastError;
|
||||
LPTSTR lpMsg;
|
||||
DWORD LastError;
|
||||
|
||||
LastError = GetLastError();
|
||||
LastError = GetLastError();
|
||||
|
||||
if((LastError == 0) ||
|
||||
!FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER |
|
||||
FORMAT_MESSAGE_FROM_SYSTEM,
|
||||
NULL,
|
||||
LastError,
|
||||
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
|
||||
(LPTSTR)&lpMsg,
|
||||
0,
|
||||
NULL))
|
||||
{
|
||||
return;
|
||||
}
|
||||
if((LastError == 0) ||
|
||||
!FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER |
|
||||
FORMAT_MESSAGE_FROM_SYSTEM,
|
||||
NULL,
|
||||
LastError,
|
||||
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
|
||||
(LPTSTR)&lpMsg,
|
||||
0,
|
||||
NULL))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
MessageBox(hWndOwner, lpMsg, NULL, MB_OK | MB_ICONERROR);
|
||||
MessageBox(hWndOwner, lpMsg, NULL, MB_OK | MB_ICONERROR);
|
||||
|
||||
LocalFree((LPVOID)lpMsg);
|
||||
LocalFree((LPVOID)lpMsg);
|
||||
}
|
||||
|
||||
|
||||
static VOID
|
||||
InitImageInfo(PIMGINFO ImgInfo)
|
||||
{
|
||||
BITMAP bitmap;
|
||||
BITMAP bitmap;
|
||||
|
||||
ZeroMemory(ImgInfo, sizeof(*ImgInfo));
|
||||
ZeroMemory(ImgInfo, sizeof(*ImgInfo));
|
||||
|
||||
ImgInfo->hBitmap = LoadImage(hApplet,
|
||||
MAKEINTRESOURCE(IDB_ROSBMP),
|
||||
IMAGE_BITMAP,
|
||||
0,
|
||||
0,
|
||||
LR_DEFAULTCOLOR);
|
||||
ImgInfo->hBitmap = LoadImage(hApplet,
|
||||
MAKEINTRESOURCE(IDB_ROSBMP),
|
||||
IMAGE_BITMAP,
|
||||
0,
|
||||
0,
|
||||
LR_DEFAULTCOLOR);
|
||||
|
||||
if (ImgInfo->hBitmap != NULL)
|
||||
{
|
||||
GetObject(ImgInfo->hBitmap, sizeof(BITMAP), &bitmap);
|
||||
if (ImgInfo->hBitmap != NULL)
|
||||
{
|
||||
GetObject(ImgInfo->hBitmap, sizeof(BITMAP), &bitmap);
|
||||
|
||||
ImgInfo->cxSource = bitmap.bmWidth;
|
||||
ImgInfo->cySource = bitmap.bmHeight;
|
||||
}
|
||||
ImgInfo->cxSource = bitmap.bmWidth;
|
||||
ImgInfo->cySource = bitmap.bmHeight;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -77,38 +77,38 @@ SetRegTextData(HWND hwnd,
|
|||
LPTSTR Value,
|
||||
UINT uID)
|
||||
{
|
||||
LPTSTR lpBuf = NULL;
|
||||
DWORD BufSize = 0;
|
||||
DWORD Type;
|
||||
LPTSTR lpBuf = NULL;
|
||||
DWORD BufSize = 0;
|
||||
DWORD Type;
|
||||
|
||||
if (RegQueryValueEx(hKey,
|
||||
Value,
|
||||
NULL,
|
||||
&Type,
|
||||
NULL,
|
||||
&BufSize) == ERROR_SUCCESS)
|
||||
{
|
||||
lpBuf = HeapAlloc(GetProcessHeap(),
|
||||
0,
|
||||
BufSize);
|
||||
if (!lpBuf) return;
|
||||
if (RegQueryValueEx(hKey,
|
||||
Value,
|
||||
NULL,
|
||||
&Type,
|
||||
NULL,
|
||||
&BufSize) == ERROR_SUCCESS)
|
||||
{
|
||||
lpBuf = HeapAlloc(GetProcessHeap(),
|
||||
0,
|
||||
BufSize);
|
||||
if (!lpBuf) return;
|
||||
|
||||
if (RegQueryValueEx(hKey,
|
||||
Value,
|
||||
NULL,
|
||||
&Type,
|
||||
(PBYTE)lpBuf,
|
||||
&BufSize) == ERROR_SUCCESS)
|
||||
{
|
||||
SetDlgItemText(hwnd,
|
||||
uID,
|
||||
lpBuf);
|
||||
}
|
||||
if (RegQueryValueEx(hKey,
|
||||
Value,
|
||||
NULL,
|
||||
&Type,
|
||||
(PBYTE)lpBuf,
|
||||
&BufSize) == ERROR_SUCCESS)
|
||||
{
|
||||
SetDlgItemText(hwnd,
|
||||
uID,
|
||||
lpBuf);
|
||||
}
|
||||
|
||||
HeapFree(GetProcessHeap(),
|
||||
0,
|
||||
lpBuf);
|
||||
}
|
||||
HeapFree(GetProcessHeap(),
|
||||
0,
|
||||
lpBuf);
|
||||
}
|
||||
}
|
||||
|
||||
static INT
|
||||
|
@ -207,145 +207,145 @@ SetProcSpeed(HWND hwnd,
|
|||
UINT uID)
|
||||
|
||||
{
|
||||
TCHAR szBuf[64];
|
||||
DWORD BufSize = sizeof(DWORD);
|
||||
DWORD Type = REG_SZ;
|
||||
PROCESSOR_POWER_INFORMATION ppi;
|
||||
TCHAR szBuf[64];
|
||||
DWORD BufSize = sizeof(DWORD);
|
||||
DWORD Type = REG_SZ;
|
||||
PROCESSOR_POWER_INFORMATION ppi;
|
||||
|
||||
ZeroMemory(&ppi,
|
||||
sizeof(ppi));
|
||||
ZeroMemory(&ppi,
|
||||
sizeof(ppi));
|
||||
|
||||
if ((CallNtPowerInformation(ProcessorInformation,
|
||||
NULL,
|
||||
0,
|
||||
(PVOID)&ppi,
|
||||
sizeof(ppi)) == STATUS_SUCCESS &&
|
||||
ppi.CurrentMhz != 0) ||
|
||||
RegQueryValueEx(hKey,
|
||||
Value,
|
||||
NULL,
|
||||
&Type,
|
||||
(PBYTE)&ppi.CurrentMhz,
|
||||
&BufSize) == ERROR_SUCCESS)
|
||||
{
|
||||
if (ppi.CurrentMhz < 1000)
|
||||
{
|
||||
_stprintf(szBuf, _T("%lu MHz"), ppi.CurrentMhz);
|
||||
}
|
||||
else
|
||||
{
|
||||
double flt = ppi.CurrentMhz / 1000.0;
|
||||
_stprintf(szBuf, _T("%.2f GHz"), flt);
|
||||
}
|
||||
if ((CallNtPowerInformation(ProcessorInformation,
|
||||
NULL,
|
||||
0,
|
||||
(PVOID)&ppi,
|
||||
sizeof(ppi)) == STATUS_SUCCESS &&
|
||||
ppi.CurrentMhz != 0) ||
|
||||
RegQueryValueEx(hKey,
|
||||
Value,
|
||||
NULL,
|
||||
&Type,
|
||||
(PBYTE)&ppi.CurrentMhz,
|
||||
&BufSize) == ERROR_SUCCESS)
|
||||
{
|
||||
if (ppi.CurrentMhz < 1000)
|
||||
{
|
||||
_stprintf(szBuf, _T("%lu MHz"), ppi.CurrentMhz);
|
||||
}
|
||||
else
|
||||
{
|
||||
double flt = ppi.CurrentMhz / 1000.0;
|
||||
_stprintf(szBuf, _T("%.2f GHz"), flt);
|
||||
}
|
||||
|
||||
SetDlgItemText(hwnd,
|
||||
uID,
|
||||
szBuf);
|
||||
}
|
||||
SetDlgItemText(hwnd,
|
||||
uID,
|
||||
szBuf);
|
||||
}
|
||||
}
|
||||
|
||||
static VOID
|
||||
GetSystemInformation(HWND hwnd)
|
||||
{
|
||||
HKEY hKey;
|
||||
TCHAR ProcKey[] = _T("HARDWARE\\DESCRIPTION\\System\\CentralProcessor\\0");
|
||||
MEMORYSTATUSEX MemStat;
|
||||
TCHAR Buf[32];
|
||||
INT Ret = 0;
|
||||
INT CurMachineLine = IDC_MACHINELINE1;
|
||||
HKEY hKey;
|
||||
TCHAR ProcKey[] = _T("HARDWARE\\DESCRIPTION\\System\\CentralProcessor\\0");
|
||||
MEMORYSTATUSEX MemStat;
|
||||
TCHAR Buf[32];
|
||||
INT Ret = 0;
|
||||
INT CurMachineLine = IDC_MACHINELINE1;
|
||||
|
||||
|
||||
/* Get Processor information *
|
||||
* although undocumented, this information is being pulled
|
||||
* directly out of the registry instead of via setupapi as it
|
||||
* contains all the info we need, and should remain static
|
||||
*/
|
||||
if (RegOpenKeyEx(HKEY_LOCAL_MACHINE,
|
||||
ProcKey,
|
||||
0,
|
||||
KEY_READ,
|
||||
&hKey) == ERROR_SUCCESS)
|
||||
{
|
||||
SetRegTextData(hwnd,
|
||||
hKey,
|
||||
_T("VendorIdentifier"),
|
||||
CurMachineLine);
|
||||
CurMachineLine++;
|
||||
/* Get Processor information *
|
||||
* although undocumented, this information is being pulled
|
||||
* directly out of the registry instead of via setupapi as it
|
||||
* contains all the info we need, and should remain static
|
||||
*/
|
||||
if (RegOpenKeyEx(HKEY_LOCAL_MACHINE,
|
||||
ProcKey,
|
||||
0,
|
||||
KEY_READ,
|
||||
&hKey) == ERROR_SUCCESS)
|
||||
{
|
||||
SetRegTextData(hwnd,
|
||||
hKey,
|
||||
_T("VendorIdentifier"),
|
||||
CurMachineLine);
|
||||
CurMachineLine++;
|
||||
|
||||
Ret = SetProcNameString(hwnd,
|
||||
hKey,
|
||||
_T("ProcessorNameString"),
|
||||
CurMachineLine,
|
||||
CurMachineLine+1);
|
||||
CurMachineLine += Ret;
|
||||
Ret = SetProcNameString(hwnd,
|
||||
hKey,
|
||||
_T("ProcessorNameString"),
|
||||
CurMachineLine,
|
||||
CurMachineLine+1);
|
||||
CurMachineLine += Ret;
|
||||
|
||||
SetProcSpeed(hwnd,
|
||||
hKey,
|
||||
_T("~MHz"),
|
||||
CurMachineLine);
|
||||
CurMachineLine++;
|
||||
}
|
||||
SetProcSpeed(hwnd,
|
||||
hKey,
|
||||
_T("~MHz"),
|
||||
CurMachineLine);
|
||||
CurMachineLine++;
|
||||
}
|
||||
|
||||
|
||||
/* Get total physical RAM */
|
||||
MemStat.dwLength = sizeof(MemStat);
|
||||
if (GlobalMemoryStatusEx(&MemStat))
|
||||
{
|
||||
TCHAR szStr[32];
|
||||
double dTotalPhys;
|
||||
UINT i = 0;
|
||||
static const UINT uStrId[] = {
|
||||
IDS_MEGABYTE,
|
||||
IDS_GIGABYTE,
|
||||
IDS_TERABYTE,
|
||||
IDS_PETABYTE
|
||||
};
|
||||
/* Get total physical RAM */
|
||||
MemStat.dwLength = sizeof(MemStat);
|
||||
if (GlobalMemoryStatusEx(&MemStat))
|
||||
{
|
||||
TCHAR szStr[32];
|
||||
double dTotalPhys;
|
||||
UINT i = 0;
|
||||
static const UINT uStrId[] = {
|
||||
IDS_MEGABYTE,
|
||||
IDS_GIGABYTE,
|
||||
IDS_TERABYTE,
|
||||
IDS_PETABYTE
|
||||
};
|
||||
|
||||
if (MemStat.ullTotalPhys > 1024 * 1024 * 1024)
|
||||
{
|
||||
/* We're dealing with GBs or more */
|
||||
MemStat.ullTotalPhys /= 1024 * 1024;
|
||||
i++;
|
||||
if (MemStat.ullTotalPhys > 1024 * 1024 * 1024)
|
||||
{
|
||||
/* We're dealing with GBs or more */
|
||||
MemStat.ullTotalPhys /= 1024 * 1024;
|
||||
i++;
|
||||
|
||||
if (MemStat.ullTotalPhys > 1024 * 1024)
|
||||
{
|
||||
/* We're dealing with TBs or more */
|
||||
MemStat.ullTotalPhys /= 1024;
|
||||
i++;
|
||||
if (MemStat.ullTotalPhys > 1024 * 1024)
|
||||
{
|
||||
/* We're dealing with TBs or more */
|
||||
MemStat.ullTotalPhys /= 1024;
|
||||
i++;
|
||||
|
||||
if (MemStat.ullTotalPhys > 1024 * 1024)
|
||||
{
|
||||
/* We're dealing with PBs or more */
|
||||
if (MemStat.ullTotalPhys > 1024 * 1024)
|
||||
{
|
||||
/* We're dealing with PBs or more */
|
||||
|
||||
MemStat.ullTotalPhys /= 1024;
|
||||
i++;
|
||||
MemStat.ullTotalPhys /= 1024;
|
||||
i++;
|
||||
|
||||
dTotalPhys = (double)MemStat.ullTotalPhys / 1024;
|
||||
}
|
||||
else
|
||||
dTotalPhys = (double)MemStat.ullTotalPhys / 1024;
|
||||
}
|
||||
else
|
||||
dTotalPhys = (double)MemStat.ullTotalPhys / 1024;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* We're daling with MBs */
|
||||
dTotalPhys = (double)MemStat.ullTotalPhys / 1024 / 1024;
|
||||
}
|
||||
dTotalPhys = (double)MemStat.ullTotalPhys / 1024;
|
||||
}
|
||||
else
|
||||
dTotalPhys = (double)MemStat.ullTotalPhys / 1024;
|
||||
}
|
||||
else
|
||||
dTotalPhys = (double)MemStat.ullTotalPhys / 1024;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* We're daling with MBs */
|
||||
dTotalPhys = (double)MemStat.ullTotalPhys / 1024 / 1024;
|
||||
}
|
||||
|
||||
if (LoadString(hApplet, uStrId[i], szStr, sizeof(szStr) / sizeof(szStr[0])))
|
||||
{
|
||||
Ret = _stprintf(Buf, _T("%.2f %s"), dTotalPhys, szStr);
|
||||
}
|
||||
}
|
||||
if (LoadString(hApplet, uStrId[i], szStr, sizeof(szStr) / sizeof(szStr[0])))
|
||||
{
|
||||
Ret = _stprintf(Buf, _T("%.2f %s"), dTotalPhys, szStr);
|
||||
}
|
||||
}
|
||||
|
||||
if (Ret)
|
||||
{
|
||||
SetDlgItemText(hwnd,
|
||||
CurMachineLine,
|
||||
Buf);
|
||||
}
|
||||
if (Ret)
|
||||
{
|
||||
SetDlgItemText(hwnd,
|
||||
CurMachineLine,
|
||||
Buf);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -356,89 +356,84 @@ GeneralPageProc(HWND hwndDlg,
|
|||
WPARAM wParam,
|
||||
LPARAM lParam)
|
||||
{
|
||||
static IMGINFO ImgInfo;
|
||||
static IMGINFO ImgInfo;
|
||||
|
||||
UNREFERENCED_PARAMETER(lParam);
|
||||
UNREFERENCED_PARAMETER(wParam);
|
||||
UNREFERENCED_PARAMETER(lParam);
|
||||
UNREFERENCED_PARAMETER(wParam);
|
||||
|
||||
switch(uMsg)
|
||||
{
|
||||
case WM_INITDIALOG:
|
||||
{
|
||||
InitImageInfo(&ImgInfo);
|
||||
GetSystemInformation(hwndDlg);
|
||||
}
|
||||
break;
|
||||
switch(uMsg)
|
||||
{
|
||||
case WM_INITDIALOG:
|
||||
{
|
||||
InitImageInfo(&ImgInfo);
|
||||
GetSystemInformation(hwndDlg);
|
||||
}
|
||||
break;
|
||||
|
||||
case WM_COMMAND:
|
||||
{
|
||||
if (LOWORD(wParam) == IDC_LICENCE)
|
||||
{
|
||||
DialogBox(hApplet,
|
||||
MAKEINTRESOURCE(IDD_LICENCE),
|
||||
hwndDlg,
|
||||
LicenceDlgProc);
|
||||
case WM_COMMAND:
|
||||
{
|
||||
if (LOWORD(wParam) == IDC_LICENCE)
|
||||
{
|
||||
DialogBox(hApplet,
|
||||
MAKEINTRESOURCE(IDD_LICENCE),
|
||||
hwndDlg,
|
||||
LicenceDlgProc);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
break;
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case WM_DRAWITEM:
|
||||
{
|
||||
LPDRAWITEMSTRUCT lpDrawItem;
|
||||
lpDrawItem = (LPDRAWITEMSTRUCT) lParam;
|
||||
if(lpDrawItem->CtlID == IDC_ROSIMG)
|
||||
{
|
||||
HDC hdcMem;
|
||||
LONG left;
|
||||
case WM_DRAWITEM:
|
||||
{
|
||||
LPDRAWITEMSTRUCT lpDrawItem;
|
||||
lpDrawItem = (LPDRAWITEMSTRUCT) lParam;
|
||||
if(lpDrawItem->CtlID == IDC_ROSIMG)
|
||||
{
|
||||
HDC hdcMem;
|
||||
LONG left;
|
||||
|
||||
/* position image in centre of dialog */
|
||||
left = (lpDrawItem->rcItem.right - ImgInfo.cxSource) / 2;
|
||||
/* position image in centre of dialog */
|
||||
left = (lpDrawItem->rcItem.right - ImgInfo.cxSource) / 2;
|
||||
|
||||
hdcMem = CreateCompatibleDC(lpDrawItem->hDC);
|
||||
if (hdcMem != NULL)
|
||||
{
|
||||
SelectObject(hdcMem, ImgInfo.hBitmap);
|
||||
BitBlt(lpDrawItem->hDC,
|
||||
left,
|
||||
lpDrawItem->rcItem.top,
|
||||
lpDrawItem->rcItem.right - lpDrawItem->rcItem.left,
|
||||
lpDrawItem->rcItem.bottom - lpDrawItem->rcItem.top,
|
||||
hdcMem,
|
||||
0,
|
||||
0,
|
||||
SRCCOPY);
|
||||
DeleteDC(hdcMem);
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
hdcMem = CreateCompatibleDC(lpDrawItem->hDC);
|
||||
if (hdcMem != NULL)
|
||||
{
|
||||
SelectObject(hdcMem, ImgInfo.hBitmap);
|
||||
BitBlt(lpDrawItem->hDC,
|
||||
left,
|
||||
lpDrawItem->rcItem.top,
|
||||
lpDrawItem->rcItem.right - lpDrawItem->rcItem.left,
|
||||
lpDrawItem->rcItem.bottom - lpDrawItem->rcItem.top,
|
||||
hdcMem,
|
||||
0,
|
||||
0,
|
||||
SRCCOPY);
|
||||
DeleteDC(hdcMem);
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
case WM_NOTIFY:
|
||||
{
|
||||
NMHDR *nmhdr = (NMHDR *)lParam;
|
||||
case WM_NOTIFY:
|
||||
{
|
||||
NMHDR *nmhdr = (NMHDR *)lParam;
|
||||
|
||||
if (nmhdr->idFrom == IDC_ROSHOMEPAGE_LINK && nmhdr->code == NM_CLICK)
|
||||
{
|
||||
PNMLINK nml = (PNMLINK)nmhdr;
|
||||
if (nmhdr->idFrom == IDC_ROSHOMEPAGE_LINK && nmhdr->code == NM_CLICK)
|
||||
{
|
||||
PNMLINK nml = (PNMLINK)nmhdr;
|
||||
|
||||
ShellExecuteW(hwndDlg,
|
||||
L"open",
|
||||
nml->item.szUrl,
|
||||
NULL,
|
||||
NULL,
|
||||
SW_SHOWNORMAL);
|
||||
}
|
||||
break;
|
||||
}
|
||||
ShellExecuteW(hwndDlg,
|
||||
L"open",
|
||||
nml->item.szUrl,
|
||||
NULL,
|
||||
NULL,
|
||||
SW_SHOWNORMAL);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -12,77 +12,76 @@
|
|||
/* Property page dialog callback */
|
||||
static INT_PTR CALLBACK
|
||||
RenameProfDlgProc(HWND hwndDlg,
|
||||
UINT uMsg,
|
||||
WPARAM wParam,
|
||||
LPARAM lParam)
|
||||
UINT uMsg,
|
||||
WPARAM wParam,
|
||||
LPARAM lParam)
|
||||
{
|
||||
UNREFERENCED_PARAMETER(lParam);
|
||||
UNREFERENCED_PARAMETER(wParam);
|
||||
UNREFERENCED_PARAMETER(hwndDlg);
|
||||
switch(uMsg)
|
||||
{
|
||||
case WM_INITDIALOG:
|
||||
{
|
||||
MessageBox(hwndDlg, _T("Dialog not yet implemented!"), NULL, 0);
|
||||
}
|
||||
break;
|
||||
UNREFERENCED_PARAMETER(lParam);
|
||||
UNREFERENCED_PARAMETER(wParam);
|
||||
UNREFERENCED_PARAMETER(hwndDlg);
|
||||
switch(uMsg)
|
||||
{
|
||||
case WM_INITDIALOG:
|
||||
{
|
||||
MessageBox(hwndDlg, _T("Dialog not yet implemented!"), NULL, 0);
|
||||
}
|
||||
break;
|
||||
|
||||
case WM_COMMAND:
|
||||
{
|
||||
if ((LOWORD(wParam) == IDOK) || (LOWORD(wParam) == IDCANCEL))
|
||||
{
|
||||
EndDialog(hwndDlg,
|
||||
LOWORD(wParam));
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
return FALSE;
|
||||
case WM_COMMAND:
|
||||
{
|
||||
if ((LOWORD(wParam) == IDOK) || (LOWORD(wParam) == IDCANCEL))
|
||||
{
|
||||
EndDialog(hwndDlg,
|
||||
LOWORD(wParam));
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
/* Property page dialog callback */
|
||||
INT_PTR CALLBACK
|
||||
HardProfDlgProc(HWND hwndDlg,
|
||||
UINT uMsg,
|
||||
WPARAM wParam,
|
||||
LPARAM lParam)
|
||||
UINT uMsg,
|
||||
WPARAM wParam,
|
||||
LPARAM lParam)
|
||||
{
|
||||
UNREFERENCED_PARAMETER(lParam);
|
||||
UNREFERENCED_PARAMETER(wParam);
|
||||
UNREFERENCED_PARAMETER(hwndDlg);
|
||||
switch(uMsg)
|
||||
{
|
||||
case WM_INITDIALOG:
|
||||
{
|
||||
MessageBox(hwndDlg, _T("Dialog not yet implemented!"), NULL, 0);
|
||||
}
|
||||
break;
|
||||
UNREFERENCED_PARAMETER(lParam);
|
||||
UNREFERENCED_PARAMETER(wParam);
|
||||
UNREFERENCED_PARAMETER(hwndDlg);
|
||||
switch(uMsg)
|
||||
{
|
||||
case WM_INITDIALOG:
|
||||
{
|
||||
MessageBox(hwndDlg, _T("Dialog not yet implemented!"), NULL, 0);
|
||||
}
|
||||
break;
|
||||
|
||||
case WM_COMMAND:
|
||||
{
|
||||
switch (LOWORD(wParam))
|
||||
{
|
||||
case IDC_HRDPROFRENAME:
|
||||
{
|
||||
DialogBox(hApplet,
|
||||
MAKEINTRESOURCE(IDD_RENAMEPROFILE),
|
||||
hwndDlg,
|
||||
(DLGPROC)RenameProfDlgProc);
|
||||
}
|
||||
case WM_COMMAND:
|
||||
{
|
||||
switch (LOWORD(wParam))
|
||||
{
|
||||
case IDC_HRDPROFRENAME:
|
||||
{
|
||||
DialogBox(hApplet,
|
||||
MAKEINTRESOURCE(IDD_RENAMEPROFILE),
|
||||
hwndDlg,
|
||||
(DLGPROC)RenameProfDlgProc);
|
||||
}
|
||||
|
||||
case IDOK:
|
||||
case IDCANCEL:
|
||||
{
|
||||
EndDialog(hwndDlg,
|
||||
LOWORD(wParam));
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
break;
|
||||
}
|
||||
return FALSE;
|
||||
case IDOK:
|
||||
case IDCANCEL:
|
||||
{
|
||||
EndDialog(hwndDlg,
|
||||
LOWORD(wParam));
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
|
|
@ -16,72 +16,71 @@ BOOL LaunchDeviceManager(HWND hWndParent)
|
|||
{
|
||||
/* hack for ROS to start our devmgmt until we have mmc */
|
||||
#ifdef __REACTOS__
|
||||
return ((INT)ShellExecuteW(NULL, L"open", L"devmgmt.exe", NULL, NULL, SW_SHOWNORMAL) > 32);
|
||||
return ((INT)ShellExecuteW(NULL, L"open", L"devmgmt.exe", NULL, NULL, SW_SHOWNORMAL) > 32);
|
||||
#else
|
||||
HMODULE hDll;
|
||||
PDEVMGREXEC DevMgrExec;
|
||||
BOOL Ret;
|
||||
HMODULE hDll;
|
||||
PDEVMGREXEC DevMgrExec;
|
||||
BOOL Ret;
|
||||
|
||||
hDll = LoadLibrary(_TEXT("devmgr.dll"));
|
||||
if(!hDll)
|
||||
return FALSE;
|
||||
hDll = LoadLibrary(_TEXT("devmgr.dll"));
|
||||
if(!hDll)
|
||||
return FALSE;
|
||||
|
||||
DevMgrExec = (PDEVMGREXEC)GetProcAddress(hDll, "DeviceManager_ExecuteW");
|
||||
if(!DevMgrExec)
|
||||
{
|
||||
FreeLibrary(hDll);
|
||||
return FALSE;
|
||||
}
|
||||
DevMgrExec = (PDEVMGREXEC)GetProcAddress(hDll, "DeviceManager_ExecuteW");
|
||||
if(!DevMgrExec)
|
||||
{
|
||||
FreeLibrary(hDll);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* run the Device Manager */
|
||||
Ret = DevMgrExec(hWndParent, hApplet, NULL /* ??? */, SW_SHOW);
|
||||
FreeLibrary(hDll);
|
||||
return Ret;
|
||||
/* run the Device Manager */
|
||||
Ret = DevMgrExec(hWndParent, hApplet, NULL /* ??? */, SW_SHOW);
|
||||
FreeLibrary(hDll);
|
||||
return Ret;
|
||||
#endif /* __REACTOS__ */
|
||||
}
|
||||
|
||||
/* Property page dialog callback */
|
||||
INT_PTR CALLBACK
|
||||
HardwarePageProc(HWND hwndDlg,
|
||||
UINT uMsg,
|
||||
WPARAM wParam,
|
||||
LPARAM lParam)
|
||||
UINT uMsg,
|
||||
WPARAM wParam,
|
||||
LPARAM lParam)
|
||||
{
|
||||
UNREFERENCED_PARAMETER(lParam);
|
||||
UNREFERENCED_PARAMETER(lParam);
|
||||
|
||||
switch(uMsg)
|
||||
{
|
||||
case WM_INITDIALOG:
|
||||
break;
|
||||
switch(uMsg)
|
||||
{
|
||||
case WM_INITDIALOG:
|
||||
break;
|
||||
|
||||
case WM_COMMAND:
|
||||
{
|
||||
switch(LOWORD(wParam))
|
||||
{
|
||||
case IDC_HARDWARE_DEVICE_MANAGER:
|
||||
{
|
||||
if(!LaunchDeviceManager(hwndDlg))
|
||||
{
|
||||
/* FIXME */
|
||||
}
|
||||
case WM_COMMAND:
|
||||
{
|
||||
switch(LOWORD(wParam))
|
||||
{
|
||||
case IDC_HARDWARE_DEVICE_MANAGER:
|
||||
{
|
||||
if(!LaunchDeviceManager(hwndDlg))
|
||||
{
|
||||
/* FIXME */
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
case IDC_HARDWARE_PROFILE:
|
||||
{
|
||||
DialogBox(hApplet,
|
||||
MAKEINTRESOURCE(IDD_HARDWAREPROFILES),
|
||||
hwndDlg,
|
||||
(DLGPROC)HardProfDlgProc);
|
||||
case IDC_HARDWARE_PROFILE:
|
||||
{
|
||||
DialogBox(hApplet,
|
||||
MAKEINTRESOURCE(IDD_HARDWAREPROFILES),
|
||||
hwndDlg,
|
||||
(DLGPROC)HardProfDlgProc);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
|
@ -12,70 +12,70 @@
|
|||
|
||||
INT_PTR CALLBACK
|
||||
LicenceDlgProc(HWND hDlg,
|
||||
UINT message,
|
||||
WPARAM wParam,
|
||||
LPARAM lParam)
|
||||
UINT message,
|
||||
WPARAM wParam,
|
||||
LPARAM lParam)
|
||||
{
|
||||
HRSRC hResInfo;
|
||||
HGLOBAL hResMem;
|
||||
WCHAR *LicenseText;
|
||||
static HICON hIcon;
|
||||
HRSRC hResInfo;
|
||||
HGLOBAL hResMem;
|
||||
WCHAR *LicenseText;
|
||||
static HICON hIcon;
|
||||
|
||||
UNREFERENCED_PARAMETER(lParam);
|
||||
UNREFERENCED_PARAMETER(lParam);
|
||||
|
||||
switch (message)
|
||||
{
|
||||
case WM_INITDIALOG:
|
||||
{
|
||||
hIcon = LoadImage(hApplet,
|
||||
MAKEINTRESOURCE(IDI_CPLSYSTEM),
|
||||
IMAGE_ICON,
|
||||
16,
|
||||
16,
|
||||
0);
|
||||
switch (message)
|
||||
{
|
||||
case WM_INITDIALOG:
|
||||
{
|
||||
hIcon = LoadImage(hApplet,
|
||||
MAKEINTRESOURCE(IDI_CPLSYSTEM),
|
||||
IMAGE_ICON,
|
||||
16,
|
||||
16,
|
||||
0);
|
||||
|
||||
SendMessage(hDlg,
|
||||
WM_SETICON,
|
||||
ICON_SMALL,
|
||||
(LPARAM)hIcon);
|
||||
SendMessage(hDlg,
|
||||
WM_SETICON,
|
||||
ICON_SMALL,
|
||||
(LPARAM)hIcon);
|
||||
|
||||
/* load license from resource */
|
||||
if(!(hResInfo = FindResource(hApplet,
|
||||
MAKEINTRESOURCE(RC_LICENSE),
|
||||
MAKEINTRESOURCE(RTDATA))) ||
|
||||
!(hResMem = LoadResource(hApplet, hResInfo)) ||
|
||||
!(LicenseText = LockResource(hResMem)))
|
||||
{
|
||||
ShowLastWin32Error(hDlg);
|
||||
break;
|
||||
}
|
||||
/* load license from resource */
|
||||
if(!(hResInfo = FindResource(hApplet,
|
||||
MAKEINTRESOURCE(RC_LICENSE),
|
||||
MAKEINTRESOURCE(RTDATA))) ||
|
||||
!(hResMem = LoadResource(hApplet, hResInfo)) ||
|
||||
!(LicenseText = LockResource(hResMem)))
|
||||
{
|
||||
ShowLastWin32Error(hDlg);
|
||||
break;
|
||||
}
|
||||
|
||||
/* insert the license into the edit control (unicode!) */
|
||||
SetDlgItemText(hDlg,
|
||||
IDC_LICENCEEDIT,
|
||||
LicenseText);
|
||||
/* insert the license into the edit control (unicode!) */
|
||||
SetDlgItemText(hDlg,
|
||||
IDC_LICENCEEDIT,
|
||||
LicenseText);
|
||||
|
||||
SendDlgItemMessage(hDlg,
|
||||
IDC_LICENCEEDIT,
|
||||
EM_SETSEL,
|
||||
-1,
|
||||
0);
|
||||
SendDlgItemMessage(hDlg,
|
||||
IDC_LICENCEEDIT,
|
||||
EM_SETSEL,
|
||||
-1,
|
||||
0);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
case WM_COMMAND:
|
||||
{
|
||||
if ((LOWORD(wParam) == IDOK) || (LOWORD(wParam) == IDCANCEL))
|
||||
{
|
||||
DestroyIcon(hIcon);
|
||||
EndDialog(hDlg,
|
||||
LOWORD(wParam));
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case WM_COMMAND:
|
||||
{
|
||||
if ((LOWORD(wParam) == IDOK) || (LOWORD(wParam) == IDCANCEL))
|
||||
{
|
||||
DestroyIcon(hIcon);
|
||||
EndDialog(hDlg,
|
||||
LOWORD(wParam));
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
return FALSE;
|
||||
}
|
||||
|
|
|
@ -29,9 +29,9 @@ void SetTimeout(HWND hwndDlg, int Timeout)
|
|||
/* Property page dialog callback */
|
||||
INT_PTR CALLBACK
|
||||
StartRecDlgProc(HWND hwndDlg,
|
||||
UINT uMsg,
|
||||
WPARAM wParam,
|
||||
LPARAM lParam)
|
||||
UINT uMsg,
|
||||
WPARAM wParam,
|
||||
LPARAM lParam)
|
||||
{
|
||||
TCHAR *szSystemDrive;
|
||||
TCHAR szDefaultOS[MAX_PATH];
|
||||
|
@ -143,6 +143,6 @@ FailGetSysDrive:
|
|||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
|
|
@ -15,7 +15,7 @@ HINSTANCE hApplet = 0;
|
|||
/* Applets */
|
||||
APPLET Applets[NUM_APPLETS] =
|
||||
{
|
||||
{IDI_CPLSYSTEM, IDS_CPLSYSTEMNAME, IDS_CPLSYSTEMDESCRIPTION, SystemApplet}
|
||||
{IDI_CPLSYSTEM, IDS_CPLSYSTEMNAME, IDS_CPLSYSTEMDESCRIPTION, SystemApplet}
|
||||
};
|
||||
|
||||
#define MAX_SYSTEM_PAGES 32
|
||||
|
@ -23,39 +23,39 @@ APPLET Applets[NUM_APPLETS] =
|
|||
static BOOL CALLBACK
|
||||
PropSheetAddPage(HPROPSHEETPAGE hpage, LPARAM lParam)
|
||||
{
|
||||
PROPSHEETHEADER *ppsh = (PROPSHEETHEADER *)lParam;
|
||||
if (ppsh != NULL && ppsh->nPages < MAX_SYSTEM_PAGES)
|
||||
{
|
||||
ppsh->phpage[ppsh->nPages++] = hpage;
|
||||
return TRUE;
|
||||
}
|
||||
PROPSHEETHEADER *ppsh = (PROPSHEETHEADER *)lParam;
|
||||
if (ppsh != NULL && ppsh->nPages < MAX_SYSTEM_PAGES)
|
||||
{
|
||||
ppsh->phpage[ppsh->nPages++] = hpage;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static BOOL
|
||||
InitPropSheetPage(PROPSHEETHEADER *ppsh, WORD idDlg, DLGPROC DlgProc)
|
||||
{
|
||||
HPROPSHEETPAGE hPage;
|
||||
PROPSHEETPAGE psp;
|
||||
HPROPSHEETPAGE hPage;
|
||||
PROPSHEETPAGE psp;
|
||||
|
||||
if (ppsh->nPages < MAX_SYSTEM_PAGES)
|
||||
{
|
||||
ZeroMemory(&psp, sizeof(psp));
|
||||
psp.dwSize = sizeof(psp);
|
||||
psp.dwFlags = PSP_DEFAULT;
|
||||
psp.hInstance = hApplet;
|
||||
psp.pszTemplate = MAKEINTRESOURCE(idDlg);
|
||||
psp.pfnDlgProc = DlgProc;
|
||||
if (ppsh->nPages < MAX_SYSTEM_PAGES)
|
||||
{
|
||||
ZeroMemory(&psp, sizeof(psp));
|
||||
psp.dwSize = sizeof(psp);
|
||||
psp.dwFlags = PSP_DEFAULT;
|
||||
psp.hInstance = hApplet;
|
||||
psp.pszTemplate = MAKEINTRESOURCE(idDlg);
|
||||
psp.pfnDlgProc = DlgProc;
|
||||
|
||||
hPage = CreatePropertySheetPage(&psp);
|
||||
if (hPage != NULL)
|
||||
{
|
||||
return PropSheetAddPage(hPage, (LPARAM)ppsh);
|
||||
}
|
||||
}
|
||||
hPage = CreatePropertySheetPage(&psp);
|
||||
if (hPage != NULL)
|
||||
{
|
||||
return PropSheetAddPage(hPage, (LPARAM)ppsh);
|
||||
}
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
typedef HPROPSHEETPAGE (WINAPI *PCreateNetIDPropertyPage)(VOID);
|
||||
|
@ -63,87 +63,87 @@ typedef HPROPSHEETPAGE (WINAPI *PCreateNetIDPropertyPage)(VOID);
|
|||
static HMODULE
|
||||
AddNetIdPage(PROPSHEETHEADER *ppsh)
|
||||
{
|
||||
HPROPSHEETPAGE hPage;
|
||||
HMODULE hMod;
|
||||
PCreateNetIDPropertyPage pCreateNetIdPage;
|
||||
HPROPSHEETPAGE hPage;
|
||||
HMODULE hMod;
|
||||
PCreateNetIDPropertyPage pCreateNetIdPage;
|
||||
|
||||
hMod = LoadLibrary(TEXT("netid.dll"));
|
||||
if (hMod != NULL)
|
||||
{
|
||||
pCreateNetIdPage = (PCreateNetIDPropertyPage)GetProcAddress(hMod,
|
||||
"CreateNetIDPropertyPage");
|
||||
if (pCreateNetIdPage != NULL)
|
||||
{
|
||||
hPage = pCreateNetIdPage();
|
||||
if (hPage == NULL)
|
||||
goto Fail;
|
||||
hMod = LoadLibrary(TEXT("netid.dll"));
|
||||
if (hMod != NULL)
|
||||
{
|
||||
pCreateNetIdPage = (PCreateNetIDPropertyPage)GetProcAddress(hMod,
|
||||
"CreateNetIDPropertyPage");
|
||||
if (pCreateNetIdPage != NULL)
|
||||
{
|
||||
hPage = pCreateNetIdPage();
|
||||
if (hPage == NULL)
|
||||
goto Fail;
|
||||
|
||||
if (!PropSheetAddPage(hPage, (LPARAM)ppsh))
|
||||
{
|
||||
DestroyPropertySheetPage(hPage);
|
||||
goto Fail;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!PropSheetAddPage(hPage, (LPARAM)ppsh))
|
||||
{
|
||||
DestroyPropertySheetPage(hPage);
|
||||
goto Fail;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Fail:
|
||||
FreeLibrary(hMod);
|
||||
hMod = NULL;
|
||||
}
|
||||
}
|
||||
FreeLibrary(hMod);
|
||||
hMod = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
return hMod;
|
||||
return hMod;
|
||||
}
|
||||
|
||||
/* First Applet */
|
||||
LONG CALLBACK
|
||||
SystemApplet(VOID)
|
||||
{
|
||||
HPROPSHEETPAGE hpsp[MAX_SYSTEM_PAGES];
|
||||
PROPSHEETHEADER psh;
|
||||
HMODULE hNetIdDll;
|
||||
HPSXA hpsxa = NULL;
|
||||
LONG Ret;
|
||||
static INITCOMMONCONTROLSEX icc = {sizeof(INITCOMMONCONTROLSEX), ICC_LINK_CLASS};
|
||||
HPROPSHEETPAGE hpsp[MAX_SYSTEM_PAGES];
|
||||
PROPSHEETHEADER psh;
|
||||
HMODULE hNetIdDll;
|
||||
HPSXA hpsxa = NULL;
|
||||
LONG Ret;
|
||||
static INITCOMMONCONTROLSEX icc = {sizeof(INITCOMMONCONTROLSEX), ICC_LINK_CLASS};
|
||||
|
||||
if (!InitCommonControlsEx(&icc))
|
||||
return 0;
|
||||
if (!InitCommonControlsEx(&icc))
|
||||
return 0;
|
||||
|
||||
ZeroMemory(&psh, sizeof(PROPSHEETHEADER));
|
||||
psh.dwSize = sizeof(PROPSHEETHEADER);
|
||||
psh.dwFlags = PSH_PROPTITLE;
|
||||
psh.hwndParent = NULL;
|
||||
psh.hInstance = hApplet;
|
||||
psh.hIcon = LoadIcon(hApplet, MAKEINTRESOURCE(IDI_CPLSYSTEM));
|
||||
psh.pszCaption = MAKEINTRESOURCE(IDS_CPLSYSTEMNAME);
|
||||
psh.nPages = 0;
|
||||
psh.nStartPage = 0;
|
||||
psh.phpage = hpsp;
|
||||
psh.pfnCallback = NULL;
|
||||
ZeroMemory(&psh, sizeof(PROPSHEETHEADER));
|
||||
psh.dwSize = sizeof(PROPSHEETHEADER);
|
||||
psh.dwFlags = PSH_PROPTITLE;
|
||||
psh.hwndParent = NULL;
|
||||
psh.hInstance = hApplet;
|
||||
psh.hIcon = LoadIcon(hApplet, MAKEINTRESOURCE(IDI_CPLSYSTEM));
|
||||
psh.pszCaption = MAKEINTRESOURCE(IDS_CPLSYSTEMNAME);
|
||||
psh.nPages = 0;
|
||||
psh.nStartPage = 0;
|
||||
psh.phpage = hpsp;
|
||||
psh.pfnCallback = NULL;
|
||||
|
||||
InitPropSheetPage(&psh, IDD_PROPPAGEGENERAL, (DLGPROC) GeneralPageProc);
|
||||
hNetIdDll = AddNetIdPage(&psh);
|
||||
InitPropSheetPage(&psh, IDD_PROPPAGEHARDWARE, (DLGPROC) HardwarePageProc);
|
||||
InitPropSheetPage(&psh, IDD_PROPPAGEADVANCED, (DLGPROC) AdvancedPageProc);
|
||||
InitPropSheetPage(&psh, IDD_PROPPAGEGENERAL, (DLGPROC) GeneralPageProc);
|
||||
hNetIdDll = AddNetIdPage(&psh);
|
||||
InitPropSheetPage(&psh, IDD_PROPPAGEHARDWARE, (DLGPROC) HardwarePageProc);
|
||||
InitPropSheetPage(&psh, IDD_PROPPAGEADVANCED, (DLGPROC) AdvancedPageProc);
|
||||
|
||||
/* Load additional pages provided by shell extensions */
|
||||
hpsxa = SHCreatePropSheetExtArray(HKEY_LOCAL_MACHINE, REGSTR_PATH_CONTROLSFOLDER TEXT("\\System"), MAX_SYSTEM_PAGES - psh.nPages);
|
||||
if (hpsxa != NULL)
|
||||
{
|
||||
SHAddFromPropSheetExtArray(hpsxa, PropSheetAddPage, (LPARAM)&psh);
|
||||
}
|
||||
/* Load additional pages provided by shell extensions */
|
||||
hpsxa = SHCreatePropSheetExtArray(HKEY_LOCAL_MACHINE, REGSTR_PATH_CONTROLSFOLDER TEXT("\\System"), MAX_SYSTEM_PAGES - psh.nPages);
|
||||
if (hpsxa != NULL)
|
||||
{
|
||||
SHAddFromPropSheetExtArray(hpsxa, PropSheetAddPage, (LPARAM)&psh);
|
||||
}
|
||||
|
||||
Ret = (LONG)(PropertySheet(&psh) != -1);
|
||||
Ret = (LONG)(PropertySheet(&psh) != -1);
|
||||
|
||||
if (hpsxa != NULL)
|
||||
{
|
||||
SHDestroyPropSheetExtArray(hpsxa);
|
||||
}
|
||||
if (hpsxa != NULL)
|
||||
{
|
||||
SHDestroyPropSheetExtArray(hpsxa);
|
||||
}
|
||||
|
||||
if (hNetIdDll != NULL)
|
||||
FreeLibrary(hNetIdDll);
|
||||
if (hNetIdDll != NULL)
|
||||
FreeLibrary(hNetIdDll);
|
||||
|
||||
return Ret;
|
||||
return Ret;
|
||||
}
|
||||
|
||||
/* Control Panel Callback */
|
||||
|
@ -154,35 +154,35 @@ CPlApplet(
|
|||
LPARAM lParam1,
|
||||
LPARAM lParam2)
|
||||
{
|
||||
int i = (int)lParam1;
|
||||
UNREFERENCED_PARAMETER(hwndCPl);
|
||||
int i = (int)lParam1;
|
||||
UNREFERENCED_PARAMETER(hwndCPl);
|
||||
|
||||
switch(uMsg)
|
||||
{
|
||||
case CPL_INIT:
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
case CPL_GETCOUNT:
|
||||
{
|
||||
return NUM_APPLETS;
|
||||
}
|
||||
case CPL_INQUIRE:
|
||||
{
|
||||
CPLINFO *CPlInfo = (CPLINFO*)lParam2;
|
||||
CPlInfo->lData = 0;
|
||||
CPlInfo->idIcon = Applets[i].idIcon;
|
||||
CPlInfo->idName = Applets[i].idName;
|
||||
CPlInfo->idInfo = Applets[i].idDescription;
|
||||
break;
|
||||
}
|
||||
case CPL_DBLCLK:
|
||||
{
|
||||
Applets[i].AppletProc();
|
||||
break;
|
||||
}
|
||||
}
|
||||
return FALSE;
|
||||
switch(uMsg)
|
||||
{
|
||||
case CPL_INIT:
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
case CPL_GETCOUNT:
|
||||
{
|
||||
return NUM_APPLETS;
|
||||
}
|
||||
case CPL_INQUIRE:
|
||||
{
|
||||
CPLINFO *CPlInfo = (CPLINFO*)lParam2;
|
||||
CPlInfo->lData = 0;
|
||||
CPlInfo->idIcon = Applets[i].idIcon;
|
||||
CPlInfo->idName = Applets[i].idName;
|
||||
CPlInfo->idInfo = Applets[i].idDescription;
|
||||
break;
|
||||
}
|
||||
case CPL_DBLCLK:
|
||||
{
|
||||
Applets[i].AppletProc();
|
||||
break;
|
||||
}
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
|
@ -192,14 +192,13 @@ DllMain(
|
|||
DWORD dwReason,
|
||||
LPVOID lpvReserved)
|
||||
{
|
||||
UNREFERENCED_PARAMETER(lpvReserved);
|
||||
switch(dwReason)
|
||||
{
|
||||
case DLL_PROCESS_ATTACH:
|
||||
case DLL_THREAD_ATTACH:
|
||||
hApplet = hinstDLL;
|
||||
break;
|
||||
}
|
||||
return TRUE;
|
||||
UNREFERENCED_PARAMETER(lpvReserved);
|
||||
switch(dwReason)
|
||||
{
|
||||
case DLL_PROCESS_ATTACH:
|
||||
case DLL_THREAD_ATTACH:
|
||||
hApplet = hinstDLL;
|
||||
break;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
|
|
@ -13,48 +13,48 @@
|
|||
/* Property page dialog callback */
|
||||
INT_PTR CALLBACK
|
||||
UserProfileDlgProc(HWND hwndDlg,
|
||||
UINT uMsg,
|
||||
WPARAM wParam,
|
||||
LPARAM lParam)
|
||||
UINT uMsg,
|
||||
WPARAM wParam,
|
||||
LPARAM lParam)
|
||||
{
|
||||
UNREFERENCED_PARAMETER(lParam);
|
||||
UNREFERENCED_PARAMETER(wParam);
|
||||
UNREFERENCED_PARAMETER(hwndDlg);
|
||||
UNREFERENCED_PARAMETER(lParam);
|
||||
UNREFERENCED_PARAMETER(wParam);
|
||||
UNREFERENCED_PARAMETER(hwndDlg);
|
||||
|
||||
switch(uMsg)
|
||||
{
|
||||
case WM_INITDIALOG:
|
||||
{
|
||||
MessageBox(hwndDlg, _T("Dialog not yet implemented!"), NULL, 0);
|
||||
}
|
||||
break;
|
||||
switch(uMsg)
|
||||
{
|
||||
case WM_INITDIALOG:
|
||||
{
|
||||
MessageBox(hwndDlg, _T("Dialog not yet implemented!"), NULL, 0);
|
||||
}
|
||||
break;
|
||||
|
||||
case WM_COMMAND:
|
||||
{
|
||||
if ((LOWORD(wParam) == IDOK) || (LOWORD(wParam) == IDCANCEL))
|
||||
{
|
||||
EndDialog(hwndDlg,
|
||||
LOWORD(wParam));
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case WM_COMMAND:
|
||||
{
|
||||
if ((LOWORD(wParam) == IDOK) || (LOWORD(wParam) == IDCANCEL))
|
||||
{
|
||||
EndDialog(hwndDlg,
|
||||
LOWORD(wParam));
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case WM_NOTIFY:
|
||||
{
|
||||
NMHDR *nmhdr = (NMHDR *)lParam;
|
||||
case WM_NOTIFY:
|
||||
{
|
||||
NMHDR *nmhdr = (NMHDR *)lParam;
|
||||
|
||||
if (nmhdr->idFrom == IDC_USERACCOUNT_LINK && nmhdr->code == NM_CLICK)
|
||||
{
|
||||
ShellExecute(hwndDlg,
|
||||
TEXT("open"),
|
||||
TEXT("rundll32.exe"),
|
||||
TEXT("shell32.dll, Control_RunDLL nusrmgr.cpl"),
|
||||
NULL,
|
||||
SW_SHOWNORMAL);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
return FALSE;
|
||||
if (nmhdr->idFrom == IDC_USERACCOUNT_LINK && nmhdr->code == NM_CLICK)
|
||||
{
|
||||
ShellExecute(hwndDlg,
|
||||
TEXT("open"),
|
||||
TEXT("rundll32.exe"),
|
||||
TEXT("shell32.dll, Control_RunDLL nusrmgr.cpl"),
|
||||
NULL,
|
||||
SW_SHOWNORMAL);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
|
|
@ -14,351 +14,350 @@ static LPCTSTR lpKey = _T("SYSTEM\\CurrentControlSet\\Control\\Session Manager\\
|
|||
static BOOL
|
||||
ReadPageFileSettings(PVIRTMEM pVirtMem)
|
||||
{
|
||||
HKEY hkey = NULL;
|
||||
DWORD dwType;
|
||||
DWORD dwDataSize;
|
||||
BOOL bRet = FALSE;
|
||||
HKEY hkey = NULL;
|
||||
DWORD dwType;
|
||||
DWORD dwDataSize;
|
||||
BOOL bRet = FALSE;
|
||||
|
||||
if(RegCreateKeyEx(HKEY_LOCAL_MACHINE,
|
||||
lpKey,
|
||||
0,
|
||||
NULL,
|
||||
REG_OPTION_NON_VOLATILE,
|
||||
KEY_QUERY_VALUE,
|
||||
NULL,
|
||||
&hkey,
|
||||
NULL) == ERROR_SUCCESS)
|
||||
{
|
||||
if(RegQueryValueEx(hkey,
|
||||
_T("PagingFiles"),
|
||||
NULL,
|
||||
&dwType,
|
||||
NULL,
|
||||
&dwDataSize) == ERROR_SUCCESS)
|
||||
if(RegCreateKeyEx(HKEY_LOCAL_MACHINE,
|
||||
lpKey,
|
||||
0,
|
||||
NULL,
|
||||
REG_OPTION_NON_VOLATILE,
|
||||
KEY_QUERY_VALUE,
|
||||
NULL,
|
||||
&hkey,
|
||||
NULL) == ERROR_SUCCESS)
|
||||
{
|
||||
if(RegQueryValueEx(hkey,
|
||||
_T("PagingFiles"),
|
||||
NULL,
|
||||
&dwType,
|
||||
NULL,
|
||||
&dwDataSize) == ERROR_SUCCESS)
|
||||
{
|
||||
pVirtMem->szPagingFiles = (LPTSTR)HeapAlloc(GetProcessHeap(),
|
||||
0,
|
||||
dwDataSize);
|
||||
if (pVirtMem->szPagingFiles != NULL)
|
||||
{
|
||||
ZeroMemory(pVirtMem->szPagingFiles,
|
||||
dwDataSize);
|
||||
if(RegQueryValueEx(hkey,
|
||||
_T("PagingFiles"),
|
||||
NULL,
|
||||
&dwType,
|
||||
(PBYTE)pVirtMem->szPagingFiles,
|
||||
&dwDataSize) == ERROR_SUCCESS)
|
||||
{
|
||||
bRet = TRUE;
|
||||
}
|
||||
}
|
||||
pVirtMem->szPagingFiles = (LPTSTR)HeapAlloc(GetProcessHeap(),
|
||||
0,
|
||||
dwDataSize);
|
||||
if (pVirtMem->szPagingFiles != NULL)
|
||||
{
|
||||
ZeroMemory(pVirtMem->szPagingFiles,
|
||||
dwDataSize);
|
||||
if(RegQueryValueEx(hkey,
|
||||
_T("PagingFiles"),
|
||||
NULL,
|
||||
&dwType,
|
||||
(PBYTE)pVirtMem->szPagingFiles,
|
||||
&dwDataSize) == ERROR_SUCCESS)
|
||||
{
|
||||
bRet = TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
if (!bRet)
|
||||
ShowLastWin32Error(pVirtMem->hSelf);
|
||||
|
||||
if (!bRet)
|
||||
ShowLastWin32Error(pVirtMem->hSelf);
|
||||
if (hkey != NULL)
|
||||
RegCloseKey(hkey);
|
||||
|
||||
if (hkey != NULL)
|
||||
RegCloseKey(hkey);
|
||||
|
||||
return bRet;
|
||||
return bRet;
|
||||
}
|
||||
|
||||
|
||||
static INT
|
||||
GetPageFileSizes(LPTSTR lpPageFiles)
|
||||
{
|
||||
while (*lpPageFiles != _T('\0'))
|
||||
{
|
||||
if (*lpPageFiles == _T(' '))
|
||||
{
|
||||
lpPageFiles++;
|
||||
return (INT)_ttoi(lpPageFiles);
|
||||
}
|
||||
while (*lpPageFiles != _T('\0'))
|
||||
{
|
||||
if (*lpPageFiles == _T(' '))
|
||||
{
|
||||
lpPageFiles++;
|
||||
return (INT)_ttoi(lpPageFiles);
|
||||
}
|
||||
|
||||
lpPageFiles++;
|
||||
}
|
||||
lpPageFiles++;
|
||||
}
|
||||
|
||||
return -1;
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
static VOID
|
||||
ParseMemSettings(PVIRTMEM pVirtMem)
|
||||
{
|
||||
TCHAR szDrives[1024]; // all drives
|
||||
LPTSTR DrivePtr = szDrives;
|
||||
TCHAR szDrive[MAX_PATH]; // single drive
|
||||
TCHAR szVolume[MAX_PATH];
|
||||
INT InitialSize = 0;
|
||||
INT MaxSize = 0;
|
||||
INT DriveLen;
|
||||
INT PgCnt = 0;
|
||||
TCHAR szDrives[1024]; // all drives
|
||||
LPTSTR DrivePtr = szDrives;
|
||||
TCHAR szDrive[MAX_PATH]; // single drive
|
||||
TCHAR szVolume[MAX_PATH];
|
||||
INT InitialSize = 0;
|
||||
INT MaxSize = 0;
|
||||
INT DriveLen;
|
||||
INT PgCnt = 0;
|
||||
|
||||
DriveLen = GetLogicalDriveStrings(1023,
|
||||
szDrives);
|
||||
DriveLen = GetLogicalDriveStrings(1023,
|
||||
szDrives);
|
||||
|
||||
while (DriveLen != 0)
|
||||
{
|
||||
LVITEM Item;
|
||||
INT Len;
|
||||
while (DriveLen != 0)
|
||||
{
|
||||
LVITEM Item;
|
||||
INT Len;
|
||||
|
||||
Len = lstrlen(DrivePtr) + 1;
|
||||
DriveLen -= Len;
|
||||
Len = lstrlen(DrivePtr) + 1;
|
||||
DriveLen -= Len;
|
||||
|
||||
DrivePtr = _tcsupr(DrivePtr);
|
||||
DrivePtr = _tcsupr(DrivePtr);
|
||||
|
||||
/* copy the 'X:' portion */
|
||||
lstrcpyn(szDrive, DrivePtr, 3);
|
||||
/* copy the 'X:' portion */
|
||||
lstrcpyn(szDrive, DrivePtr, 3);
|
||||
|
||||
if(GetDriveType(DrivePtr) == DRIVE_FIXED)
|
||||
{
|
||||
/* does drive match the one in the registry ? */
|
||||
if(!_tcsncmp(pVirtMem->szPagingFiles, szDrive, 2))
|
||||
{
|
||||
/* FIXME: we only check the first available pagefile in the reg */
|
||||
InitialSize = GetPageFileSizes(pVirtMem->szPagingFiles);
|
||||
MaxSize = GetPageFileSizes(pVirtMem->szPagingFiles);
|
||||
if(GetDriveType(DrivePtr) == DRIVE_FIXED)
|
||||
{
|
||||
/* does drive match the one in the registry ? */
|
||||
if(!_tcsncmp(pVirtMem->szPagingFiles, szDrive, 2))
|
||||
{
|
||||
/* FIXME: we only check the first available pagefile in the reg */
|
||||
InitialSize = GetPageFileSizes(pVirtMem->szPagingFiles);
|
||||
MaxSize = GetPageFileSizes(pVirtMem->szPagingFiles);
|
||||
|
||||
pVirtMem->Pagefile[PgCnt].InitialValue = InitialSize;
|
||||
pVirtMem->Pagefile[PgCnt].MaxValue = MaxSize;
|
||||
pVirtMem->Pagefile[PgCnt].bUsed = TRUE;
|
||||
lstrcpy(pVirtMem->Pagefile[PgCnt].szDrive, szDrive);
|
||||
}
|
||||
else
|
||||
{
|
||||
pVirtMem->Pagefile[PgCnt].InitialValue = 0;
|
||||
pVirtMem->Pagefile[PgCnt].MaxValue = 0;
|
||||
pVirtMem->Pagefile[PgCnt].bUsed = FALSE;
|
||||
lstrcpy(pVirtMem->Pagefile[PgCnt].szDrive, szDrive);
|
||||
}
|
||||
pVirtMem->Pagefile[PgCnt].InitialValue = InitialSize;
|
||||
pVirtMem->Pagefile[PgCnt].MaxValue = MaxSize;
|
||||
pVirtMem->Pagefile[PgCnt].bUsed = TRUE;
|
||||
lstrcpy(pVirtMem->Pagefile[PgCnt].szDrive, szDrive);
|
||||
}
|
||||
else
|
||||
{
|
||||
pVirtMem->Pagefile[PgCnt].InitialValue = 0;
|
||||
pVirtMem->Pagefile[PgCnt].MaxValue = 0;
|
||||
pVirtMem->Pagefile[PgCnt].bUsed = FALSE;
|
||||
lstrcpy(pVirtMem->Pagefile[PgCnt].szDrive, szDrive);
|
||||
}
|
||||
|
||||
/* fill out the listview */
|
||||
ZeroMemory(&Item, sizeof(Item));
|
||||
Item.mask = LVIF_TEXT;
|
||||
Item.iItem = ListView_GetItemCount(pVirtMem->hListView);
|
||||
Item.pszText = szDrive;
|
||||
(void)ListView_InsertItem(pVirtMem->hListView, &Item);
|
||||
/* fill out the listview */
|
||||
ZeroMemory(&Item, sizeof(Item));
|
||||
Item.mask = LVIF_TEXT;
|
||||
Item.iItem = ListView_GetItemCount(pVirtMem->hListView);
|
||||
Item.pszText = szDrive;
|
||||
(void)ListView_InsertItem(pVirtMem->hListView, &Item);
|
||||
|
||||
/* set a volume label if there is one */
|
||||
if (GetVolumeInformation(DrivePtr,
|
||||
szVolume,
|
||||
255,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
0))
|
||||
{
|
||||
if (szVolume[0] != _T('\0'))
|
||||
{
|
||||
TCHAR szVol[MAX_PATH + 2];
|
||||
/* set a volume label if there is one */
|
||||
if (GetVolumeInformation(DrivePtr,
|
||||
szVolume,
|
||||
255,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
0))
|
||||
{
|
||||
if (szVolume[0] != _T('\0'))
|
||||
{
|
||||
TCHAR szVol[MAX_PATH + 2];
|
||||
|
||||
_stprintf(szVol, _T("[%s]"), szVolume);
|
||||
_stprintf(szVol, _T("[%s]"), szVolume);
|
||||
|
||||
Item.iSubItem = 1;
|
||||
Item.pszText = szVol;
|
||||
(void)ListView_InsertItem(pVirtMem->hListView, &Item);
|
||||
}
|
||||
}
|
||||
Item.iSubItem = 1;
|
||||
Item.pszText = szVol;
|
||||
(void)ListView_InsertItem(pVirtMem->hListView, &Item);
|
||||
}
|
||||
}
|
||||
|
||||
if ((InitialSize != 0) || (MaxSize != 0))
|
||||
{
|
||||
TCHAR szSize[64];
|
||||
if ((InitialSize != 0) || (MaxSize != 0))
|
||||
{
|
||||
TCHAR szSize[64];
|
||||
|
||||
_stprintf(szSize, _T("%i - %i"), InitialSize, MaxSize);
|
||||
_stprintf(szSize, _T("%i - %i"), InitialSize, MaxSize);
|
||||
|
||||
Item.iSubItem = 2;
|
||||
Item.pszText = szSize;
|
||||
(void)ListView_InsertItem(pVirtMem->hListView, &Item);
|
||||
}
|
||||
Item.iSubItem = 2;
|
||||
Item.pszText = szSize;
|
||||
(void)ListView_InsertItem(pVirtMem->hListView, &Item);
|
||||
}
|
||||
|
||||
PgCnt++;
|
||||
}
|
||||
PgCnt++;
|
||||
}
|
||||
|
||||
DrivePtr += Len;
|
||||
}
|
||||
DrivePtr += Len;
|
||||
}
|
||||
|
||||
pVirtMem->Count = PgCnt;
|
||||
pVirtMem->Count = PgCnt;
|
||||
}
|
||||
|
||||
|
||||
static VOID
|
||||
WritePageFileSettings(PVIRTMEM pVirtMem)
|
||||
{
|
||||
HKEY hk = NULL;
|
||||
TCHAR szPagingFiles[2048];
|
||||
INT i;
|
||||
INT nPos = 0;
|
||||
BOOL bErr = TRUE;
|
||||
HKEY hk = NULL;
|
||||
TCHAR szPagingFiles[2048];
|
||||
INT i;
|
||||
INT nPos = 0;
|
||||
BOOL bErr = TRUE;
|
||||
|
||||
for(i = 0; i < pVirtMem->Count; ++i)
|
||||
{
|
||||
if(pVirtMem->Pagefile[i].bUsed)
|
||||
{
|
||||
TCHAR szText[256];
|
||||
for(i = 0; i < pVirtMem->Count; ++i)
|
||||
{
|
||||
if(pVirtMem->Pagefile[i].bUsed)
|
||||
{
|
||||
TCHAR szText[256];
|
||||
|
||||
_stprintf(szText, _T("%s\\pagefile.sys %i %i"),
|
||||
pVirtMem->Pagefile[i].szDrive,
|
||||
pVirtMem->Pagefile[i].InitialValue,
|
||||
pVirtMem->Pagefile[i].MaxValue);
|
||||
_stprintf(szText, _T("%s\\pagefile.sys %i %i"),
|
||||
pVirtMem->Pagefile[i].szDrive,
|
||||
pVirtMem->Pagefile[i].InitialValue,
|
||||
pVirtMem->Pagefile[i].MaxValue);
|
||||
|
||||
/* Add it to our overall registry string */
|
||||
lstrcat(szPagingFiles + nPos, szText);
|
||||
/* Add it to our overall registry string */
|
||||
lstrcat(szPagingFiles + nPos, szText);
|
||||
|
||||
/* Record the position where the next string will start */
|
||||
nPos += (INT)lstrlen(szText) + 1;
|
||||
/* Record the position where the next string will start */
|
||||
nPos += (INT)lstrlen(szText) + 1;
|
||||
|
||||
/* add another NULL for REG_MULTI_SZ */
|
||||
szPagingFiles[nPos] = _T('\0');
|
||||
nPos++;
|
||||
}
|
||||
}
|
||||
/* add another NULL for REG_MULTI_SZ */
|
||||
szPagingFiles[nPos] = _T('\0');
|
||||
nPos++;
|
||||
}
|
||||
}
|
||||
|
||||
if(RegCreateKeyEx(HKEY_LOCAL_MACHINE,
|
||||
lpKey,
|
||||
0,
|
||||
NULL,
|
||||
REG_OPTION_NON_VOLATILE,
|
||||
KEY_WRITE,
|
||||
NULL,
|
||||
&hk,
|
||||
NULL) == ERROR_SUCCESS)
|
||||
{
|
||||
if (RegSetValueEx(hk,
|
||||
_T("PagingFiles"),
|
||||
0,
|
||||
REG_MULTI_SZ,
|
||||
(LPBYTE) szPagingFiles,
|
||||
(DWORD) nPos * sizeof(TCHAR)))
|
||||
{
|
||||
bErr = FALSE;
|
||||
}
|
||||
if(RegCreateKeyEx(HKEY_LOCAL_MACHINE,
|
||||
lpKey,
|
||||
0,
|
||||
NULL,
|
||||
REG_OPTION_NON_VOLATILE,
|
||||
KEY_WRITE,
|
||||
NULL,
|
||||
&hk,
|
||||
NULL) == ERROR_SUCCESS)
|
||||
{
|
||||
if (RegSetValueEx(hk,
|
||||
_T("PagingFiles"),
|
||||
0,
|
||||
REG_MULTI_SZ,
|
||||
(LPBYTE) szPagingFiles,
|
||||
(DWORD) nPos * sizeof(TCHAR)))
|
||||
{
|
||||
bErr = FALSE;
|
||||
}
|
||||
|
||||
RegCloseKey(hk);
|
||||
}
|
||||
RegCloseKey(hk);
|
||||
}
|
||||
|
||||
if (bErr)
|
||||
ShowLastWin32Error(pVirtMem->hSelf);
|
||||
if (bErr)
|
||||
ShowLastWin32Error(pVirtMem->hSelf);
|
||||
}
|
||||
|
||||
|
||||
static VOID
|
||||
SetListViewColumns(HWND hwndListView)
|
||||
{
|
||||
RECT rect;
|
||||
LV_COLUMN lvc;
|
||||
RECT rect;
|
||||
LV_COLUMN lvc;
|
||||
|
||||
GetClientRect(hwndListView, &rect);
|
||||
GetClientRect(hwndListView, &rect);
|
||||
|
||||
(void)ListView_SetExtendedListViewStyle(hwndListView,
|
||||
LVS_EX_FULLROWSELECT);
|
||||
(void)ListView_SetExtendedListViewStyle(hwndListView,
|
||||
LVS_EX_FULLROWSELECT);
|
||||
|
||||
ZeroMemory(&lvc, sizeof(lvc));
|
||||
lvc.mask = LVCF_SUBITEM | LVCF_WIDTH | LVCF_FMT;
|
||||
lvc.fmt = LVCFMT_LEFT;
|
||||
ZeroMemory(&lvc, sizeof(lvc));
|
||||
lvc.mask = LVCF_SUBITEM | LVCF_WIDTH | LVCF_FMT;
|
||||
lvc.fmt = LVCFMT_LEFT;
|
||||
|
||||
lvc.cx = (INT)((rect.right - rect.left) * 0.1);
|
||||
lvc.iSubItem = 0;
|
||||
(void)ListView_InsertColumn(hwndListView, 0, &lvc);
|
||||
lvc.cx = (INT)((rect.right - rect.left) * 0.1);
|
||||
lvc.iSubItem = 0;
|
||||
(void)ListView_InsertColumn(hwndListView, 0, &lvc);
|
||||
|
||||
lvc.cx = (INT)((rect.right - rect.left) * 0.3);
|
||||
lvc.iSubItem = 1;
|
||||
(void)ListView_InsertColumn(hwndListView, 1, &lvc);
|
||||
lvc.cx = (INT)((rect.right - rect.left) * 0.3);
|
||||
lvc.iSubItem = 1;
|
||||
(void)ListView_InsertColumn(hwndListView, 1, &lvc);
|
||||
|
||||
lvc.cx = (INT)((rect.right - rect.left) * 0.6);
|
||||
lvc.iSubItem = 2;
|
||||
(void)ListView_InsertColumn(hwndListView, 2, &lvc);
|
||||
lvc.cx = (INT)((rect.right - rect.left) * 0.6);
|
||||
lvc.iSubItem = 2;
|
||||
(void)ListView_InsertColumn(hwndListView, 2, &lvc);
|
||||
}
|
||||
|
||||
|
||||
static VOID
|
||||
OnNoPagingFile(PVIRTMEM pVirtMem)
|
||||
{
|
||||
/* Disable the page file custom size boxes */
|
||||
EnableWindow(GetDlgItem(pVirtMem->hSelf, IDC_INITIALSIZE), FALSE);
|
||||
EnableWindow(GetDlgItem(pVirtMem->hSelf, IDC_MAXSIZE), FALSE);
|
||||
/* Disable the page file custom size boxes */
|
||||
EnableWindow(GetDlgItem(pVirtMem->hSelf, IDC_INITIALSIZE), FALSE);
|
||||
EnableWindow(GetDlgItem(pVirtMem->hSelf, IDC_MAXSIZE), FALSE);
|
||||
}
|
||||
|
||||
|
||||
static VOID
|
||||
OnSysManSize(PVIRTMEM pVirtMem)
|
||||
{
|
||||
/* Disable the page file custom size boxes */
|
||||
EnableWindow(GetDlgItem(pVirtMem->hSelf, IDC_INITIALSIZE), FALSE);
|
||||
EnableWindow(GetDlgItem(pVirtMem->hSelf, IDC_MAXSIZE), FALSE);
|
||||
/* Disable the page file custom size boxes */
|
||||
EnableWindow(GetDlgItem(pVirtMem->hSelf, IDC_INITIALSIZE), FALSE);
|
||||
EnableWindow(GetDlgItem(pVirtMem->hSelf, IDC_MAXSIZE), FALSE);
|
||||
}
|
||||
|
||||
|
||||
static VOID
|
||||
OnCustom(PVIRTMEM pVirtMem)
|
||||
{
|
||||
/* Enable the page file custom size boxes */
|
||||
EnableWindow(GetDlgItem(pVirtMem->hSelf, IDC_INITIALSIZE), TRUE);
|
||||
EnableWindow(GetDlgItem(pVirtMem->hSelf, IDC_MAXSIZE), TRUE);
|
||||
/* Enable the page file custom size boxes */
|
||||
EnableWindow(GetDlgItem(pVirtMem->hSelf, IDC_INITIALSIZE), TRUE);
|
||||
EnableWindow(GetDlgItem(pVirtMem->hSelf, IDC_MAXSIZE), TRUE);
|
||||
}
|
||||
|
||||
|
||||
static VOID
|
||||
OnSet(PVIRTMEM pVirtMem)
|
||||
{
|
||||
INT Index;
|
||||
INT Index;
|
||||
|
||||
pVirtMem->bSave = TRUE;
|
||||
pVirtMem->bSave = TRUE;
|
||||
|
||||
Index = (INT)SendDlgItemMessage(pVirtMem->hSelf,
|
||||
IDC_PAGEFILELIST,
|
||||
LB_GETCURSEL,
|
||||
0,
|
||||
0);
|
||||
Index = (INT)SendDlgItemMessage(pVirtMem->hSelf,
|
||||
IDC_PAGEFILELIST,
|
||||
LB_GETCURSEL,
|
||||
0,
|
||||
0);
|
||||
|
||||
if(Index < pVirtMem->Count)
|
||||
{
|
||||
TCHAR szText[255];
|
||||
if(Index < pVirtMem->Count)
|
||||
{
|
||||
TCHAR szText[255];
|
||||
|
||||
/* check if custom settings are checked */
|
||||
if(SendDlgItemMessage(pVirtMem->hSelf,
|
||||
IDC_CUSTOM,
|
||||
BM_GETCHECK,
|
||||
0,
|
||||
0) == BST_CHECKED)
|
||||
{
|
||||
SendDlgItemMessage(pVirtMem->hSelf,
|
||||
IDC_INITIALSIZE,
|
||||
WM_GETTEXT,
|
||||
254,
|
||||
(LPARAM)szText);
|
||||
pVirtMem->Pagefile[Index].InitialValue = _ttoi(szText);
|
||||
/* check if custom settings are checked */
|
||||
if(SendDlgItemMessage(pVirtMem->hSelf,
|
||||
IDC_CUSTOM,
|
||||
BM_GETCHECK,
|
||||
0,
|
||||
0) == BST_CHECKED)
|
||||
{
|
||||
SendDlgItemMessage(pVirtMem->hSelf,
|
||||
IDC_INITIALSIZE,
|
||||
WM_GETTEXT,
|
||||
254,
|
||||
(LPARAM)szText);
|
||||
pVirtMem->Pagefile[Index].InitialValue = _ttoi(szText);
|
||||
|
||||
SendDlgItemMessage(pVirtMem->hSelf,
|
||||
IDC_MAXSIZE,
|
||||
WM_GETTEXT,
|
||||
254,
|
||||
(LPARAM)szText);
|
||||
pVirtMem->Pagefile[Index].MaxValue = _ttoi(szText);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* set sizes to 0 */
|
||||
pVirtMem->Pagefile[Index].InitialValue = pVirtMem->Pagefile[Index].MaxValue = 0;
|
||||
SendDlgItemMessage(pVirtMem->hSelf,
|
||||
IDC_MAXSIZE,
|
||||
WM_GETTEXT,
|
||||
254,
|
||||
(LPARAM)szText);
|
||||
pVirtMem->Pagefile[Index].MaxValue = _ttoi(szText);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* set sizes to 0 */
|
||||
pVirtMem->Pagefile[Index].InitialValue = pVirtMem->Pagefile[Index].MaxValue = 0;
|
||||
|
||||
// check to see if this drive is used for a paging file
|
||||
if (SendDlgItemMessage(pVirtMem->hSelf,
|
||||
IDC_NOPAGEFILE,
|
||||
BM_GETCHECK,
|
||||
0,
|
||||
0) == BST_UNCHECKED)
|
||||
{
|
||||
pVirtMem->Pagefile[Index].bUsed = TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
pVirtMem->Pagefile[Index].bUsed = FALSE;
|
||||
}
|
||||
}
|
||||
}
|
||||
// check to see if this drive is used for a paging file
|
||||
if (SendDlgItemMessage(pVirtMem->hSelf,
|
||||
IDC_NOPAGEFILE,
|
||||
BM_GETCHECK,
|
||||
0,
|
||||
0) == BST_UNCHECKED)
|
||||
{
|
||||
pVirtMem->Pagefile[Index].bUsed = TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
pVirtMem->Pagefile[Index].bUsed = FALSE;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -366,135 +365,135 @@ static BOOL
|
|||
OnSelChange(PVIRTMEM pVirtMem,
|
||||
LPNMLISTVIEW pnmv)
|
||||
{
|
||||
TCHAR szCustVals[255];
|
||||
INT Index;
|
||||
TCHAR szCustVals[255];
|
||||
INT Index;
|
||||
|
||||
UNREFERENCED_PARAMETER(pnmv);
|
||||
UNREFERENCED_PARAMETER(pnmv);
|
||||
|
||||
Index = (INT)SendDlgItemMessage(pVirtMem->hSelf,
|
||||
IDC_PAGEFILELIST,
|
||||
LB_GETCURSEL,
|
||||
0,
|
||||
0);
|
||||
Index = (INT)SendDlgItemMessage(pVirtMem->hSelf,
|
||||
IDC_PAGEFILELIST,
|
||||
LB_GETCURSEL,
|
||||
0,
|
||||
0);
|
||||
|
||||
if(Index < pVirtMem->Count)
|
||||
{
|
||||
if(Index < pVirtMem->Count)
|
||||
{
|
||||
|
||||
if(pVirtMem->Pagefile[Index].InitialValue != 0 &&
|
||||
pVirtMem->Pagefile[Index].MaxValue != 0)
|
||||
{
|
||||
/* enable and fill the custom values */
|
||||
EnableWindow(GetDlgItem(pVirtMem->hSelf, IDC_MAXSIZE), TRUE);
|
||||
EnableWindow(GetDlgItem(pVirtMem->hSelf, IDC_INITIALSIZE), TRUE);
|
||||
if(pVirtMem->Pagefile[Index].InitialValue != 0 &&
|
||||
pVirtMem->Pagefile[Index].MaxValue != 0)
|
||||
{
|
||||
/* enable and fill the custom values */
|
||||
EnableWindow(GetDlgItem(pVirtMem->hSelf, IDC_MAXSIZE), TRUE);
|
||||
EnableWindow(GetDlgItem(pVirtMem->hSelf, IDC_INITIALSIZE), TRUE);
|
||||
|
||||
_itot(pVirtMem->Pagefile[Index].InitialValue , szCustVals, 10);
|
||||
SendDlgItemMessage(pVirtMem->hSelf,
|
||||
IDC_INITIALSIZE,
|
||||
WM_SETTEXT,
|
||||
0,
|
||||
(LPARAM)szCustVals);
|
||||
_itot(pVirtMem->Pagefile[Index].InitialValue , szCustVals, 10);
|
||||
SendDlgItemMessage(pVirtMem->hSelf,
|
||||
IDC_INITIALSIZE,
|
||||
WM_SETTEXT,
|
||||
0,
|
||||
(LPARAM)szCustVals);
|
||||
|
||||
_itot(pVirtMem->Pagefile[Index].MaxValue, szCustVals, 10);
|
||||
SendDlgItemMessage(pVirtMem->hSelf,
|
||||
IDC_MAXSIZE,
|
||||
WM_SETTEXT,
|
||||
0,
|
||||
(LPARAM)szCustVals);
|
||||
_itot(pVirtMem->Pagefile[Index].MaxValue, szCustVals, 10);
|
||||
SendDlgItemMessage(pVirtMem->hSelf,
|
||||
IDC_MAXSIZE,
|
||||
WM_SETTEXT,
|
||||
0,
|
||||
(LPARAM)szCustVals);
|
||||
|
||||
SendDlgItemMessage(pVirtMem->hSelf,
|
||||
IDC_CUSTOM,
|
||||
BM_SETCHECK,
|
||||
1,
|
||||
0);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* It's not a custom value */
|
||||
EnableWindow(GetDlgItem(pVirtMem->hSelf, IDC_MAXSIZE), FALSE);
|
||||
EnableWindow(GetDlgItem(pVirtMem->hSelf, IDC_INITIALSIZE), FALSE);
|
||||
SendDlgItemMessage(pVirtMem->hSelf,
|
||||
IDC_CUSTOM,
|
||||
BM_SETCHECK,
|
||||
1,
|
||||
0);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* It's not a custom value */
|
||||
EnableWindow(GetDlgItem(pVirtMem->hSelf, IDC_MAXSIZE), FALSE);
|
||||
EnableWindow(GetDlgItem(pVirtMem->hSelf, IDC_INITIALSIZE), FALSE);
|
||||
|
||||
/* is it system managed */
|
||||
if(pVirtMem->Pagefile[Index].bUsed)
|
||||
{
|
||||
SendDlgItemMessage(pVirtMem->hSelf,
|
||||
IDC_SYSMANSIZE,
|
||||
BM_SETCHECK,
|
||||
1,
|
||||
0);
|
||||
}
|
||||
else
|
||||
{
|
||||
SendDlgItemMessage(pVirtMem->hSelf,
|
||||
IDC_NOPAGEFILE,
|
||||
BM_SETCHECK,
|
||||
1,
|
||||
0);
|
||||
}
|
||||
}
|
||||
}
|
||||
/* is it system managed */
|
||||
if(pVirtMem->Pagefile[Index].bUsed)
|
||||
{
|
||||
SendDlgItemMessage(pVirtMem->hSelf,
|
||||
IDC_SYSMANSIZE,
|
||||
BM_SETCHECK,
|
||||
1,
|
||||
0);
|
||||
}
|
||||
else
|
||||
{
|
||||
SendDlgItemMessage(pVirtMem->hSelf,
|
||||
IDC_NOPAGEFILE,
|
||||
BM_SETCHECK,
|
||||
1,
|
||||
0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
static VOID
|
||||
OnOk(PVIRTMEM pVirtMem)
|
||||
{
|
||||
if(pVirtMem->bSave == TRUE)
|
||||
{
|
||||
WritePageFileSettings(pVirtMem);
|
||||
}
|
||||
if(pVirtMem->bSave == TRUE)
|
||||
{
|
||||
WritePageFileSettings(pVirtMem);
|
||||
}
|
||||
|
||||
if (pVirtMem->szPagingFiles)
|
||||
HeapFree(GetProcessHeap(),
|
||||
0,
|
||||
pVirtMem->szPagingFiles);
|
||||
if (pVirtMem->szPagingFiles)
|
||||
HeapFree(GetProcessHeap(),
|
||||
0,
|
||||
pVirtMem->szPagingFiles);
|
||||
|
||||
HeapFree(GetProcessHeap(),
|
||||
0,
|
||||
pVirtMem);
|
||||
HeapFree(GetProcessHeap(),
|
||||
0,
|
||||
pVirtMem);
|
||||
}
|
||||
|
||||
|
||||
static VOID
|
||||
OnCancel(PVIRTMEM pVirtMem)
|
||||
{
|
||||
if (pVirtMem->szPagingFiles)
|
||||
HeapFree(GetProcessHeap(),
|
||||
0,
|
||||
pVirtMem->szPagingFiles);
|
||||
if (pVirtMem->szPagingFiles)
|
||||
HeapFree(GetProcessHeap(),
|
||||
0,
|
||||
pVirtMem->szPagingFiles);
|
||||
|
||||
HeapFree(GetProcessHeap(),
|
||||
0,
|
||||
pVirtMem);
|
||||
HeapFree(GetProcessHeap(),
|
||||
0,
|
||||
pVirtMem);
|
||||
}
|
||||
|
||||
|
||||
static PVIRTMEM
|
||||
OnInitDialog(HWND hwnd)
|
||||
{
|
||||
PVIRTMEM pVirtMem = (PVIRTMEM)HeapAlloc(GetProcessHeap(),
|
||||
HEAP_ZERO_MEMORY,
|
||||
sizeof(VIRTMEM));
|
||||
if (pVirtMem == NULL)
|
||||
{
|
||||
EndDialog(hwnd, 0);
|
||||
}
|
||||
PVIRTMEM pVirtMem = (PVIRTMEM)HeapAlloc(GetProcessHeap(),
|
||||
HEAP_ZERO_MEMORY,
|
||||
sizeof(VIRTMEM));
|
||||
if (pVirtMem == NULL)
|
||||
{
|
||||
EndDialog(hwnd, 0);
|
||||
}
|
||||
|
||||
pVirtMem->hSelf = hwnd;
|
||||
pVirtMem->hListView = GetDlgItem(hwnd, IDC_PAGEFILELIST);
|
||||
pVirtMem->bSave = FALSE;
|
||||
pVirtMem->hSelf = hwnd;
|
||||
pVirtMem->hListView = GetDlgItem(hwnd, IDC_PAGEFILELIST);
|
||||
pVirtMem->bSave = FALSE;
|
||||
|
||||
SetListViewColumns(pVirtMem->hListView);
|
||||
SetListViewColumns(pVirtMem->hListView);
|
||||
|
||||
/* Load the pagefile systems from the reg */
|
||||
if (ReadPageFileSettings(pVirtMem))
|
||||
{
|
||||
/* Parse our settings and set up dialog */
|
||||
ParseMemSettings(pVirtMem);
|
||||
}
|
||||
/* Load the pagefile systems from the reg */
|
||||
if (ReadPageFileSettings(pVirtMem))
|
||||
{
|
||||
/* Parse our settings and set up dialog */
|
||||
ParseMemSettings(pVirtMem);
|
||||
}
|
||||
|
||||
return pVirtMem;
|
||||
return pVirtMem;
|
||||
}
|
||||
|
||||
|
||||
|
@ -504,67 +503,66 @@ VirtMemDlgProc(HWND hwndDlg,
|
|||
WPARAM wParam,
|
||||
LPARAM lParam)
|
||||
{
|
||||
/* there can only be one instance of this dialog */
|
||||
static PVIRTMEM pVirtMem = NULL;
|
||||
/* there can only be one instance of this dialog */
|
||||
static PVIRTMEM pVirtMem = NULL;
|
||||
|
||||
UNREFERENCED_PARAMETER(lParam);
|
||||
UNREFERENCED_PARAMETER(lParam);
|
||||
|
||||
switch (uMsg)
|
||||
{
|
||||
case WM_INITDIALOG:
|
||||
pVirtMem = OnInitDialog(hwndDlg);
|
||||
break;
|
||||
switch (uMsg)
|
||||
{
|
||||
case WM_INITDIALOG:
|
||||
pVirtMem = OnInitDialog(hwndDlg);
|
||||
break;
|
||||
|
||||
case WM_COMMAND:
|
||||
{
|
||||
switch (LOWORD(wParam))
|
||||
{
|
||||
case IDCANCEL:
|
||||
OnCancel(pVirtMem);
|
||||
EndDialog(hwndDlg, 0);
|
||||
return TRUE;
|
||||
case WM_COMMAND:
|
||||
{
|
||||
switch (LOWORD(wParam))
|
||||
{
|
||||
case IDCANCEL:
|
||||
OnCancel(pVirtMem);
|
||||
EndDialog(hwndDlg, 0);
|
||||
return TRUE;
|
||||
|
||||
case IDOK:
|
||||
OnOk(pVirtMem);
|
||||
EndDialog(hwndDlg, 0);
|
||||
return TRUE;
|
||||
case IDOK:
|
||||
OnOk(pVirtMem);
|
||||
EndDialog(hwndDlg, 0);
|
||||
return TRUE;
|
||||
|
||||
case IDC_NOPAGEFILE:
|
||||
OnNoPagingFile(pVirtMem);
|
||||
return TRUE;
|
||||
case IDC_NOPAGEFILE:
|
||||
OnNoPagingFile(pVirtMem);
|
||||
return TRUE;
|
||||
|
||||
case IDC_SYSMANSIZE:
|
||||
OnSysManSize(pVirtMem);
|
||||
return TRUE;
|
||||
case IDC_SYSMANSIZE:
|
||||
OnSysManSize(pVirtMem);
|
||||
return TRUE;
|
||||
|
||||
case IDC_CUSTOM:
|
||||
OnCustom(pVirtMem);
|
||||
return TRUE;
|
||||
case IDC_CUSTOM:
|
||||
OnCustom(pVirtMem);
|
||||
return TRUE;
|
||||
|
||||
case IDC_SET:
|
||||
OnSet(pVirtMem);
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case IDC_SET:
|
||||
OnSet(pVirtMem);
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case WM_NOTIFY:
|
||||
{
|
||||
LPNMHDR pnmhdr = (LPNMHDR)lParam;
|
||||
case WM_NOTIFY:
|
||||
{
|
||||
LPNMHDR pnmhdr = (LPNMHDR)lParam;
|
||||
|
||||
switch (pnmhdr->code)
|
||||
{
|
||||
case LVN_ITEMCHANGED:
|
||||
{
|
||||
LPNMLISTVIEW pnmv = (LPNMLISTVIEW) lParam;
|
||||
switch (pnmhdr->code)
|
||||
{
|
||||
case LVN_ITEMCHANGED:
|
||||
{
|
||||
LPNMLISTVIEW pnmv = (LPNMLISTVIEW) lParam;
|
||||
|
||||
OnSelChange(pVirtMem, pnmv);
|
||||
OnSelChange(pVirtMem, pnmv);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
return FALSE;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue