[ACPPAGE] Make use of the PCH.
[reactos.git] / dll / cpl / console / console.c
index 17f6c91..d2cd2d7 100644 (file)
@@ -88,9 +88,9 @@ VOID
 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)
@@ -210,6 +210,11 @@ InitApplet(HANDLE hSectionOrWnd)
         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);
@@ -227,9 +232,9 @@ InitApplet(HANDLE hSectionOrWnd)
     }
     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
@@ -250,8 +255,16 @@ InitApplet(HANDLE hSectionOrWnd)
     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;
@@ -286,9 +299,7 @@ InitApplet(HANDLE hSectionOrWnd)
         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);
@@ -299,7 +310,7 @@ InitApplet(HANDLE hSectionOrWnd)
         /* Default settings saved when ConInfo->hWnd == NULL */
         ConCfgWriteUserSettings(ConInfo, ConInfo->hWnd == NULL);
     }
-    
+
 Quit:
     /* Cleanup */
     HeapFree(GetProcessHeap(), 0, ConInfo);