5 * 1998 Juergen Schmied (jsch) * <juergen.schmied@metronet.de>
10 #include "wine/winuser16.h"
16 #include "sysmetrics.h"
17 #include "debugtools.h"
20 #include "winversion.h"
26 #include "shell32_main.h"
28 #include "wine/undocshell.h"
31 DEFAULT_DEBUG_CHANNEL(shell)
32 DECLARE_DEBUG_CHANNEL(exec)
35 /*************************************************************************
36 * CommandLineToArgvW [SHELL32.7]
38 LPWSTR* WINAPI CommandLineToArgvW(LPWSTR cmdline,LPDWORD numargs)
43 /* to get writeable copy */
44 cmdline = HEAP_strdupW( GetProcessHeap(), 0, cmdline);
51 while (*s && *s==0x0020)
57 argv=(LPWSTR*)HeapAlloc( GetProcessHeap(), 0, sizeof(LPWSTR)*(i+1) );
63 argv[i++]=HEAP_strdupW( GetProcessHeap(), 0, t );
65 while (*s && *s==0x0020)
76 argv[i++]=(LPWSTR)HEAP_strdupW( GetProcessHeap(), 0, t );
78 HeapFree( GetProcessHeap(), 0, cmdline );
84 /*************************************************************************
85 * Control_RunDLL [SHELL32.12]
87 * Wild speculation in the following!
89 * http://premium.microsoft.com/msdn/library/techart/msdn193.htm
92 void WINAPI Control_RunDLL( HWND hwnd, LPCVOID code, LPCSTR cmd, DWORD arg4 )
94 FIXME("(0x%08x, %p, %s, 0x%08lx): stub\n", hwnd, code,
95 debugstr_a(cmd), arg4);
98 /*************************************************************************
99 * SHGetFileInfoA [SHELL32.254]
102 DWORD WINAPI SHGetFileInfoA(LPCSTR path,DWORD dwFileAttributes,
103 SHFILEINFOA *psfi, UINT sizeofpsfi,
106 char szLoaction[MAX_PATH];
108 DWORD ret = TRUE, dwAttributes = 0;
109 IShellFolder * psfParent = NULL;
110 IExtractIcon * pei = NULL;
111 LPITEMIDLIST pidlLast, pidl = NULL;
114 TRACE("(%s,0x%lx,%p,0x%x,0x%x)\n",
115 (flags & SHGFI_PIDL)? "pidl" : path, dwFileAttributes, psfi, sizeofpsfi, flags);
118 ZeroMemory(psfi, sizeof(SHFILEINFOA));
120 if ((flags & SHGFI_USEFILEATTRIBUTES) && (flags & (SHGFI_ATTRIBUTES|SHGFI_EXETYPE|SHGFI_PIDL)))
123 /* translate the path into a pidl only when SHGFI_USEFILEATTRIBUTES in not specified
124 the pidl functions fail on not existing file names */
125 if (flags & SHGFI_PIDL)
127 pidl = (LPCITEMIDLIST) path;
130 ERR("pidl is null!\n");
134 else if (!(flags & SHGFI_USEFILEATTRIBUTES))
136 hr = SHILCreateFromPathA ( path, &pidl, &dwAttributes);
137 /* note: the attributes in ISF::ParseDisplayName are not implemented */
140 /* get the parent shellfolder */
143 hr = SHBindToParent( pidl, &IID_IShellFolder, (LPVOID*)&psfParent, &pidlLast);
146 /* get the attributes of the child */
147 if (SUCCEEDED(hr) && (flags & SHGFI_ATTRIBUTES))
149 if (!(flags & SHGFI_ATTR_SPECIFIED))
151 psfi->dwAttributes = 0xffffffff;
153 IShellFolder_GetAttributesOf(psfParent, 1 , &pidlLast, &(psfi->dwAttributes));
156 /* get the displayname */
157 if (SUCCEEDED(hr) && (flags & SHGFI_DISPLAYNAME))
159 if (flags & SHGFI_USEFILEATTRIBUTES)
161 strcpy (psfi->szDisplayName, PathFindFilenameA(path));
166 hr = IShellFolder_GetDisplayNameOf(psfParent, pidlLast, SHGDN_INFOLDER, &str);
167 StrRetToStrNA (psfi->szDisplayName, MAX_PATH, &str, pidlLast);
171 /* get the type name */
172 if (SUCCEEDED(hr) && (flags & SHGFI_TYPENAME))
174 _ILGetFileType(pidlLast, psfi->szTypeName, 80);
178 if (flags & SHGFI_LINKOVERLAY)
179 FIXME("set icon to link, stub\n");
181 if (flags & SHGFI_OPENICON)
182 FIXME("set to open icon, stub\n");
184 if (flags & SHGFI_SELECTED)
185 FIXME("set icon to selected, stub\n");
187 if (flags & SHGFI_SHELLICONSIZE)
188 FIXME("set icon to shell size, stub\n");
190 /* get the iconlocation */
191 if (SUCCEEDED(hr) && (flags & SHGFI_ICONLOCATION ))
194 hr = IShellFolder_GetUIObjectOf(psfParent, 0, 1, &pidlLast, &IID_IExtractIconA, &uDummy, (LPVOID*)&pei);
198 hr = IExtractIconA_GetIconLocation(pei, 0, szLoaction, MAX_PATH, &iIndex, &uFlags);
199 /* fixme what to do with the index? */
201 if(uFlags != GIL_NOTFILENAME)
202 strcpy (psfi->szDisplayName, szLoaction);
206 IExtractIconA_Release(pei);
210 /* get icon index (or load icon)*/
211 if (SUCCEEDED(hr) && (flags & (SHGFI_ICON | SHGFI_SYSICONINDEX)))
213 if (flags & SHGFI_USEFILEATTRIBUTES)
215 char sTemp [MAX_PATH];
219 lstrcpynA(sTemp, path, MAX_PATH);
220 szExt = (LPSTR) PathFindExtensionA(sTemp);
221 if( szExt && HCR_MapTypeToValue(szExt, sTemp, MAX_PATH, TRUE)
222 && HCR_GetDefaultIcon(sTemp, sTemp, MAX_PATH, &dwNr))
224 if (!strcmp("%1",sTemp)) /* icon is in the file */
228 /* FIXME: if sTemp contains a valid filename, get the icon
229 from there, index is in dwNr
233 else /* default icon */
240 if (!(PidlToSicIndex(psfParent, pidlLast, (flags && SHGFI_LARGEICON), &(psfi->iIcon))))
247 ret = (DWORD) ((flags && SHGFI_LARGEICON) ? ShellBigIconList : ShellSmallIconList);
252 if (SUCCEEDED(hr) && (flags & SHGFI_ICON))
253 psfi->hIcon = pImageList_GetIcon((flags && SHGFI_LARGEICON) ? ShellBigIconList:ShellSmallIconList, psfi->iIcon, ILD_NORMAL);
256 if (flags & SHGFI_EXETYPE)
257 FIXME("type of executable, stub\n");
259 if (flags & (SHGFI_UNKNOWN1 | SHGFI_UNKNOWN2 | SHGFI_UNKNOWN3))
260 FIXME("unknown attribute!\n");
263 IShellFolder_Release(psfParent);
269 TRACE ("icon=0x%08x index=0x%08x attr=0x%08lx name=%s type=%s\n",
270 psfi->hIcon, psfi->iIcon, psfi->dwAttributes, psfi->szDisplayName, psfi->szTypeName);
275 /*************************************************************************
276 * SHGetFileInfoW [SHELL32.255]
279 DWORD WINAPI SHGetFileInfoW(LPCWSTR path,DWORD dwFileAttributes,
280 SHFILEINFOW *psfi, UINT sizeofpsfi,
282 { FIXME("(%s,0x%lx,%p,0x%x,0x%x)\n",
283 debugstr_w(path),dwFileAttributes,psfi,sizeofpsfi,flags);
287 /*************************************************************************
288 * ExtractIconA [SHELL32.133]
290 HICON WINAPI ExtractIconA( HINSTANCE hInstance, LPCSTR lpszExeFileName,
292 { HGLOBAL16 handle = InternalExtractIcon16(hInstance,lpszExeFileName,nIconIndex, 1);
296 HICON16* ptr = (HICON16*)GlobalLock16(handle);
297 HICON16 hIcon = *ptr;
299 GlobalFree16(handle);
305 /*************************************************************************
306 * ExtractIconW [SHELL32.180]
308 HICON WINAPI ExtractIconW( HINSTANCE hInstance, LPCWSTR lpszExeFileName,
314 exefn = HEAP_strdupWtoA(GetProcessHeap(),0,lpszExeFileName);
315 ret = ExtractIconA(hInstance,exefn,nIconIndex);
317 HeapFree(GetProcessHeap(),0,exefn);
321 /*************************************************************************
322 * FindExecutableA [SHELL32.184]
324 HINSTANCE WINAPI FindExecutableA( LPCSTR lpFile, LPCSTR lpDirectory,
326 { HINSTANCE retval=31; /* default - 'No association was found' */
329 TRACE("File %s, Dir %s\n",
330 (lpFile != NULL?lpFile:"-"),
331 (lpDirectory != NULL?lpDirectory:"-"));
333 lpResult[0]='\0'; /* Start off with an empty return string */
335 /* trap NULL parameters on entry */
336 if (( lpFile == NULL ) || ( lpResult == NULL ))
337 { /* FIXME - should throw a warning, perhaps! */
338 return 2; /* File not found. Close enough, I guess. */
342 { GetCurrentDirectoryA( sizeof(old_dir), old_dir );
343 SetCurrentDirectoryA( lpDirectory );
346 retval = SHELL_FindExecutable( lpFile, "open", lpResult );
348 TRACE("returning %s\n", lpResult);
350 SetCurrentDirectoryA( old_dir );
354 /*************************************************************************
355 * FindExecutableW [SHELL32.219]
357 HINSTANCE WINAPI FindExecutableW(LPCWSTR lpFile, LPCWSTR lpDirectory,
360 FIXME("(%p,%p,%p): stub\n", lpFile, lpDirectory, lpResult);
361 return 31; /* default - 'No association was found' */
370 #define IDC_STATIC_TEXT 100
371 #define IDC_LISTBOX 99
372 #define IDC_WINE_TEXT 98
374 #define DROP_FIELD_TOP (-15)
375 #define DROP_FIELD_HEIGHT 15
377 extern HICON hIconTitleFont;
379 static BOOL __get_dropline( HWND hWnd, LPRECT lprect )
380 { HWND hWndCtl = GetDlgItem(hWnd, IDC_WINE_TEXT);
382 { GetWindowRect( hWndCtl, lprect );
383 MapWindowPoints( 0, hWnd, (LPPOINT)lprect, 2 );
384 lprect->bottom = (lprect->top += DROP_FIELD_TOP);
390 /*************************************************************************
391 * SHAppBarMessage32 [SHELL32.207]
393 UINT WINAPI SHAppBarMessage(DWORD msg, PAPPBARDATA data)
395 FIXME("(0x%08lx,%p hwnd=0x%08x): stub\n", msg, data, data->hWnd);
399 return ABS_ALWAYSONTOP | ABS_AUTOHIDE;
400 case ABM_GETTASKBARPOS:
401 /* fake a taskbar on the bottom of the desktop */
403 GetWindowRect(GetDesktopWindow(), &rec);
405 rec.top = rec.bottom - 2;
409 case ABM_GETAUTOHIDEBAR:
413 case ABM_SETAUTOHIDEBAR:
415 case ABM_WINDOWPOSCHANGED:
421 /*************************************************************************
422 * SHHelpShortcuts_RunDLL [SHELL32.224]
425 DWORD WINAPI SHHelpShortcuts_RunDLL (DWORD dwArg1, DWORD dwArg2, DWORD dwArg3, DWORD dwArg4)
426 { FIXME_(exec)("(%lx, %lx, %lx, %lx) empty stub!\n",
427 dwArg1, dwArg2, dwArg3, dwArg4);
432 /*************************************************************************
433 * SHLoadInProc [SHELL32.225]
437 DWORD WINAPI SHLoadInProc (DWORD dwArg1)
438 { FIXME("(%lx) empty stub!\n", dwArg1);
442 /*************************************************************************
443 * ShellExecuteA [SHELL32.245]
445 HINSTANCE WINAPI ShellExecuteA( HWND hWnd, LPCSTR lpOperation,
446 LPCSTR lpFile, LPCSTR lpParameters,
447 LPCSTR lpDirectory, INT iShowCmd )
449 return ShellExecute16( hWnd, lpOperation, lpFile, lpParameters,
450 lpDirectory, iShowCmd );
453 /*************************************************************************
454 * ShellExecuteW [SHELL32.294]
456 * WINSHELLAPI HINSTANCE APIENTRY ShellExecuteW(HWND hwnd, LPCWSTR lpOperation,
457 * LPCWSTR lpFile, LPCWSTR lpParameters, LPCWSTR lpDirectory, INT nShowCmd);
464 LPCWSTR lpParameters,
472 /*************************************************************************
473 * AboutDlgProc32 (internal)
475 BOOL WINAPI AboutDlgProc( HWND hWnd, UINT msg, WPARAM wParam,
478 char Template[512], AppTitle[512];
483 { case WM_INITDIALOG:
484 { ABOUT_INFO *info = (ABOUT_INFO *)lParam;
486 { const char* const *pstr = SHELL_People;
487 SendDlgItemMessageA(hWnd, stc1, STM_SETICON,info->hIcon, 0);
488 GetWindowTextA( hWnd, Template, sizeof(Template) );
489 sprintf( AppTitle, Template, info->szApp );
490 SetWindowTextA( hWnd, AppTitle );
491 SetWindowTextA( GetDlgItem(hWnd, IDC_STATIC_TEXT),
492 info->szOtherStuff );
493 hWndCtl = GetDlgItem(hWnd, IDC_LISTBOX);
494 SendMessageA( hWndCtl, WM_SETREDRAW, 0, 0 );
495 SendMessageA( hWndCtl, WM_SETFONT, hIconTitleFont, 0 );
497 { SendMessageA( hWndCtl, LB_ADDSTRING, (WPARAM)-1, (LPARAM)*pstr );
500 SendMessageA( hWndCtl, WM_SETREDRAW, 1, 0 );
508 HDC hDC = BeginPaint( hWnd, &ps );
510 if( __get_dropline( hWnd, &rect ) ) {
511 SelectObject( hDC, GetStockObject( BLACK_PEN ) );
512 MoveToEx( hDC, rect.left, rect.top, NULL );
513 LineTo( hDC, rect.right, rect.bottom );
515 EndPaint( hWnd, &ps );
519 case WM_LBTRACKPOINT:
520 hWndCtl = GetDlgItem(hWnd, IDC_LISTBOX);
521 if( (INT16)GetKeyState16( VK_CONTROL ) < 0 )
522 { if( DragDetect( hWndCtl, *((LPPOINT)&lParam) ) )
523 { INT idx = SendMessageA( hWndCtl, LB_GETCURSEL, 0, 0 );
525 { INT length = SendMessageA( hWndCtl, LB_GETTEXTLEN, (WPARAM)idx, 0 );
526 HGLOBAL16 hMemObj = GlobalAlloc16( GMEM_MOVEABLE, length + 1 );
527 char* pstr = (char*)GlobalLock16( hMemObj );
530 { HCURSOR16 hCursor = LoadCursor16( 0, MAKEINTRESOURCE16(OCR_DRAGOBJECT) );
531 SendMessageA( hWndCtl, LB_GETTEXT, (WPARAM)idx, (LPARAM)pstr );
532 SendMessageA( hWndCtl, LB_DELETESTRING, (WPARAM)idx, 0 );
533 UpdateWindow( hWndCtl );
534 if( !DragObject16((HWND16)hWnd, (HWND16)hWnd, DRAGOBJ_DATA, 0, (WORD)hMemObj, hCursor) )
535 SendMessageA( hWndCtl, LB_ADDSTRING, (WPARAM)-1, (LPARAM)pstr );
538 GlobalFree16( hMemObj );
544 case WM_QUERYDROPOBJECT:
546 { LPDRAGINFO lpDragInfo = (LPDRAGINFO)PTR_SEG_TO_LIN((SEGPTR)lParam);
547 if( lpDragInfo && lpDragInfo->wFlags == DRAGOBJ_DATA )
549 if( __get_dropline( hWnd, &rect ) )
551 pt.x=lpDragInfo->pt.x;
552 pt.x=lpDragInfo->pt.y;
553 rect.bottom += DROP_FIELD_HEIGHT;
554 if( PtInRect( &rect, pt ) )
555 { SetWindowLongA( hWnd, DWL_MSGRESULT, 1 );
565 { LPDRAGINFO lpDragInfo = (LPDRAGINFO)PTR_SEG_TO_LIN((SEGPTR)lParam);
566 if( lpDragInfo && lpDragInfo->wFlags == DRAGOBJ_DATA && lpDragInfo->hList )
567 { char* pstr = (char*)GlobalLock16( (HGLOBAL16)(lpDragInfo->hList) );
569 { static char __appendix_str[] = " with";
571 hWndCtl = GetDlgItem( hWnd, IDC_WINE_TEXT );
572 SendMessageA( hWndCtl, WM_GETTEXT, 512, (LPARAM)Template );
573 if( !strncmp( Template, "WINE", 4 ) )
574 SetWindowTextA( GetDlgItem(hWnd, IDC_STATIC_TEXT), Template );
576 { char* pch = Template + strlen(Template) - strlen(__appendix_str);
578 SendMessageA( GetDlgItem(hWnd, IDC_LISTBOX), LB_ADDSTRING,
579 (WPARAM)-1, (LPARAM)Template );
582 strcpy( Template, pstr );
583 strcat( Template, __appendix_str );
584 SetWindowTextA( hWndCtl, Template );
585 SetWindowLongA( hWnd, DWL_MSGRESULT, 1 );
594 { EndDialog(hWnd, TRUE);
599 EndDialog(hWnd, TRUE);
607 /*************************************************************************
608 * ShellAboutA [SHELL32.243]
610 BOOL WINAPI ShellAboutA( HWND hWnd, LPCSTR szApp, LPCSTR szOtherStuff,
617 if(!(hRes = FindResourceA(shell32_hInstance, "SHELL_ABOUT_MSGBOX", RT_DIALOGA)))
619 if(!(template = (LPVOID)LoadResource(shell32_hInstance, hRes)))
623 info.szOtherStuff = szOtherStuff;
625 if (!hIcon) info.hIcon = LoadIcon16( 0, MAKEINTRESOURCE16(OIC_WINEICON) );
626 return DialogBoxIndirectParamA( GetWindowLongA( hWnd, GWL_HINSTANCE ),
627 template, hWnd, AboutDlgProc, (LPARAM)&info );
631 /*************************************************************************
632 * ShellAboutW [SHELL32.244]
634 BOOL WINAPI ShellAboutW( HWND hWnd, LPCWSTR szApp, LPCWSTR szOtherStuff,
643 if(!(hRes = FindResourceA(shell32_hInstance, "SHELL_ABOUT_MSGBOX", RT_DIALOGA)))
645 if(!(template = (LPVOID)LoadResource(shell32_hInstance, hRes)))
648 info.szApp = HEAP_strdupWtoA( GetProcessHeap(), 0, szApp );
649 info.szOtherStuff = HEAP_strdupWtoA( GetProcessHeap(), 0, szOtherStuff );
651 if (!hIcon) info.hIcon = LoadIcon16( 0, MAKEINTRESOURCE16(OIC_WINEICON) );
652 ret = DialogBoxIndirectParamA( GetWindowLongA( hWnd, GWL_HINSTANCE ),
653 template, hWnd, AboutDlgProc, (LPARAM)&info );
654 HeapFree( GetProcessHeap(), 0, (LPSTR)info.szApp );
655 HeapFree( GetProcessHeap(), 0, (LPSTR)info.szOtherStuff );
659 /*************************************************************************
662 void WINAPI FreeIconList( DWORD dw )
663 { FIXME("(%lx): stub\n",dw);
666 /***********************************************************************
667 * DllGetVersion [COMCTL32.25]
669 * Retrieves version information of the 'SHELL32.DLL'
672 * pdvi [O] pointer to version information structure.
676 * Failure: E_INVALIDARG
679 * Returns version of a shell32.dll from IE4.01 SP1.
682 HRESULT WINAPI SHELL32_DllGetVersion (DLLVERSIONINFO *pdvi)
684 if (pdvi->cbSize != sizeof(DLLVERSIONINFO))
685 { WARN("wrong DLLVERSIONINFO size from app");
689 pdvi->dwMajorVersion = 4;
690 pdvi->dwMinorVersion = 72;
691 pdvi->dwBuildNumber = 3110;
692 pdvi->dwPlatformID = 1;
694 TRACE("%lu.%lu.%lu.%lu\n",
695 pdvi->dwMajorVersion, pdvi->dwMinorVersion,
696 pdvi->dwBuildNumber, pdvi->dwPlatformID);
700 /*************************************************************************
701 * global variables of the shell32.dll
702 * all are once per process
705 void (WINAPI* pDLLInitComctl)(LPVOID);
706 INT (WINAPI* pImageList_AddIcon) (HIMAGELIST himl, HICON hIcon);
707 INT (WINAPI* pImageList_ReplaceIcon) (HIMAGELIST, INT, HICON);
708 HIMAGELIST (WINAPI * pImageList_Create) (INT,INT,UINT,INT,INT);
709 BOOL (WINAPI* pImageList_Draw) (HIMAGELIST himl, int i, HDC hdcDest, int x, int y, UINT fStyle);
710 HICON (WINAPI * pImageList_GetIcon) (HIMAGELIST, INT, UINT);
711 INT (WINAPI* pImageList_GetImageCount)(HIMAGELIST);
712 COLORREF (WINAPI *pImageList_SetBkColor)(HIMAGELIST, COLORREF);
714 LPVOID (WINAPI* pCOMCTL32_Alloc) (INT);
715 BOOL (WINAPI* pCOMCTL32_Free) (LPVOID);
717 HDPA (WINAPI* pDPA_Create) (INT);
718 INT (WINAPI* pDPA_InsertPtr) (const HDPA, INT, LPVOID);
719 BOOL (WINAPI* pDPA_Sort) (const HDPA, PFNDPACOMPARE, LPARAM);
720 LPVOID (WINAPI* pDPA_GetPtr) (const HDPA, INT);
721 BOOL (WINAPI* pDPA_Destroy) (const HDPA);
722 INT (WINAPI *pDPA_Search) (const HDPA, LPVOID, INT, PFNDPACOMPARE, LPARAM, UINT);
723 LPVOID (WINAPI *pDPA_DeletePtr) (const HDPA hdpa, INT i);
726 HICON (WINAPI *pLookupIconIdFromDirectoryEx)(LPBYTE dir, BOOL bIcon, INT width, INT height, UINT cFlag);
727 HICON (WINAPI *pCreateIconFromResourceEx)(LPBYTE bits,UINT cbSize, BOOL bIcon, DWORD dwVersion, INT width, INT height,UINT cFlag);
730 HRESULT (WINAPI* pOleInitialize)(LPVOID reserved);
731 void (WINAPI* pOleUninitialize)(void);
732 HRESULT (WINAPI* pDoDragDrop)(IDataObject* pDataObject, IDropSource * pDropSource, DWORD dwOKEffect, DWORD *pdwEffect);
733 HRESULT (WINAPI* pRegisterDragDrop)(HWND hwnd, IDropTarget* pDropTarget);
734 HRESULT (WINAPI* pRevokeDragDrop)(HWND hwnd);
736 static HINSTANCE hComctl32;
737 static HINSTANCE hOle32;
738 static INT shell32_RefCount = 0;
740 INT shell32_ObjCount = 0;
741 HINSTANCE shell32_hInstance;
742 HIMAGELIST ShellSmallIconList = 0;
743 HIMAGELIST ShellBigIconList = 0;
745 /*************************************************************************
749 * calling oleinitialize here breaks sone apps.
752 BOOL WINAPI Shell32LibMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID fImpLoad)
756 TRACE("0x%x 0x%lx %p\n", hinstDLL, fdwReason, fImpLoad);
760 case DLL_PROCESS_ATTACH:
762 if (shell32_hInstance)
764 ERR("shell32.dll instantiated twice in one address space!\n");
768 /* we only want to call this the first time shell32 is instantiated */
769 SHInitRestricted(NULL, NULL);
772 shell32_hInstance = hinstDLL;
774 hComctl32 = LoadLibraryA("COMCTL32.DLL");
775 hOle32 = LoadLibraryA("OLE32.DLL");
776 hUser32 = GetModuleHandleA("USER32");
778 if (!hComctl32 || !hUser32 || !hOle32)
780 ERR("P A N I C SHELL32 loading failed\n");
785 pDLLInitComctl=(void*)GetProcAddress(hComctl32,"InitCommonControlsEx");
786 pImageList_Create=(void*)GetProcAddress(hComctl32,"ImageList_Create");
787 pImageList_AddIcon=(void*)GetProcAddress(hComctl32,"ImageList_AddIcon");
788 pImageList_ReplaceIcon=(void*)GetProcAddress(hComctl32,"ImageList_ReplaceIcon");
789 pImageList_GetIcon=(void*)GetProcAddress(hComctl32,"ImageList_GetIcon");
790 pImageList_GetImageCount=(void*)GetProcAddress(hComctl32,"ImageList_GetImageCount");
791 pImageList_Draw=(void*)GetProcAddress(hComctl32,"ImageList_Draw");
792 pImageList_SetBkColor=(void*)GetProcAddress(hComctl32,"ImageList_SetBkColor");
793 pCOMCTL32_Alloc=(void*)GetProcAddress(hComctl32, (LPCSTR)71L);
794 pCOMCTL32_Free=(void*)GetProcAddress(hComctl32, (LPCSTR)73L);
795 pDPA_Create=(void*)GetProcAddress(hComctl32, (LPCSTR)328L);
796 pDPA_Destroy=(void*)GetProcAddress(hComctl32, (LPCSTR)329L);
797 pDPA_GetPtr=(void*)GetProcAddress(hComctl32, (LPCSTR)332L);
798 pDPA_InsertPtr=(void*)GetProcAddress(hComctl32, (LPCSTR)334L);
799 pDPA_DeletePtr=(void*)GetProcAddress(hComctl32, (LPCSTR)336L);
800 pDPA_Sort=(void*)GetProcAddress(hComctl32, (LPCSTR)338L);
801 pDPA_Search=(void*)GetProcAddress(hComctl32, (LPCSTR)339L);
803 pLookupIconIdFromDirectoryEx=(void*)GetProcAddress(hUser32,"LookupIconIdFromDirectoryEx");
804 pCreateIconFromResourceEx=(void*)GetProcAddress(hUser32,"CreateIconFromResourceEx");
806 pOleInitialize=(void*)GetProcAddress(hOle32,"OleInitialize");
807 pOleUninitialize=(void*)GetProcAddress(hOle32,"OleUninitialize");
808 pDoDragDrop=(void*)GetProcAddress(hOle32,"DoDragDrop");
809 pRegisterDragDrop=(void*)GetProcAddress(hOle32,"RegisterDragDrop");
810 pRevokeDragDrop=(void*)GetProcAddress(hOle32,"RevokeDragDrop");
812 /* initialize the common controls */
815 pDLLInitComctl(NULL);
823 case DLL_THREAD_ATTACH:
827 case DLL_THREAD_DETACH:
831 case DLL_PROCESS_DETACH:
834 if ( !shell32_RefCount )
836 shell32_hInstance = 0;
840 IShellFolder_Release(pdesktopfolder);
841 pdesktopfolder = NULL;
846 /* this one is here to check if AddRef/Release is balanced */
847 if (shell32_ObjCount)
849 WARN("leaving with %u objects left (memory leak)\n", shell32_ObjCount);
854 FreeLibrary(hComctl32);
856 TRACE("refcount=%u objcount=%u \n", shell32_RefCount, shell32_ObjCount);
862 /*************************************************************************
863 * DllInstall [SHELL32.202]
867 * BOOL bInstall - TRUE for install, FALSE for uninstall
868 * LPCWSTR pszCmdLine - command line (unused by shell32?)
871 HRESULT WINAPI DllInstall(BOOL bInstall, LPCWSTR cmdline)
873 FIXME("(%s, %s): stub!\n", bInstall ? "TRUE":"FALSE", debugstr_w(cmdline));
875 return S_OK; /* indicate success */