#include <regedit.h>
-BOOL ProcessCmdLine(LPSTR lpCmdLine);
+BOOL ProcessCmdLine(LPWSTR lpCmdLine);
/*******************************************************************************
WNDCLASSEX wcFrame;
WNDCLASSEX wcChild;
ATOM hFrameWndClass;
- ATOM hChildWndClass;
ZeroMemory(&wcFrame, sizeof(WNDCLASSEX));
wcFrame.cbSize = sizeof(WNDCLASSEX);
wcChild.hIconSm = (HICON)LoadImage(hInstance, MAKEINTRESOURCE(IDI_REGEDIT), IMAGE_ICON,
GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), LR_SHARED);
- hChildWndClass = RegisterClassEx(&wcChild); /* register child windows class */
+ RegisterClassEx(&wcChild); /* register child windows class */
RegisterHexEditorClass(hInstance);
}
/* Restore position */
- if (RegQueryStringValue(HKEY_CURRENT_USER, g_szGeneralRegKey,
- _T("LastKey"),
- szBuffer, sizeof(szBuffer) / sizeof(szBuffer[0])) == ERROR_SUCCESS)
+ if (QueryStringValue(HKEY_CURRENT_USER, g_szGeneralRegKey, _T("LastKey"),
+ szBuffer, COUNT_OF(szBuffer)) == ERROR_SUCCESS)
{
SelectNode(g_pChildWnd->hTreeWnd, szBuffer);
}
return TRUE;
}
-int APIENTRY WinMain(HINSTANCE hInstance,
- HINSTANCE hPrevInstance,
- LPSTR lpCmdLine,
- int nCmdShow)
+int APIENTRY wWinMain(HINSTANCE hInstance,
+ HINSTANCE hPrevInstance,
+ LPWSTR lpCmdLine,
+ int nCmdShow)
{
MSG msg;
HACCEL hAccel;
UNREFERENCED_PARAMETER(hPrevInstance);
- /*
- int hCrt;
- FILE *hf;
- AllocConsole();
- hCrt = _open_osfhandle((long)GetStdHandle(STD_OUTPUT_HANDLE), _O_TEXT);
- hf = _fdopen(hCrt, "w");
- *stdout = *hf;
- setvbuf(stdout, NULL, _IONBF, 0);
-
- wprintf(L"command line exit, hInstance = %d\n", hInstance);
- getch();
- FreeConsole();
- return 0;
- */
-
if (ProcessCmdLine(lpCmdLine)) {
return 0;
}