ApplyConsoleInfo(HWND hwndDlg)
{
static BOOL ConsoleInfoAlreadySaved = FALSE;
-
+
/*
- * We alread applied all the console properties (and saved if needed).
+ * We already applied all the console properties (and saved if needed).
* Nothing more needs to be done.
*/
if (ConsoleInfoAlreadySaved)
InitDefaultConsoleInfo(ConInfo);
}
+ /* Initialize the font support */
+ hCurrentFont = CreateConsoleFont(ConInfo);
+ if (hCurrentFont == NULL)
+ DPRINT1("InitApplet: CreateConsoleFont failed\n");
+
/* Initialize the property sheet structure */
ZeroMemory(&psh, sizeof(psh));
psh.dwSize = sizeof(psh);
}
psh.pszCaption = szTitle;
- if (/* pSharedInfo != NULL && */ ConInfo->hWnd != NULL)
+ if (pSharedInfo != NULL)
{
- /* We were started from a console window: this is our parent. */
+ /* We were started from a console window: this is our parent (or ConInfo->hWnd is NULL) */
psh.hwndParent = ConInfo->hWnd;
}
else
InitPropSheetPage(&psp[i++], IDD_PROPPAGELAYOUT , LayoutProc );
InitPropSheetPage(&psp[i++], IDD_PROPPAGECOLORS , ColorsProc );
+ /* Display the property sheet */
+ RegisterWinPrevClass(hApplet);
Result = PropertySheetW(&psh);
-
+ UnRegisterWinPrevClass(hApplet);
+
+ /* First cleanup */
+ if (hCurrentFont) DeleteObject(hCurrentFont);
+ hCurrentFont = NULL;
+
+ /* Save the console settings */
if (SetConsoleInfo)
{
HANDLE hSection;
UnmapViewOfFile(pSharedInfo);
/* Signal to CONSRV that it can apply the new configuration */
- SendMessage(ConInfo->hWnd,
- WM_SETCONSOLEINFO,
- (WPARAM)hSection, 0);
+ SendMessageW(ConInfo->hWnd, WM_SETCONSOLEINFO, (WPARAM)hSection, 0);
/* Close the section and return */
CloseHandle(hSection);
/* Default settings saved when ConInfo->hWnd == NULL */
ConCfgWriteUserSettings(ConInfo, ConInfo->hWnd == NULL);
}
-
+
Quit:
/* Cleanup */
HeapFree(GetProcessHeap(), 0, ConInfo);