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"
30 DECLARE_DEBUG_CHANNEL(exec)
31 DECLARE_DEBUG_CHANNEL(shell)
33 /*************************************************************************
34 * CommandLineToArgvW [SHELL32.7]
36 LPWSTR* WINAPI CommandLineToArgvW(LPWSTR cmdline,LPDWORD numargs)
41 /* to get writeable copy */
42 cmdline = HEAP_strdupW( GetProcessHeap(), 0, cmdline);
49 while (*s && *s==0x0020)
55 argv=(LPWSTR*)HeapAlloc( GetProcessHeap(), 0, sizeof(LPWSTR)*(i+1) );
61 argv[i++]=HEAP_strdupW( GetProcessHeap(), 0, t );
63 while (*s && *s==0x0020)
74 argv[i++]=(LPWSTR)HEAP_strdupW( GetProcessHeap(), 0, t );
76 HeapFree( GetProcessHeap(), 0, cmdline );
82 /*************************************************************************
83 * Control_RunDLL [SHELL32.12]
85 * Wild speculation in the following!
87 * http://premium.microsoft.com/msdn/library/techart/msdn193.htm
90 void WINAPI Control_RunDLL( HWND hwnd, LPCVOID code, LPCSTR cmd, DWORD arg4 )
92 FIXME_(shell)("(0x%08x, %p, %s, 0x%08lx): stub\n", hwnd, code,
93 debugstr_a(cmd), arg4);
96 /*************************************************************************
97 * SHGetFileInfoA [SHELL32.254]
100 DWORD WINAPI SHGetFileInfoA(LPCSTR path,DWORD dwFileAttributes,
101 SHFILEINFOA *psfi, UINT sizeofpsfi,
103 { CHAR szTemp[MAX_PATH];
105 LPITEMIDLIST pPidlTemp = NULL;
106 DWORD ret=0, dwfa = dwFileAttributes;
108 TRACE_(shell)("(%s,0x%lx,%p,0x%x,0x%x)\n",
109 path,dwFileAttributes,psfi,sizeofpsfi,flags);
111 /* translate the pidl to a path*/
112 if (flags & SHGFI_PIDL)
113 { pPidlTemp = (LPCITEMIDLIST)path;
114 SHGetPathFromIDListA (pPidlTemp, szTemp);
115 TRACE_(shell)("pidl=%p is %s\n", path, szTemp);
118 { strcpy(szTemp,path);
119 TRACE_(shell)("path=%s\n", szTemp);
122 if (flags & SHGFI_ATTRIBUTES)
123 { if (flags & SHGFI_PIDL)
126 * We have to test for the desktop folder first because ILGetDataPointer returns
127 * NULL on the desktop folder.
129 if (_ILIsDesktop((LPCITEMIDLIST)path))
130 { psfi->dwAttributes = 0xb0000154;
134 { pData = _ILGetDataPointer((LPCITEMIDLIST)path);
138 psfi->dwAttributes = 0xb0000154;
140 psfi->dwAttributes = 0xb0000154;
142 psfi->dwAttributes = 0xa0000000;
144 psfi->dwAttributes = 0xf0000144;
146 psfi->dwAttributes = 0xe0000177;
148 psfi->dwAttributes = 0x40000177;
154 { if (! (flags & SHGFI_USEFILEATTRIBUTES))
155 dwfa = GetFileAttributesA (szTemp);
157 psfi->dwAttributes = SFGAO_FILESYSTEM;
158 if (dwfa == FILE_ATTRIBUTE_DIRECTORY)
159 psfi->dwAttributes |= SFGAO_FOLDER | SFGAO_HASSUBFOLDER;
162 WARN_(shell)("file attributes, semi-stub\n");
165 if (flags & SHGFI_DISPLAYNAME)
167 if (flags & SHGFI_PIDL)
169 _ILSimpleGetText(ILFindLastID(pPidlTemp), psfi->szDisplayName, MAX_PATH);
173 lstrcpynA(psfi->szDisplayName,PathFindFilenameA(path), MAX_PATH);
175 TRACE_(shell)("displayname=%s\n", psfi->szDisplayName);
179 if (flags & SHGFI_TYPENAME)
180 { FIXME_(shell)("get the file type, stub\n");
181 strcpy(psfi->szTypeName,"FIXME: Type");
185 if (flags & SHGFI_ICONLOCATION)
186 { FIXME_(shell)("location of icon, stub\n");
187 strcpy(psfi->szDisplayName,"");
191 if (flags & SHGFI_EXETYPE)
192 FIXME_(shell)("type of executable, stub\n");
194 if (flags & SHGFI_LINKOVERLAY)
195 FIXME_(shell)("set icon to link, stub\n");
197 if (flags & SHGFI_OPENICON)
198 FIXME_(shell)("set to open icon, stub\n");
200 if (flags & SHGFI_SELECTED)
201 FIXME_(shell)("set icon to selected, stub\n");
203 if (flags & SHGFI_SHELLICONSIZE)
204 FIXME_(shell)("set icon to shell size, stub\n");
206 if (flags & SHGFI_USEFILEATTRIBUTES)
207 FIXME_(shell)("use the dwFileAttributes, stub\n");
209 if (flags & (SHGFI_UNKNOWN1 | SHGFI_UNKNOWN2 | SHGFI_UNKNOWN3))
210 FIXME_(shell)("unknown attribute!\n");
212 if (flags & SHGFI_ICON)
213 { FIXME_(shell)("icon handle\n");
214 if (flags & SHGFI_SMALLICON)
215 { TRACE_(shell)("set to small icon\n");
216 psfi->hIcon=pImageList_GetIcon(ShellSmallIconList,32,ILD_NORMAL);
217 ret = (DWORD) ShellSmallIconList;
220 { TRACE_(shell)("set to big icon\n");
221 psfi->hIcon=pImageList_GetIcon(ShellBigIconList,32,ILD_NORMAL);
222 ret = (DWORD) ShellBigIconList;
226 if (flags & SHGFI_SYSICONINDEX)
229 { pPidlTemp = ILCreateFromPathA (szTemp);
231 if (SUCCEEDED (SHGetDesktopFolder (&sf)))
232 { psfi->iIcon = SHMapPIDLToSystemImageListIndex (sf, pPidlTemp, 0);
233 IShellFolder_Release(sf);
235 TRACE_(shell)("-- SYSICONINDEX %i\n", psfi->iIcon);
237 if (flags & SHGFI_SMALLICON)
238 { TRACE_(shell)("set to small icon\n");
239 ret = (DWORD) ShellSmallIconList;
242 { TRACE_(shell)("set to big icon\n");
243 ret = (DWORD) ShellBigIconList;
250 /*************************************************************************
251 * SHGetFileInfoW [SHELL32.255]
254 DWORD WINAPI SHGetFileInfoW(LPCWSTR path,DWORD dwFileAttributes,
255 SHFILEINFOW *psfi, UINT sizeofpsfi,
257 { FIXME_(shell)("(%s,0x%lx,%p,0x%x,0x%x)\n",
258 debugstr_w(path),dwFileAttributes,psfi,sizeofpsfi,flags);
262 /*************************************************************************
263 * ExtractIconA [SHELL32.133]
265 HICON WINAPI ExtractIconA( HINSTANCE hInstance, LPCSTR lpszExeFileName,
267 { HGLOBAL16 handle = InternalExtractIcon16(hInstance,lpszExeFileName,nIconIndex, 1);
271 HICON16* ptr = (HICON16*)GlobalLock16(handle);
272 HICON16 hIcon = *ptr;
274 GlobalFree16(handle);
280 /*************************************************************************
281 * ExtractIconW [SHELL32.180]
283 HICON WINAPI ExtractIconW( HINSTANCE hInstance, LPCWSTR lpszExeFileName,
289 exefn = HEAP_strdupWtoA(GetProcessHeap(),0,lpszExeFileName);
290 ret = ExtractIconA(hInstance,exefn,nIconIndex);
292 HeapFree(GetProcessHeap(),0,exefn);
296 /*************************************************************************
297 * FindExecutableA [SHELL32.184]
299 HINSTANCE WINAPI FindExecutableA( LPCSTR lpFile, LPCSTR lpDirectory,
301 { HINSTANCE retval=31; /* default - 'No association was found' */
304 TRACE_(shell)("File %s, Dir %s\n",
305 (lpFile != NULL?lpFile:"-"),
306 (lpDirectory != NULL?lpDirectory:"-"));
308 lpResult[0]='\0'; /* Start off with an empty return string */
310 /* trap NULL parameters on entry */
311 if (( lpFile == NULL ) || ( lpResult == NULL ))
312 { /* FIXME - should throw a warning, perhaps! */
313 return 2; /* File not found. Close enough, I guess. */
317 { GetCurrentDirectoryA( sizeof(old_dir), old_dir );
318 SetCurrentDirectoryA( lpDirectory );
321 retval = SHELL_FindExecutable( lpFile, "open", lpResult );
323 TRACE_(shell)("returning %s\n", lpResult);
325 SetCurrentDirectoryA( old_dir );
329 /*************************************************************************
330 * FindExecutableW [SHELL32.219]
332 HINSTANCE WINAPI FindExecutableW(LPCWSTR lpFile, LPCWSTR lpDirectory,
335 FIXME_(shell)("(%p,%p,%p): stub\n", lpFile, lpDirectory, lpResult);
336 return 31; /* default - 'No association was found' */
345 #define IDC_STATIC_TEXT 100
346 #define IDC_LISTBOX 99
347 #define IDC_WINE_TEXT 98
349 #define DROP_FIELD_TOP (-15)
350 #define DROP_FIELD_HEIGHT 15
352 extern HICON hIconTitleFont;
354 static BOOL __get_dropline( HWND hWnd, LPRECT lprect )
355 { HWND hWndCtl = GetDlgItem(hWnd, IDC_WINE_TEXT);
357 { GetWindowRect( hWndCtl, lprect );
358 MapWindowPoints( 0, hWnd, (LPPOINT)lprect, 2 );
359 lprect->bottom = (lprect->top += DROP_FIELD_TOP);
365 /*************************************************************************
366 * SHAppBarMessage32 [SHELL32.207]
368 UINT WINAPI SHAppBarMessage(DWORD msg, PAPPBARDATA data)
370 FIXME_(shell)("(0x%08lx,%p hwnd=0x%08x): stub\n", msg, data, data->hWnd);
374 return ABS_ALWAYSONTOP | ABS_AUTOHIDE;
375 case ABM_GETTASKBARPOS:
376 /* fake a taskbar on the bottom of the desktop */
378 GetWindowRect(GetDesktopWindow(), &rec);
380 rec.top = rec.bottom - 2;
384 case ABM_GETAUTOHIDEBAR:
388 case ABM_SETAUTOHIDEBAR:
390 case ABM_WINDOWPOSCHANGED:
396 /*************************************************************************
397 * SHHelpShortcuts_RunDLL [SHELL32.224]
400 DWORD WINAPI SHHelpShortcuts_RunDLL (DWORD dwArg1, DWORD dwArg2, DWORD dwArg3, DWORD dwArg4)
401 { FIXME_(exec)("(%lx, %lx, %lx, %lx) empty stub!\n",
402 dwArg1, dwArg2, dwArg3, dwArg4);
407 /*************************************************************************
408 * SHLoadInProc [SHELL32.225]
412 DWORD WINAPI SHLoadInProc (DWORD dwArg1)
413 { FIXME_(shell)("(%lx) empty stub!\n", dwArg1);
417 /*************************************************************************
418 * ShellExecuteA [SHELL32.245]
420 HINSTANCE WINAPI ShellExecuteA( HWND hWnd, LPCSTR lpOperation,
421 LPCSTR lpFile, LPCSTR lpParameters,
422 LPCSTR lpDirectory, INT iShowCmd )
423 { TRACE_(shell)("\n");
424 return ShellExecute16( hWnd, lpOperation, lpFile, lpParameters,
425 lpDirectory, iShowCmd );
428 /*************************************************************************
429 * ShellExecuteW [SHELL32.294]
431 * WINSHELLAPI HINSTANCE APIENTRY ShellExecuteW(HWND hwnd, LPCWSTR lpOperation,
432 * LPCWSTR lpFile, LPCWSTR lpParameters, LPCWSTR lpDirectory, INT nShowCmd);
439 LPCWSTR lpParameters,
443 FIXME_(shell)(": stub\n");
447 /*************************************************************************
448 * AboutDlgProc32 (internal)
450 BOOL WINAPI AboutDlgProc( HWND hWnd, UINT msg, WPARAM wParam,
453 char Template[512], AppTitle[512];
458 { case WM_INITDIALOG:
459 { ABOUT_INFO *info = (ABOUT_INFO *)lParam;
461 { const char* const *pstr = SHELL_People;
462 SendDlgItemMessageA(hWnd, stc1, STM_SETICON,info->hIcon, 0);
463 GetWindowTextA( hWnd, Template, sizeof(Template) );
464 sprintf( AppTitle, Template, info->szApp );
465 SetWindowTextA( hWnd, AppTitle );
466 SetWindowTextA( GetDlgItem(hWnd, IDC_STATIC_TEXT),
467 info->szOtherStuff );
468 hWndCtl = GetDlgItem(hWnd, IDC_LISTBOX);
469 SendMessageA( hWndCtl, WM_SETREDRAW, 0, 0 );
470 SendMessageA( hWndCtl, WM_SETFONT, hIconTitleFont, 0 );
472 { SendMessageA( hWndCtl, LB_ADDSTRING, (WPARAM)-1, (LPARAM)*pstr );
475 SendMessageA( hWndCtl, WM_SETREDRAW, 1, 0 );
483 HDC hDC = BeginPaint( hWnd, &ps );
485 if( __get_dropline( hWnd, &rect ) ) {
486 SelectObject( hDC, GetStockObject( BLACK_PEN ) );
487 MoveToEx( hDC, rect.left, rect.top, NULL );
488 LineTo( hDC, rect.right, rect.bottom );
490 EndPaint( hWnd, &ps );
494 case WM_LBTRACKPOINT:
495 hWndCtl = GetDlgItem(hWnd, IDC_LISTBOX);
496 if( (INT16)GetKeyState16( VK_CONTROL ) < 0 )
497 { if( DragDetect( hWndCtl, *((LPPOINT)&lParam) ) )
498 { INT idx = SendMessageA( hWndCtl, LB_GETCURSEL, 0, 0 );
500 { INT length = SendMessageA( hWndCtl, LB_GETTEXTLEN, (WPARAM)idx, 0 );
501 HGLOBAL16 hMemObj = GlobalAlloc16( GMEM_MOVEABLE, length + 1 );
502 char* pstr = (char*)GlobalLock16( hMemObj );
505 { HCURSOR16 hCursor = LoadCursor16( 0, MAKEINTRESOURCE16(OCR_DRAGOBJECT) );
506 SendMessageA( hWndCtl, LB_GETTEXT, (WPARAM)idx, (LPARAM)pstr );
507 SendMessageA( hWndCtl, LB_DELETESTRING, (WPARAM)idx, 0 );
508 UpdateWindow( hWndCtl );
509 if( !DragObject16((HWND16)hWnd, (HWND16)hWnd, DRAGOBJ_DATA, 0, (WORD)hMemObj, hCursor) )
510 SendMessageA( hWndCtl, LB_ADDSTRING, (WPARAM)-1, (LPARAM)pstr );
513 GlobalFree16( hMemObj );
519 case WM_QUERYDROPOBJECT:
521 { LPDRAGINFO lpDragInfo = (LPDRAGINFO)PTR_SEG_TO_LIN((SEGPTR)lParam);
522 if( lpDragInfo && lpDragInfo->wFlags == DRAGOBJ_DATA )
524 if( __get_dropline( hWnd, &rect ) )
526 pt.x=lpDragInfo->pt.x;
527 pt.x=lpDragInfo->pt.y;
528 rect.bottom += DROP_FIELD_HEIGHT;
529 if( PtInRect( &rect, pt ) )
530 { SetWindowLongA( hWnd, DWL_MSGRESULT, 1 );
540 { LPDRAGINFO lpDragInfo = (LPDRAGINFO)PTR_SEG_TO_LIN((SEGPTR)lParam);
541 if( lpDragInfo && lpDragInfo->wFlags == DRAGOBJ_DATA && lpDragInfo->hList )
542 { char* pstr = (char*)GlobalLock16( (HGLOBAL16)(lpDragInfo->hList) );
544 { static char __appendix_str[] = " with";
546 hWndCtl = GetDlgItem( hWnd, IDC_WINE_TEXT );
547 SendMessageA( hWndCtl, WM_GETTEXT, 512, (LPARAM)Template );
548 if( !strncmp( Template, "WINE", 4 ) )
549 SetWindowTextA( GetDlgItem(hWnd, IDC_STATIC_TEXT), Template );
551 { char* pch = Template + strlen(Template) - strlen(__appendix_str);
553 SendMessageA( GetDlgItem(hWnd, IDC_LISTBOX), LB_ADDSTRING,
554 (WPARAM)-1, (LPARAM)Template );
557 strcpy( Template, pstr );
558 strcat( Template, __appendix_str );
559 SetWindowTextA( hWndCtl, Template );
560 SetWindowLongA( hWnd, DWL_MSGRESULT, 1 );
569 { EndDialog(hWnd, TRUE);
578 /*************************************************************************
579 * ShellAboutA [SHELL32.243]
581 BOOL WINAPI ShellAboutA( HWND hWnd, LPCSTR szApp, LPCSTR szOtherStuff,
588 if(!(hRes = FindResourceA(shell32_hInstance, "SHELL_ABOUT_MSGBOX", RT_DIALOGA)))
590 if(!(template = (LPVOID)LoadResource(shell32_hInstance, hRes)))
594 info.szOtherStuff = szOtherStuff;
596 if (!hIcon) info.hIcon = LoadIcon16( 0, MAKEINTRESOURCE16(OIC_WINEICON) );
597 return DialogBoxIndirectParamA( GetWindowLongA( hWnd, GWL_HINSTANCE ),
598 template, hWnd, AboutDlgProc, (LPARAM)&info );
602 /*************************************************************************
603 * ShellAboutW [SHELL32.244]
605 BOOL WINAPI ShellAboutW( HWND hWnd, LPCWSTR szApp, LPCWSTR szOtherStuff,
614 if(!(hRes = FindResourceA(shell32_hInstance, "SHELL_ABOUT_MSGBOX", RT_DIALOGA)))
616 if(!(template = (LPVOID)LoadResource(shell32_hInstance, hRes)))
619 info.szApp = HEAP_strdupWtoA( GetProcessHeap(), 0, szApp );
620 info.szOtherStuff = HEAP_strdupWtoA( GetProcessHeap(), 0, szOtherStuff );
622 if (!hIcon) info.hIcon = LoadIcon16( 0, MAKEINTRESOURCE16(OIC_WINEICON) );
623 ret = DialogBoxIndirectParamA( GetWindowLongA( hWnd, GWL_HINSTANCE ),
624 template, hWnd, AboutDlgProc, (LPARAM)&info );
625 HeapFree( GetProcessHeap(), 0, (LPSTR)info.szApp );
626 HeapFree( GetProcessHeap(), 0, (LPSTR)info.szOtherStuff );
630 /*************************************************************************
631 * Shell_NotifyIcon [SHELL32.296]
633 * This function is supposed to deal with the systray.
634 * Any ideas on how this is to be implimented?
636 BOOL WINAPI Shell_NotifyIcon( DWORD dwMessage, PNOTIFYICONDATAA pnid )
637 { TRACE_(shell)("\n");
641 /*************************************************************************
642 * Shell_NotifyIcon [SHELL32.297]
644 * This function is supposed to deal with the systray.
645 * Any ideas on how this is to be implimented?
647 BOOL WINAPI Shell_NotifyIconA(DWORD dwMessage, PNOTIFYICONDATAA pnid )
648 { TRACE_(shell)("\n");
652 /*************************************************************************
655 void WINAPI FreeIconList( DWORD dw )
656 { FIXME_(shell)("(%lx): stub\n",dw);
659 /***********************************************************************
660 * DllGetVersion [COMCTL32.25]
662 * Retrieves version information of the 'SHELL32.DLL'
665 * pdvi [O] pointer to version information structure.
669 * Failure: E_INVALIDARG
672 * Returns version of a shell32.dll from IE4.01 SP1.
675 HRESULT WINAPI SHELL32_DllGetVersion (DLLVERSIONINFO *pdvi)
677 if (pdvi->cbSize != sizeof(DLLVERSIONINFO))
678 { WARN_(shell)("wrong DLLVERSIONINFO size from app");
682 pdvi->dwMajorVersion = 4;
683 pdvi->dwMinorVersion = 72;
684 pdvi->dwBuildNumber = 3110;
685 pdvi->dwPlatformID = 1;
687 TRACE_(shell)("%lu.%lu.%lu.%lu\n",
688 pdvi->dwMajorVersion, pdvi->dwMinorVersion,
689 pdvi->dwBuildNumber, pdvi->dwPlatformID);
693 /*************************************************************************
694 * global variables of the shell32.dll
695 * all are once per process
698 void (WINAPI* pDLLInitComctl)(LPVOID);
699 INT (WINAPI* pImageList_AddIcon) (HIMAGELIST himl, HICON hIcon);
700 INT (WINAPI* pImageList_ReplaceIcon) (HIMAGELIST, INT, HICON);
701 HIMAGELIST (WINAPI * pImageList_Create) (INT,INT,UINT,INT,INT);
702 BOOL (WINAPI* pImageList_Draw) (HIMAGELIST himl, int i, HDC hdcDest, int x, int y, UINT fStyle);
703 HICON (WINAPI * pImageList_GetIcon) (HIMAGELIST, INT, UINT);
704 INT (WINAPI* pImageList_GetImageCount)(HIMAGELIST);
705 COLORREF (WINAPI *pImageList_SetBkColor)(HIMAGELIST, COLORREF);
707 LPVOID (WINAPI* pCOMCTL32_Alloc) (INT);
708 BOOL (WINAPI* pCOMCTL32_Free) (LPVOID);
710 HDPA (WINAPI* pDPA_Create) (INT);
711 INT (WINAPI* pDPA_InsertPtr) (const HDPA, INT, LPVOID);
712 BOOL (WINAPI* pDPA_Sort) (const HDPA, PFNDPACOMPARE, LPARAM);
713 LPVOID (WINAPI* pDPA_GetPtr) (const HDPA, INT);
714 BOOL (WINAPI* pDPA_Destroy) (const HDPA);
715 INT (WINAPI *pDPA_Search) (const HDPA, LPVOID, INT, PFNDPACOMPARE, LPARAM, UINT);
716 LPVOID (WINAPI *pDPA_DeletePtr) (const HDPA hdpa, INT i);
719 HICON (WINAPI *pLookupIconIdFromDirectoryEx)(LPBYTE dir, BOOL bIcon, INT width, INT height, UINT cFlag);
720 HICON (WINAPI *pCreateIconFromResourceEx)(LPBYTE bits,UINT cbSize, BOOL bIcon, DWORD dwVersion, INT width, INT height,UINT cFlag);
722 static BOOL bShell32IsInitialized = 0;
723 static HINSTANCE hComctl32;
724 static INT shell32_RefCount = 0;
726 INT shell32_ObjCount = 0;
727 HINSTANCE shell32_hInstance;
729 HIMAGELIST ShellSmallIconList = 0;
730 HIMAGELIST ShellBigIconList = 0;
733 /*************************************************************************
738 BOOL WINAPI Shell32LibMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID fImpLoad)
741 TRACE_(shell)("0x%x 0x%lx %p\n", hinstDLL, fdwReason, fImpLoad);
743 shell32_hInstance = hinstDLL;
747 case DLL_PROCESS_ATTACH:
748 if (!bShell32IsInitialized)
750 hComctl32 = LoadLibraryA("COMCTL32.DLL");
751 hUser32 = GetModuleHandleA("USER32");
753 if (hComctl32 && hUser32)
755 pDLLInitComctl=(void*)GetProcAddress(hComctl32,"InitCommonControlsEx");
757 { pDLLInitComctl(NULL);
759 pImageList_Create=(void*)GetProcAddress(hComctl32,"ImageList_Create");
760 pImageList_AddIcon=(void*)GetProcAddress(hComctl32,"ImageList_AddIcon");
761 pImageList_ReplaceIcon=(void*)GetProcAddress(hComctl32,"ImageList_ReplaceIcon");
762 pImageList_GetIcon=(void*)GetProcAddress(hComctl32,"ImageList_GetIcon");
763 pImageList_GetImageCount=(void*)GetProcAddress(hComctl32,"ImageList_GetImageCount");
764 pImageList_Draw=(void*)GetProcAddress(hComctl32,"ImageList_Draw");
765 pImageList_SetBkColor=(void*)GetProcAddress(hComctl32,"ImageList_SetBkColor");
767 /* imports by ordinal, pray that it works*/
768 pCOMCTL32_Alloc=(void*)GetProcAddress(hComctl32, (LPCSTR)71L);
769 pCOMCTL32_Free=(void*)GetProcAddress(hComctl32, (LPCSTR)73L);
770 pDPA_Create=(void*)GetProcAddress(hComctl32, (LPCSTR)328L);
771 pDPA_Destroy=(void*)GetProcAddress(hComctl32, (LPCSTR)329L);
772 pDPA_GetPtr=(void*)GetProcAddress(hComctl32, (LPCSTR)332L);
773 pDPA_InsertPtr=(void*)GetProcAddress(hComctl32, (LPCSTR)334L);
774 pDPA_DeletePtr=(void*)GetProcAddress(hComctl32, (LPCSTR)336L);
775 pDPA_Sort=(void*)GetProcAddress(hComctl32, (LPCSTR)338L);
776 pDPA_Search=(void*)GetProcAddress(hComctl32, (LPCSTR)339L);
778 pLookupIconIdFromDirectoryEx=(void*)GetProcAddress(hUser32,"LookupIconIdFromDirectoryEx");
779 pCreateIconFromResourceEx=(void*)GetProcAddress(hUser32,"CreateIconFromResourceEx");
782 { ERR_(shell)("P A N I C SHELL32 loading failed\n");
786 bShell32IsInitialized = TRUE;
791 case DLL_THREAD_ATTACH:
795 case DLL_THREAD_DETACH:
799 case DLL_PROCESS_DETACH:
801 if ( !shell32_RefCount )
803 bShell32IsInitialized = FALSE;
806 { IShellFolder_Release(pdesktopfolder);
807 pdesktopfolder = NULL;
811 FreeLibrary(hComctl32);
813 /* this one is here to check if AddRef/Release is balanced */
814 if (shell32_ObjCount)
815 { WARN_(shell)("leaving with %u objects left (memory leak)\n", shell32_ObjCount);
818 TRACE_(shell)("refcount=%u objcount=%u \n", shell32_RefCount, shell32_ObjCount);