[INETCPL] Sync with Wine Staging 4.18. CORE-16441
[reactos.git] / dll / cpl / inetcpl / inetcpl.c
index 458dd3a..41d6660 100644 (file)
 #define NONAMELESSUNION
 #define COBJMACROS
 #define CONST_VTABLE
-#define WIN32_NO_STATUS
-#define _INC_WINDOWS
-#define COM_NO_WINDOWS_H
 
 #include <stdarg.h>
 #include <windef.h>
 #include <winbase.h>
-//#include <wingdi.h>
+#include <wingdi.h>
 #include <winuser.h>
-//#include <commctrl.h>
+#include <commctrl.h>
 #include <cpl.h>
-#include <ole2.h>
+#include "ole2.h"
 
-#include <wine/debug.h>
+#include "wine/debug.h"
 
 #include "inetcpl.h"
 
+
 WINE_DEFAULT_DEBUG_CHANNEL(inetcpl);
 
 DECLSPEC_HIDDEN HMODULE hcpl;
@@ -52,8 +50,10 @@ BOOL WINAPI DllMain(HINSTANCE hdll, DWORD reason, LPVOID reserved)
 
     switch (reason)
     {
-        /* case DLL_WINE_PREATTACH:
-            return FALSE;  prefer native version */
+#ifndef __REACTOS__
+        case DLL_WINE_PREATTACH:
+            return FALSE;  /* prefer native version */
+#endif
 
         case DLL_PROCESS_ATTACH:
             DisableThreadLibraryCalls(hdll);
@@ -62,19 +62,39 @@ BOOL WINAPI DllMain(HINSTANCE hdll, DWORD reason, LPVOID reserved)
     return TRUE;
 }
 
+/***********************************************************************
+ *  DllInstall (inetcpl.@)
+ */
+HRESULT WINAPI DllInstall(BOOL bInstall, LPCWSTR cmdline)
+{
+    FIXME("(%s, %s): stub\n", bInstall ? "TRUE" : "FALSE", debugstr_w(cmdline));
+    return S_OK;
+}
+
 /******************************************************************************
  * propsheet_callback [internal]
  *
  */
 static int CALLBACK propsheet_callback(HWND hwnd, UINT msg, LPARAM lparam)
 {
-
+#ifdef __REACTOS__
+    // NOTE: This callback is needed to set large icon correctly.
+    HICON hIcon;
+#endif
     TRACE("(%p, 0x%08x/%d, 0x%lx)\n", hwnd, msg, msg, lparam);
     switch (msg)
     {
         case PSCB_INITIALIZED:
+#ifdef __REACTOS__
+        {
+            hIcon = LoadIconW(hcpl, MAKEINTRESOURCEW(ICO_MAIN));
+            SendMessageW(hwnd, WM_SETICON, ICON_BIG, (LPARAM)hIcon);
+            break;
+        }
+#else
             SendMessageW(hwnd, WM_SETICON, ICON_BIG, (LPARAM) LoadIconW(hcpl, MAKEINTRESOURCEW(ICO_MAIN)));
             break;
+#endif
     }
     return 0;
 }
@@ -120,6 +140,12 @@ static void display_cpl_sheets(HWND parent)
     psp[id].pfnDlgProc = content_dlgproc;
     id++;
 
+    psp[id].dwSize = sizeof (PROPSHEETPAGEW);
+    psp[id].hInstance = hcpl;
+    psp[id].u.pszTemplate = MAKEINTRESOURCEW(IDD_CONNECTIONS);
+    psp[id].pfnDlgProc = connections_dlgproc;
+    id++;
+
     /* Fill out the PROPSHEETHEADER */
     psh.dwSize = sizeof (PROPSHEETHEADERW);
     psh.dwFlags = PSH_PROPSHEETPAGE | PSH_USEICONID | PSH_USECALLBACK;
@@ -203,3 +229,23 @@ BOOL WINAPI LaunchInternetControlPanel(HWND parent)
     display_cpl_sheets(parent);
     return TRUE;
 }
+
+/*********************************************************************
+ * LaunchConnectionDialog (inetcpl.@)
+ *
+ */
+BOOL WINAPI LaunchConnectionDialog(HWND hParent)
+{
+    FIXME("(%p): stub\n", hParent);
+    return FALSE;
+}
+
+/*********************************************************************
+ * LaunchInternetControlPanel (inetcpl.@)
+ *
+ */
+BOOL WINAPI LaunchPrivacyDialog(HWND hParent)
+{
+    FIXME("(%p): stub\n", hParent);
+    return FALSE;
+}