[DEVMGR][NETCFGX][MSCONFIG][NETSHELL] Fix and improve icons (#1143)
[reactos.git] / dll / win32 / netcfgx / tcpipconf_notify.c
index 3d8f2fd..0fa79d8 100644 (file)
@@ -2090,6 +2090,23 @@ TcpipAdvancedDnsDlg(
     return FALSE;
 }
 
+static int CALLBACK
+PropSheetProc(HWND hwndDlg, UINT uMsg, LPARAM lParam)
+{
+    // NOTE: This callback is needed to set large icon correctly.
+    HICON hIcon;
+    switch (uMsg)
+    {
+        case PSCB_INITIALIZED:
+        {
+            hIcon = LoadIconW(netcfgx_hInstance, MAKEINTRESOURCEW(IDI_NETWORK));
+            SendMessageW(hwndDlg, WM_SETICON, ICON_BIG, (LPARAM)hIcon);
+            break;
+        }
+    }
+    return 0;
+}
+
 VOID
 LaunchAdvancedTcpipSettings(
     HWND hwndDlg,
@@ -2111,11 +2128,15 @@ LaunchAdvancedTcpipSettings(
 
     ZeroMemory(&pinfo, sizeof(PROPSHEETHEADERW));
     pinfo.dwSize = sizeof(PROPSHEETHEADERW);
-    pinfo.dwFlags = PSH_NOCONTEXTHELP | PSH_PROPTITLE | PSH_NOAPPLYNOW;
+    pinfo.dwFlags = PSH_NOCONTEXTHELP | PSH_PROPTITLE | PSH_NOAPPLYNOW |
+                    PSH_USEICONID | PSH_USECALLBACK;
     pinfo.u3.phpage = hppages;
     pinfo.nPages = 3;
     pinfo.hwndParent = hwndDlg;
+    pinfo.hInstance = netcfgx_hInstance;
     pinfo.pszCaption = szBuffer;
+    pinfo.u.pszIcon = MAKEINTRESOURCEW(IDI_NETWORK);
+    pinfo.pfnCallback = PropSheetProc;
 
     StoreTcpipBasicSettings(hwndDlg, This, FALSE);
     PropertySheetW(&pinfo);