[RSHELL]
[reactos.git] / dll / win32 / shell32 / shell32_main.cpp
index 32ab14e..9d39b1b 100644 (file)
@@ -20,6 +20,7 @@
  */
 
 #include "precomp.h"
+
 #include "shell32_version.h"
 #include <reactos/version.h>
 
@@ -467,7 +468,7 @@ DWORD_PTR WINAPI SHGetFileInfoW(LPCWSTR path,DWORD dwFileAttributes,
         /* get the parent shellfolder */
         if (pidl)
         {
-            hr = SHBindToParent( pidl, IID_IShellFolder, (LPVOID*)&psfParent,
+            hr = SHBindToParent( pidl, IID_PPV_ARG(IShellFolder, &psfParent),
                                 (LPCITEMIDLIST*)&pidlLast );
             if (SUCCEEDED(hr))
                 pidlLast = ILClone(pidlLast);
@@ -565,7 +566,7 @@ DWORD_PTR WINAPI SHGetFileInfoW(LPCWSTR path,DWORD dwFileAttributes,
     /* get the iconlocation */
     if (SUCCEEDED(hr) && (flags & SHGFI_ICONLOCATION ))
     {
-        UINT uDummy,uFlags;
+        UINT uFlags;
 
         if (flags & SHGFI_USEFILEATTRIBUTES)
         {
@@ -584,7 +585,7 @@ DWORD_PTR WINAPI SHGetFileInfoW(LPCWSTR path,DWORD dwFileAttributes,
                 TRACE("szExt=%s\n", debugstr_w(szExt));
                 if ( szExt &&
                      HCR_MapTypeToValueW(szExt, sTemp, MAX_PATH, TRUE) &&
-                     HCR_GetDefaultIconW(sTemp, sTemp, MAX_PATH, &psfi->iIcon))
+                     HCR_GetIconW(sTemp, sTemp, NULL, MAX_PATH, &psfi->iIcon))
                 {
                     if (lstrcmpW(p1W, sTemp))
                         wcscpy(psfi->szDisplayName, sTemp);
@@ -601,8 +602,7 @@ DWORD_PTR WINAPI SHGetFileInfoW(LPCWSTR path,DWORD dwFileAttributes,
         else
         {
             hr = psfParent->GetUIObjectOf(0, 1,
-                (LPCITEMIDLIST*)&pidlLast, IID_IExtractIconW,
-                &uDummy, (LPVOID*)&pei);
+                (LPCITEMIDLIST*)&pidlLast, IID_NULL_PPV_ARG(IExtractIconW, &pei));
             if (SUCCEEDED(hr))
             {
                 hr = pei->GetIconLocation(uGilFlags,
@@ -640,7 +640,7 @@ DWORD_PTR WINAPI SHGetFileInfoW(LPCWSTR path,DWORD dwFileAttributes,
                 szExt = PathFindExtensionW(sTemp);
                 if ( szExt &&
                      HCR_MapTypeToValueW(szExt, sTemp, MAX_PATH, TRUE) &&
-                     HCR_GetDefaultIconW(sTemp, sTemp, MAX_PATH, &icon_idx))
+                     HCR_GetIconW(sTemp, sTemp, NULL, MAX_PATH, &icon_idx))
                 {
                     if (!lstrcmpW(p1W,sTemp))            /* icon is in the file */
                         wcscpy(sTemp, szFullPath);
@@ -752,7 +752,7 @@ DWORD_PTR WINAPI SHGetFileInfoA(LPCSTR path,DWORD dwFileAttributes,
         temppsfi.dwAttributes=psfi->dwAttributes;
 
     if (psfi == NULL)
-        ret = SHGetFileInfoW(pathW, dwFileAttributes, NULL, sizeof(temppsfi), flags);
+        ret = SHGetFileInfoW(pathW, dwFileAttributes, NULL, 0, flags);
     else
         ret = SHGetFileInfoW(pathW, dwFileAttributes, &temppsfi, sizeof(temppsfi), flags);
 
@@ -1013,7 +1013,7 @@ EXTERN_C HRESULT WINAPI SHLoadInProc (REFCLSID rclsid)
 
     CoCreateInstance(rclsid, NULL, CLSCTX_INPROC_SERVER, IID_IUnknown, (void **)&ptr);
     if (ptr)
-        return NOERROR;
+        return S_OK;
     return DISP_E_MEMBERNOTFOUND;
 }
 
@@ -1074,7 +1074,7 @@ INT_PTR CALLBACK AboutAuthorsDlgProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM
 /*************************************************************************
  * AboutDlgProc            (internal)
  */
-INT_PTR CALLBACK AboutDlgProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam )
+static INT_PTR CALLBACK AboutDlgProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam )
 {
     static DWORD   cxLogoBmp;
     static DWORD   cyLogoBmp;
@@ -1097,7 +1097,7 @@ INT_PTR CALLBACK AboutDlgProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam
                 WCHAR szAuthorsText[20];
 
                 // Preload the ROS bitmap
-                hLogoBmp = (HBITMAP)LoadImage(shell32_hInstance, MAKEINTRESOURCE(IDB_SHELL_ABOUT_LOGO_24BPP), IMAGE_BITMAP, 0, 0, LR_DEFAULTCOLOR);
+                hLogoBmp = (HBITMAP)LoadImage(shell32_hInstance, MAKEINTRESOURCE(IDB_REACTOS), IMAGE_BITMAP, 0, 0, LR_DEFAULTCOLOR);
 
                 if(hLogoBmp)
                 {
@@ -1369,6 +1369,8 @@ BEGIN_OBJECT_MAP(ObjectMap)
     OBJECT_ENTRY(CLSID_StartMenu, CStartMenu)
     OBJECT_ENTRY(CLSID_MenuBandSite, CMenuBandSite)
     OBJECT_ENTRY(CLSID_MenuBand, CMenuBand)
+    OBJECT_ENTRY(CLSID_MenuDeskBar, CMenuDeskBar)
+    OBJECT_ENTRY(CLSID_ExeDropHandler, CExeDropHandler)
 END_OBJECT_MAP()
 
 CShell32Module                                gModule;
@@ -1462,7 +1464,11 @@ STDAPI_(BOOL) DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID fImpLoad)
         GetModuleFileNameW(hInstance, swShell32Name, MAX_PATH);
         swShell32Name[MAX_PATH - 1] = '\0';
 
-        InitCommonControlsEx(NULL);
+        /* Initialize comctl32 */
+        INITCOMMONCONTROLSEX InitCtrls;
+        InitCtrls.dwSize = sizeof(INITCOMMONCONTROLSEX);
+        InitCtrls.dwICC = ICC_WIN95_CLASSES | ICC_DATE_CLASSES | ICC_USEREX_CLASSES;
+        InitCommonControlsEx(&InitCtrls);
 
         SIC_Initialize();
         InitChangeNotifications();