5 * 1998 Juergen Schmied (jsch) * <juergen.schmied@metronet.de>
23 #include "cursoricon.h"
24 #include "interfaces.h"
25 #include "sysmetrics.h"
29 #include "imagelist.h"
34 #include "shell32_main.h"
36 /*************************************************************************
37 * CommandLineToArgvW [SHELL32.7]
39 LPWSTR* WINAPI CommandLineToArgvW(LPWSTR cmdline,LPDWORD numargs)
44 /* to get writeable copy */
45 cmdline = HEAP_strdupW( GetProcessHeap(), 0, cmdline);
52 while (*s && *s==0x0020)
58 argv=(LPWSTR*)HeapAlloc( GetProcessHeap(), 0, sizeof(LPWSTR)*(i+1) );
64 argv[i++]=HEAP_strdupW( GetProcessHeap(), 0, t );
66 while (*s && *s==0x0020)
77 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( HWND32 hwnd, LPCVOID code, LPCSTR cmd, DWORD arg4 )
94 FIXME(shell, "(0x%08x, %p, %s, 0x%08lx): stub\n", hwnd, code,
95 debugstr_a(cmd), arg4);
98 /*************************************************************************
99 * Shell_GetImageList [SHELL32.71]
102 * imglist[1|2] [OUT] pointer which recive imagelist handles
106 * I don't know, which pointer is which. They may have to be
109 BOOL32 WINAPI Shell_GetImageList(HIMAGELIST * imglist1,HIMAGELIST * imglist2)
110 { WARN(shell,"(%p,%p):semi-stub.\n",imglist1,imglist2);
112 { *imglist1=ShellSmallIconList;
115 { *imglist2=ShellBigIconList;
121 HIMAGELIST ShellSmallIconList = 0;
122 HIMAGELIST ShellBigIconList = 0;
124 /*************************************************************************
125 * SHGetFileInfoA [SHELL32.254]
131 DWORD WINAPI SHGetFileInfo32A(LPCSTR path,DWORD dwFileAttributes,
132 SHFILEINFO32A *psfi, UINT32 sizeofpsfi,
134 { CHAR szTemp[MAX_PATH];
138 TRACE(shell,"(%s,0x%lx,%p,0x%x,0x%x)\n",
139 path,dwFileAttributes,psfi,sizeofpsfi,flags);
141 /* translate the pidl to a path*/
142 if (flags & SHGFI_PIDL)
143 { SHGetPathFromIDList32A ((LPCITEMIDLIST)path,szTemp);
144 TRACE(shell,"pidl=%p is %s\n",path,szTemp);
147 { TRACE(shell,"path=%p\n",path);
150 if (flags & SHGFI_ATTRIBUTES)
151 { if (flags & SHGFI_PIDL)
152 { pData = _ILGetDataPointer((LPCITEMIDLIST)path);
153 psfi->dwAttributes = pData->u.generic.dwSFGAO; /* fixme: no direct access*/
157 { psfi->dwAttributes=SFGAO_FILESYSTEM;
160 FIXME(shell,"file attributes, stub\n");
163 if (flags & SHGFI_DISPLAYNAME)
164 { if (flags & SHGFI_PIDL)
165 { strcpy(psfi->szDisplayName,szTemp);
168 { strcpy(psfi->szDisplayName,path);
170 TRACE(shell,"displayname=%s\n", psfi->szDisplayName);
174 if (flags & SHGFI_TYPENAME)
175 { FIXME(shell,"get the file type, stub\n");
176 strcpy(psfi->szTypeName,"FIXME: Type");
180 if (flags & SHGFI_ICONLOCATION)
181 { FIXME(shell,"location of icon, stub\n");
182 strcpy(psfi->szDisplayName,"");
186 if (flags & SHGFI_EXETYPE)
187 FIXME(shell,"type of executable, stub\n");
189 if (flags & SHGFI_LINKOVERLAY)
190 FIXME(shell,"set icon to link, stub\n");
192 if (flags & SHGFI_OPENICON)
193 FIXME(shell,"set to open icon, stub\n");
195 if (flags & SHGFI_SELECTED)
196 FIXME(shell,"set icon to selected, stub\n");
198 if (flags & SHGFI_SHELLICONSIZE)
199 FIXME(shell,"set icon to shell size, stub\n");
201 if (flags & SHGFI_USEFILEATTRIBUTES)
202 FIXME(shell,"use the dwFileAttributes, stub\n");
204 if (flags & SHGFI_ICON)
205 { FIXME(shell,"icon handle\n");
206 if (flags & SHGFI_SMALLICON)
207 { TRACE(shell,"set to small icon\n");
208 psfi->hIcon=pImageList_GetIcon(ShellSmallIconList,32,ILD_NORMAL);
209 ret = (DWORD) ShellSmallIconList;
212 { TRACE(shell,"set to big icon\n");
213 psfi->hIcon=pImageList_GetIcon(ShellBigIconList,32,ILD_NORMAL);
214 ret = (DWORD) ShellBigIconList;
218 if (flags & SHGFI_SYSICONINDEX)
219 { FIXME(shell,"get the SYSICONINDEX\n");
221 if (flags & SHGFI_SMALLICON)
222 { TRACE(shell,"set to small icon\n");
223 ret = (DWORD) ShellSmallIconList;
226 { TRACE(shell,"set to big icon\n");
227 ret = (DWORD) ShellBigIconList;
235 /*************************************************************************
236 * SHGetFileInfo32W [SHELL32.255]
242 DWORD WINAPI SHGetFileInfo32W(LPCWSTR path,DWORD dwFileAttributes,
243 SHFILEINFO32W *psfi, UINT32 sizeofpsfi,
245 { FIXME(shell,"(%s,0x%lx,%p,0x%x,0x%x)\n",
246 debugstr_w(path),dwFileAttributes,psfi,sizeofpsfi,flags);
250 /*************************************************************************
251 * ExtractIcon32A (SHELL32.133)
253 HICON32 WINAPI ExtractIcon32A( HINSTANCE32 hInstance, LPCSTR lpszExeFileName,
255 { HGLOBAL16 handle = InternalExtractIcon(hInstance,lpszExeFileName,nIconIndex, 1);
259 HICON16* ptr = (HICON16*)GlobalLock16(handle);
260 HICON16 hIcon = *ptr;
262 GlobalFree16(handle);
268 /*************************************************************************
269 * ExtractIcon32W (SHELL32.180)
271 HICON32 WINAPI ExtractIcon32W( HINSTANCE32 hInstance, LPCWSTR lpszExeFileName,
277 exefn = HEAP_strdupWtoA(GetProcessHeap(),0,lpszExeFileName);
278 ret = ExtractIcon32A(hInstance,exefn,nIconIndex);
280 HeapFree(GetProcessHeap(),0,exefn);
284 /*************************************************************************
285 * FindExecutable32A (SHELL32.184)
287 HINSTANCE32 WINAPI FindExecutable32A( LPCSTR lpFile, LPCSTR lpDirectory,
289 { HINSTANCE32 retval=31; /* default - 'No association was found' */
292 TRACE(shell, "File %s, Dir %s\n",
293 (lpFile != NULL?lpFile:"-"),
294 (lpDirectory != NULL?lpDirectory:"-"));
296 lpResult[0]='\0'; /* Start off with an empty return string */
298 /* trap NULL parameters on entry */
299 if (( lpFile == NULL ) || ( lpResult == NULL ))
300 { /* FIXME - should throw a warning, perhaps! */
301 return 2; /* File not found. Close enough, I guess. */
305 { GetCurrentDirectory32A( sizeof(old_dir), old_dir );
306 SetCurrentDirectory32A( lpDirectory );
309 retval = SHELL_FindExecutable( lpFile, "open", lpResult );
311 TRACE(shell, "returning %s\n", lpResult);
313 SetCurrentDirectory32A( old_dir );
323 #define IDC_STATIC_TEXT 100
324 #define IDC_LISTBOX 99
325 #define IDC_WINE_TEXT 98
327 #define DROP_FIELD_TOP (-15)
328 #define DROP_FIELD_HEIGHT 15
330 extern HICON32 hIconTitleFont;
332 static BOOL32 __get_dropline( HWND32 hWnd, LPRECT32 lprect )
333 { HWND32 hWndCtl = GetDlgItem32(hWnd, IDC_WINE_TEXT);
335 { GetWindowRect32( hWndCtl, lprect );
336 MapWindowPoints32( 0, hWnd, (LPPOINT32)lprect, 2 );
337 lprect->bottom = (lprect->top += DROP_FIELD_TOP);
343 /*************************************************************************
344 * SHAppBarMessage32 [SHELL32.207]
346 UINT32 WINAPI SHAppBarMessage32(DWORD msg, PAPPBARDATA data)
347 { FIXME(shell,"(0x%08lx,%p): stub\n", msg, data);
351 case ABM_GETAUTOHIDEBAR:
353 case ABM_GETTASKBARPOS:
357 case ABM_SETAUTOHIDEBAR:
359 case ABM_WINDOWPOSCHANGED:
366 /*************************************************************************
367 * SHBrowseForFolderA [SHELL32.209]
370 LPITEMIDLIST WINAPI SHBrowseForFolder32A (LPBROWSEINFO32A lpbi)
371 { FIXME (shell, "(%lx,%s) empty stub!\n", (DWORD)lpbi, lpbi->lpszTitle);
375 /*************************************************************************
376 * SHGetDesktopFolder [SHELL32.216]
378 * SDK header win95/shlobj.h: This is equivalent to call CoCreateInstance with
380 * CoCreateInstance(CLSID_Desktop, NULL, CLSCTX_INPROC, IID_IShellFolder, &pshf);
383 * the interface to the shell desktop folder.
386 * the pdesktopfolder has to be released at the end (at dll unloading???)
388 LPSHELLFOLDER pdesktopfolder=NULL;
390 DWORD WINAPI SHGetDesktopFolder(LPSHELLFOLDER *shellfolder)
391 { HRESULT hres = E_OUTOFMEMORY;
392 LPCLASSFACTORY lpclf;
393 TRACE(shell,"%p->(%p)\n",shellfolder,*shellfolder);
399 { lpclf = IClassFactory_Constructor();
400 /* fixme: the buildin IClassFactory_Constructor is at the moment only
401 for rclsid=CLSID_ShellDesktop, so we get the right Interface (jsch)*/
403 { hres = lpclf->lpvtbl->fnCreateInstance(lpclf,NULL,(REFIID)&IID_IShellFolder, (void*)&pdesktopfolder);
404 lpclf->lpvtbl->fnRelease(lpclf);
409 { *shellfolder = pdesktopfolder;
410 pdesktopfolder->lpvtbl->fnAddRef(pdesktopfolder);
416 TRACE(shell,"-- %p->(%p)\n",shellfolder, *shellfolder);
419 /*************************************************************************
420 * SHGetPathFromIDList [SHELL32.221][NT 4.0: SHELL32.219]
422 BOOL32 WINAPI SHGetPathFromIDList32(LPCITEMIDLIST pidl,LPSTR pszPath)
423 { TRACE(shell,"(pidl=%p,%p)\n",pidl,pszPath);
424 return SHGetPathFromIDList32A(pidl,pszPath);
427 /*************************************************************************
428 * SHGetSpecialFolderLocation [SHELL32.223]
429 * gets the folder locations from the registry and creates a pidl
430 * creates missing reg keys and directorys
434 * nFolder [I] CSIDL_xxxxx
435 * ppidl [O] PIDL of a special folder
441 * - look for "User Shell Folder" first
444 HRESULT WINAPI SHGetSpecialFolderLocation(HWND32 hwndOwner, INT32 nFolder, LPITEMIDLIST * ppidl)
445 { LPSHELLFOLDER shellfolder;
446 DWORD pchEaten,tpathlen=MAX_PATH,type,dwdisp,res;
447 CHAR pszTemp[256],buffer[256],tpath[MAX_PATH],npath[MAX_PATH];
448 LPWSTR lpszDisplayName = (LPWSTR)&pszTemp[0];
452 { FT_UNKNOWN= 0x00000000,
454 FT_DESKTOP= 0x00000002,
455 FT_SPECIAL= 0x00000003
458 TRACE(shell,"(%04x,0x%x,%p)\n", hwndOwner,nFolder,ppidl);
460 strcpy(buffer,"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders\\");
462 res=RegCreateKeyEx32A(HKEY_CURRENT_USER,buffer,0,NULL,REG_OPTION_NON_VOLATILE,KEY_WRITE,NULL,&key,&dwdisp);
464 { ERR(shell,"Could not create key %s %08lx \n",buffer,res);
465 return E_OUTOFMEMORY;
470 { case CSIDL_BITBUCKET:
471 strcpy (buffer,"xxx"); /*not in the registry*/
472 TRACE (shell,"looking for Recycler\n");
476 strcpy (buffer,"xxx"); /*virtual folder*/
477 TRACE (shell,"looking for Control\n");
481 strcpy (buffer,"xxx"); /*virtual folder*/
482 TRACE (shell,"looking for Desktop\n");
485 case CSIDL_DESKTOPDIRECTORY:
486 strcpy (buffer,"Desktop");
489 strcpy (buffer,"xxx"); /*virtual folder*/
490 TRACE (shell,"looking for Drives\n");
494 strcpy (buffer,"Fonts");
497 strcpy (buffer,"NetHood");
500 strcpy (buffer,"xxx"); /*virtual folder*/
501 TRACE (shell,"looking for Network\n");
505 strcpy (buffer,"Personal");
507 case CSIDL_FAVORITES:
508 strcpy (buffer,"Favorites");
511 strcpy (buffer,"PrintHood");
514 strcpy (buffer,"Programs");
517 strcpy (buffer,"Recent");
520 strcpy (buffer,"SendTo");
522 case CSIDL_STARTMENU:
523 strcpy (buffer,"Start Menu");
526 strcpy (buffer,"Startup");
528 case CSIDL_TEMPLATES:
529 strcpy (buffer,"Templates");
532 ERR (shell,"unknown CSIDL\n");
537 TRACE(shell,"Key=%s\n",buffer);
543 /* Directory: get the value from the registry, if its not there
544 create it and the directory*/
545 if (RegQueryValueEx32A(key,buffer,NULL,&type,tpath,&tpathlen))
546 { GetWindowsDirectory32A(npath,MAX_PATH);
547 PathAddBackslash(npath);
549 { case CSIDL_DESKTOPDIRECTORY:
550 strcat (npath,"Desktop");
553 strcat (npath,"Fonts");
556 strcat (npath,"NetHood");
559 strcpy (npath,"C:\\Personal");
561 case CSIDL_FAVORITES:
562 strcat (npath,"Favorites");
565 strcat (npath,"PrintHood");
568 strcat (npath,"Start Menu");
569 CreateDirectory32A(npath,NULL);
570 strcat (npath,"\\Programs");
573 strcat (npath,"Recent");
576 strcat (npath,"SendTo");
578 case CSIDL_STARTMENU:
579 strcat (npath,"Start Menu");
582 strcat (npath,"Start Menu");
583 CreateDirectory32A(npath,NULL);
584 strcat (npath,"\\Startup");
586 case CSIDL_TEMPLATES:
587 strcat (npath,"Templates");
591 return E_OUTOFMEMORY;
593 if (RegSetValueEx32A(key,buffer,0,REG_SZ,npath,sizeof(npath)+1))
594 { ERR(shell,"could not create value %s\n",buffer);
596 return E_OUTOFMEMORY;
598 TRACE(shell,"value %s=%s created\n",buffer,npath);
599 CreateDirectory32A(npath,NULL);
604 strcpy (tpath,"Desktop");
607 if (nFolder==CSIDL_DRIVES)
608 strcpy (tpath,"My Computer");
612 return E_OUTOFMEMORY;
617 TRACE(shell,"Value=%s\n",tpath);
618 LocalToWideChar32(lpszDisplayName, tpath, 256);
620 if (SHGetDesktopFolder(&shellfolder)==S_OK)
621 { shellfolder->lpvtbl->fnParseDisplayName(shellfolder,hwndOwner, NULL,lpszDisplayName,&pchEaten,ppidl,NULL);
622 shellfolder->lpvtbl->fnRelease(shellfolder);
625 TRACE(shell, "-- (new pidl %p)\n",*ppidl);
628 /*************************************************************************
629 * SHHelpShortcuts_RunDLL [SHELL32.224]
632 DWORD WINAPI SHHelpShortcuts_RunDLL (DWORD dwArg1, DWORD dwArg2, DWORD dwArg3, DWORD dwArg4)
633 { FIXME (exec, "(%lx, %lx, %lx, %lx) empty stub!\n",
634 dwArg1, dwArg2, dwArg3, dwArg4);
639 /*************************************************************************
640 * SHLoadInProc [SHELL32.225]
644 DWORD WINAPI SHLoadInProc (DWORD dwArg1)
645 { FIXME (shell, "(%lx) empty stub!\n", dwArg1);
649 /*************************************************************************
650 * ShellExecute32A (SHELL32.245)
652 HINSTANCE32 WINAPI ShellExecute32A( HWND32 hWnd, LPCSTR lpOperation,
653 LPCSTR lpFile, LPCSTR lpParameters,
654 LPCSTR lpDirectory, INT32 iShowCmd )
656 return ShellExecute16( hWnd, lpOperation, lpFile, lpParameters,
657 lpDirectory, iShowCmd );
661 /*************************************************************************
662 * AboutDlgProc32 (not an exported API function)
664 LRESULT WINAPI AboutDlgProc32( HWND32 hWnd, UINT32 msg, WPARAM32 wParam,
667 char Template[512], AppTitle[512];
672 { case WM_INITDIALOG:
673 { ABOUT_INFO *info = (ABOUT_INFO *)lParam;
675 { const char* const *pstr = SHELL_People;
676 SendDlgItemMessage32A(hWnd, stc1, STM_SETICON32,info->hIcon, 0);
677 GetWindowText32A( hWnd, Template, sizeof(Template) );
678 sprintf( AppTitle, Template, info->szApp );
679 SetWindowText32A( hWnd, AppTitle );
680 SetWindowText32A( GetDlgItem32(hWnd, IDC_STATIC_TEXT),
681 info->szOtherStuff );
682 hWndCtl = GetDlgItem32(hWnd, IDC_LISTBOX);
683 SendMessage32A( hWndCtl, WM_SETREDRAW, 0, 0 );
684 SendMessage32A( hWndCtl, WM_SETFONT, hIconTitleFont, 0 );
686 { SendMessage32A( hWndCtl, LB_ADDSTRING32, (WPARAM32)-1, (LPARAM)*pstr );
689 SendMessage32A( hWndCtl, WM_SETREDRAW, 1, 0 );
697 HDC32 hDC = BeginPaint32( hWnd, &ps );
699 if( __get_dropline( hWnd, &rect ) )
700 GRAPH_DrawLines( hDC, (LPPOINT32)&rect, 1, GetStockObject32( BLACK_PEN ) );
701 EndPaint32( hWnd, &ps );
705 case WM_LBTRACKPOINT:
706 hWndCtl = GetDlgItem32(hWnd, IDC_LISTBOX);
707 if( (INT16)GetKeyState16( VK_CONTROL ) < 0 )
708 { if( DragDetect32( hWndCtl, *((LPPOINT32)&lParam) ) )
709 { INT32 idx = SendMessage32A( hWndCtl, LB_GETCURSEL32, 0, 0 );
711 { INT32 length = SendMessage32A( hWndCtl, LB_GETTEXTLEN32, (WPARAM32)idx, 0 );
712 HGLOBAL16 hMemObj = GlobalAlloc16( GMEM_MOVEABLE, length + 1 );
713 char* pstr = (char*)GlobalLock16( hMemObj );
716 { HCURSOR16 hCursor = LoadCursor16( 0, MAKEINTRESOURCE16(OCR_DRAGOBJECT) );
717 SendMessage32A( hWndCtl, LB_GETTEXT32, (WPARAM32)idx, (LPARAM)pstr );
718 SendMessage32A( hWndCtl, LB_DELETESTRING32, (WPARAM32)idx, 0 );
719 UpdateWindow32( hWndCtl );
720 if( !DragObject16((HWND16)hWnd, (HWND16)hWnd, DRAGOBJ_DATA, 0, (WORD)hMemObj, hCursor) )
721 SendMessage32A( hWndCtl, LB_ADDSTRING32, (WPARAM32)-1, (LPARAM)pstr );
724 GlobalFree16( hMemObj );
730 case WM_QUERYDROPOBJECT:
732 { LPDRAGINFO lpDragInfo = (LPDRAGINFO)PTR_SEG_TO_LIN((SEGPTR)lParam);
733 if( lpDragInfo && lpDragInfo->wFlags == DRAGOBJ_DATA )
735 if( __get_dropline( hWnd, &rect ) )
736 { POINT32 pt = { lpDragInfo->pt.x, lpDragInfo->pt.y };
737 rect.bottom += DROP_FIELD_HEIGHT;
738 if( PtInRect32( &rect, pt ) )
739 { SetWindowLong32A( hWnd, DWL_MSGRESULT, 1 );
749 { LPDRAGINFO lpDragInfo = (LPDRAGINFO)PTR_SEG_TO_LIN((SEGPTR)lParam);
750 if( lpDragInfo && lpDragInfo->wFlags == DRAGOBJ_DATA && lpDragInfo->hList )
751 { char* pstr = (char*)GlobalLock16( (HGLOBAL16)(lpDragInfo->hList) );
753 { static char __appendix_str[] = " with";
755 hWndCtl = GetDlgItem32( hWnd, IDC_WINE_TEXT );
756 SendMessage32A( hWndCtl, WM_GETTEXT, 512, (LPARAM)Template );
757 if( !lstrncmp32A( Template, "WINE", 4 ) )
758 SetWindowText32A( GetDlgItem32(hWnd, IDC_STATIC_TEXT), Template );
760 { char* pch = Template + strlen(Template) - strlen(__appendix_str);
762 SendMessage32A( GetDlgItem32(hWnd, IDC_LISTBOX), LB_ADDSTRING32,
763 (WPARAM32)-1, (LPARAM)Template );
766 lstrcpy32A( Template, pstr );
767 lstrcat32A( Template, __appendix_str );
768 SetWindowText32A( hWndCtl, Template );
769 SetWindowLong32A( hWnd, DWL_MSGRESULT, 1 );
778 { EndDialog32(hWnd, TRUE);
787 /*************************************************************************
788 * ShellAbout32A (SHELL32.243)
790 BOOL32 WINAPI ShellAbout32A( HWND32 hWnd, LPCSTR szApp, LPCSTR szOtherStuff,
795 info.szOtherStuff = szOtherStuff;
797 if (!hIcon) info.hIcon = LoadIcon16( 0, MAKEINTRESOURCE16(OIC_WINEICON) );
798 return DialogBoxIndirectParam32A( WIN_GetWindowInstance( hWnd ),
799 SYSRES_GetResPtr( SYSRES_DIALOG_SHELL_ABOUT_MSGBOX ),
800 hWnd, AboutDlgProc32, (LPARAM)&info );
804 /*************************************************************************
805 * ShellAbout32W (SHELL32.244)
807 BOOL32 WINAPI ShellAbout32W( HWND32 hWnd, LPCWSTR szApp, LPCWSTR szOtherStuff,
814 info.szApp = HEAP_strdupWtoA( GetProcessHeap(), 0, szApp );
815 info.szOtherStuff = HEAP_strdupWtoA( GetProcessHeap(), 0, szOtherStuff );
817 if (!hIcon) info.hIcon = LoadIcon16( 0, MAKEINTRESOURCE16(OIC_WINEICON) );
818 ret = DialogBoxIndirectParam32A( WIN_GetWindowInstance( hWnd ),
819 SYSRES_GetResPtr( SYSRES_DIALOG_SHELL_ABOUT_MSGBOX ),
820 hWnd, AboutDlgProc32, (LPARAM)&info );
821 HeapFree( GetProcessHeap(), 0, (LPSTR)info.szApp );
822 HeapFree( GetProcessHeap(), 0, (LPSTR)info.szOtherStuff );
826 /*************************************************************************
827 * Shell_NotifyIcon [SHELL32.296]
829 * This function is supposed to deal with the systray.
830 * Any ideas on how this is to be implimented?
832 BOOL32 WINAPI Shell_NotifyIcon( DWORD dwMessage, PNOTIFYICONDATA pnid )
837 /*************************************************************************
838 * Shell_NotifyIcon [SHELL32.297]
840 * This function is supposed to deal with the systray.
841 * Any ideas on how this is to be implimented?
843 BOOL32 WINAPI Shell_NotifyIconA(DWORD dwMessage, PNOTIFYICONDATA pnid )
848 /*************************************************************************
851 void WINAPI FreeIconList( DWORD dw )
852 { FIXME(shell, "(%lx): stub\n",dw);
855 /*************************************************************************
856 * SHGetPathFromIDList32A [SHELL32.261][NT 4.0: SHELL32.220]
863 * path from a passed PIDL.
869 * fnGetDisplayNameOf can return different types of OLEString
871 DWORD WINAPI SHGetPathFromIDList32A (LPCITEMIDLIST pidl,LPSTR pszPath)
873 LPSHELLFOLDER shellfolder;
874 CHAR buffer[MAX_PATH],tpath[MAX_PATH];
875 DWORD type,tpathlen=MAX_PATH,dwdisp;
878 TRACE(shell,"(pidl=%p,%p)\n",pidl,pszPath);
881 { strcpy(buffer,"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders\\");
883 if (RegCreateKeyEx32A(HKEY_CURRENT_USER,buffer,0,NULL,REG_OPTION_NON_VOLATILE,KEY_WRITE,NULL,&key,&dwdisp))
884 { return E_OUTOFMEMORY;
887 strcpy (buffer,"Desktop"); /*registry name*/
888 if ( RegQueryValueEx32A(key,buffer,NULL,&type,tpath,&tpathlen))
889 { GetWindowsDirectory32A(tpath,MAX_PATH);
890 PathAddBackslash(tpath);
891 strcat (tpath,"Desktop"); /*folder name*/
892 RegSetValueEx32A(key,buffer,0,REG_SZ,tpath,tpathlen);
893 CreateDirectory32A(tpath,NULL);
896 strcpy(pszPath,tpath);
899 { if (SHGetDesktopFolder(&shellfolder)==S_OK)
900 { shellfolder->lpvtbl->fnGetDisplayNameOf(shellfolder,pidl,SHGDN_FORPARSING,&lpName);
901 shellfolder->lpvtbl->fnRelease(shellfolder);
903 /*WideCharToLocal32(pszPath, lpName.u.pOleStr, MAX_PATH);*/
904 strcpy(pszPath,lpName.u.cStr);
905 /* fixme free the olestring*/
907 TRACE(shell,"-- (%s)\n",pszPath);
910 /*************************************************************************
911 * SHGetPathFromIDList32W [SHELL32.262]
913 DWORD WINAPI SHGetPathFromIDList32W (LPCITEMIDLIST pidl,LPWSTR pszPath)
914 { char sTemp[MAX_PATH];
916 FIXME (shell,"(pidl=%p)\n", pidl);
918 SHGetPathFromIDList32A (pidl, sTemp);
919 lstrcpyAtoW(pszPath, sTemp);
920 TRACE(shell,"-- (%s)\n",debugstr_w(pszPath));
925 void (CALLBACK* pDLLInitComctl)();
926 INT32 (CALLBACK* pImageList_AddIcon) (HIMAGELIST himl, HICON32 hIcon);
927 INT32(CALLBACK* pImageList_ReplaceIcon) (HIMAGELIST, INT32, HICON32);
928 HIMAGELIST (CALLBACK * pImageList_Create) (INT32,INT32,UINT32,INT32,INT32);
929 HICON32 (CALLBACK * pImageList_GetIcon) (HIMAGELIST, INT32, UINT32);
931 /*************************************************************************
935 * at the moment the icons are extracted from shell32.dll
936 * free the imagelists
938 HINSTANCE32 shell32_hInstance;
940 BOOL32 WINAPI Shell32LibMain(HINSTANCE32 hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
944 CHAR szShellPath[MAX_PATH];
945 HINSTANCE32 hComctl32;
948 TRACE(shell,"0x%x 0x%lx %p\n", hinstDLL, fdwReason, lpvReserved);
950 shell32_hInstance = hinstDLL;
952 GetWindowsDirectory32A(szShellPath,MAX_PATH);
953 PathAddBackslash(szShellPath);
954 strcat(szShellPath,"system\\shell32.dll");
956 if (fdwReason==DLL_PROCESS_ATTACH)
957 { hComctl32 = LoadLibrary32A("COMCTL32.DLL");
959 { pDLLInitComctl=GetProcAddress32(hComctl32,"InitCommonControlsEx");
963 pImageList_Create=GetProcAddress32(hComctl32,"ImageList_Create");
964 pImageList_AddIcon=GetProcAddress32(hComctl32,"ImageList_AddIcon");
965 pImageList_ReplaceIcon=GetProcAddress32(hComctl32,"ImageList_ReplaceIcon");
966 pImageList_GetIcon=GetProcAddress32(hComctl32,"ImageList_GetIcon");
967 FreeLibrary32(hComctl32);
970 { /* panic, imediately exit wine*/
971 ERR(shell,"P A N I C error getting functionpointers\n");
974 if ( ! ShellSmallIconList )
975 { if ( (ShellSmallIconList = pImageList_Create(sysMetrics[SM_CXSMICON],sysMetrics[SM_CYSMICON],ILC_COLORDDB | ILC_MASK,0,0x20)) )
976 { for (index=0;index < 40; index++)
977 { if ( ! ( htmpIcon = ExtractIcon32A(hinstDLL, szShellPath, index))
978 || ( -1 == (iiconindex = pImageList_AddIcon (ShellSmallIconList, htmpIcon))) )
979 { ERR(shell,"could not initialize iconlist (is shell32.dll in the system directory?)\n");
985 if ( ! ShellBigIconList )
986 { if ( (ShellBigIconList = pImageList_Create(SYSMETRICS_CXSMICON, SYSMETRICS_CYSMICON,ILC_COLORDDB | ILC_MASK,0,0x20)) )
987 { for (index=0;index < 40; index++)
988 { if ( ! (htmpIcon = ExtractIcon32A( hinstDLL, szShellPath, index))
989 || (-1 == (iiconindex = pImageList_AddIcon (ShellBigIconList, htmpIcon))) )
990 { ERR(shell,"could not initialize iconlist (is shell32.dll in the system directory?)\n");
996 TRACE(shell,"hIconSmall=%p hIconBig=%p\n",ShellSmallIconList, ShellBigIconList);