Sun Sep 27 14:25:38 1998 Petter Reinholdtsen <pere@td.org.uit.no> * [files/drive.c] Make sure GetDriveType32A() handles param NULL. Added some doc on function. Sun Sep 27 14:07:26 1998 Huw D M Davies <daviesh@abacus.physics.ox.ac.uk> * [controls/edit.c] [windows/win.c] Don't call SetWindowLong() in EDIT_WM_NCREATE. Fix SetWindowLong(GWL_[EX]STYLE) to work for 16bit windows. Remove UpdateWindow() call. Sun Sep 27 13:41:22 1998 Alexandre Julliard <julliard@lrc.epfl.ch> * [scheduler/*.c] [server/event.c] [server/mutex.c] [server/semaphore.c] Implemented server-side synchronisation objects. Sun Sep 27 01:13:35 1998 Alex Priem <alexp@sci.kun.nl> * [dlls/comctl32/treeview.c] [include/treeview.h] [include/comctl.h] Treeview implementation. * [dlls/comctl32/trackbar.c] [include/trackbar.h] Trackbar implementation. Sat Sep 26 20:49:13 1998 Ulrich Weigand <weigand@informatik.uni-erlangen.de> * [if1632/thunk.c] [tools/build.c] [win32/kernel32.c] Bugfix: several problems with flat thunks fixed. * [memory/selector.c] Bugfix: IsBad...Ptr16 didn't work for limit_in_pages segments. * [scheduler/thread.c] Bugfix: CreateThread: Allow id parameter == NULL. * [objects/gdiobj.c] Bugfix: IsGDIObject: Return correct object type for stock objects. * [msdos/dpmi.c] Bugfix: fixed typo in INT_DoRealModeInt. * [msdos/int21.c] Bugfix: int21 READ *must* use WIN16_hread, not _hread16. * [if1632/kernel.spec] [if1632/dummy.c] [if1632/thunk.c] [loader/ne/module.c] [scheduler/event.c] [scheduler/synchro.c] [scheduler/thread.c] [win32/kernel32.c] [win32/ordinals.c] Added names/stubs for all undocumented KERNEL routines (Win95). Added the following undoc. 16-bit equivalents to Win32 routines: KERNEL.441-443,449-453,456-462,471-476,479-486,488. Added stubs for some other KERNEL routines. * [memory/heap.c] [memory/global.c] [include/global.h] Implemented Local32... 32-bit local heap routines (KERNEL.208-215, 229). * [miscemu/instr.c] [loader/module.c] [include/module.h] Implemented __GP fault handling and HasGPHandler (KERNEL.338). * [misc/error.c] Implemented LogParamErrorRegs (KERNEL.327). * [loader/task.c] [include/windows.h] Implemented GetCodeInfo (KERNEL.104). * [loader/task.c] [scheduler/thread.c] [include/thread.h] Implemented [GS]etThreadQueue and [GS]etFastQueue (KERNEL.463/4, 624/5). * [if1632/gdi.spec] [objects/dc.c] [objects/dib.c] [objects/bitmap.c] [include/windows.h] Bugfix: fixed wrong parameter for CreateDIBSection16. Added [GS]etDIBColorTable16, stub for GetBoundsRect16. Partially implemented BITMAP_GetObject16 for DIBs. * [if1632/gdi.spec] [relay32/gdi32.spec] [objects/palette.c] Added some GDI stubs. * [if1632/Makefile.in] [if1632/display.spec] [if1632/mouse.spec] [if1632/keyboard.spec] [if1632/builtin.c] [windows/keyboard.c] Added some stubs for Win16 drivers: KEYBOARD, MOUSE, DISPLAY. * [if1632/wprocs.spec] [msdos/vxd.c] Added some stubs for VxDs: VMM, ConfigMG, TimerAPI. * [msdos/int2f.c] Added some stubs for real-mode network drivers. Sat Sep 26 18:18:18 1998 Marcus Meissner <marcus@jet.franken.de> * [configure.in] Merged in some more of the FreeBSD ports/emulators/wine patches. (Maintainer(s) of this port: You can just submit these patches to Alexandre directly.) * [loader/pe_image.c] Check filesize of image against size derived from header to spot truncated executeables without crashing. * [files/directory.c] Set envvar "COMSPEC". One win32(!!) program crashes without it. * [multimedia/mmio.c] Added mmioSetInfo32. * [include/file.h] Return STD_ERROR_HANDLE for AUX and PRT dos handles. * [loader/module.c] Handle executeables with spaces in their names a bit better in CreateProcess. * [relay32/msvfw32.spec][if1632/msvideo.spec][multimedia/msvideo.c][include/vfw.h] Started on MS Video support (can load Win32 ICMs). * [tools/testrun] A bit smarter use of ps. * [memory/virtual.c] Report PAGE_GUARDed pages as PAGE_PROTECTED (AutoCAD LT R17 fails without that check (since Win95 doesn't know about PAGE_GUARD)). Sat Sep 26 15:04:05 1998 Ove Kaaven <ovek@arcticnet.no> * [include/miscemu.h] [if1632/builtin.c] [loader/task.c] [miscemu/instr.c] [msdos/dpmi.c] [msdos/int21.c] [msdos/interrupts.c] [windows/user.c] INT_[S|G]etHandler was renamed to INT_[S|G]etPMHandler. Added handlers to deal with real-mode interrupts; DOS programs are now able to hook real-mode interrupts. * [loader/dos/module.c] [msdos/dosmem.c] [msdos/int21.c] Moved real-mode interrupt table initialization to msdos/dosmem.c, and made new V86 tasks get a full copy of the existing "system memory" instead of almost empty space. Misc fixes. * [include/dosexe.h] [loader/dos/module.c] [msdos/dpmi.c] [msdos/int2f.c] First shot at letting DOS programs start up DPMI (but DPMI is still disabled for DOS programs, for pkunzip's sake). * [include/debugger.h] [debugger/break.c] [debugger/dbg.y] [debugger/registers.c] [debugger/memory.c] [debugger/info.c] [loader/dos/dosvm.c] First shot at making Wine's debugger work for DOS programs. The -debug flag works, as do "nexti" and "stepi". Sat Sep 26 13:13:13 1998 Juergen Schmied <juergen.schmied@metronet.de> * [dlls/shell32/dataobject.c] New classes IEnumFORMATETC implemented, IDataObject stubs. * [dlls/shell32/*.*][relay32/shell32.spec] Bugfixes. New: ICM_InsertItem(), ILCreateFromPath(). Implemented: ILCloneFirst(). Stubs: ILIsEqual(), ILFindChild(), SHLogILFromFSIL(), PathMatchSpec(), PathIsExe(). Changed: ILGetSize(), _ILIsDesktop(), PathCombine(). * [include/shlobj.h] New SHLGUID's New structures: DVTARGETDEVICE32, STGMEDIUM32, FORMATETC32, CLIPFORMAT32. New interfaces: IEnumFORMATETC, IDataObject, ICommDlgBrowser IDockingWindowFrame, IServiceProvider. * [dlls/shell32/folders.c] Stubs for IShellLink. * [loader/resource.c] Small fixes. * [misc/crtdll.c][relay32/crtdll.spec] New __dllonexit(). * [windows/message.c] SendNotifyMessageA, SendMessageCallBack32A half implemented. * [controls/edit.c] EDIT_WM_SetText set EF_UPDATE flag not for ES_MULTILINE. * [files/file.c] Handling of fileposition fixed. Fri Sep 25 18:13:30 1998 Patrik Stridvall <ps@leissner.se> * [include/windows.h] [include/wintypes.h] [ole/ole2nls.h] [relay32/kernel32.spec] Implemented EnumDateFormats and EnumTimeFormats. Only adds US English support. * [Makefile.in] [configure.in] [dlls/Makefile.in] [dlls/psapi/Makefile.in] [dlls/psapi/psapi_main.c] New files to implement stubs for PSAPI.DLL (NT only). * [relay32/Makefile.in] [relay32/builtin32.c] [relay32/psapi.spec] New spec file for PSAPI.DLL (NT only). * [scheduler/handle.c] HANDLE_GetObjPtr should only interpret the pseudo handles as the current thread or the current process if a thread or a process is requested. * [include/winversion.h] [misc/version.c] Adds the global function VERSION_GetVersion() so functions can have different behavior depending on the -winver flag. * [include/oledlg.h] [ole/oledlg.c] Minor fixes. * [windows/winproc.c] Minor changes. * [include/imm.h] [misc/imm.c] Now returns correct values under both Windows 95 and NT 4.0. Thu Sep 24 22:11:44 1998 Kristian Nielsen <kristian.nielsen@risoe.dk> * [configure.in] [include/acconfig.h] [include/thread.h] [scheduler/sysdeps.c] Autoconfig test for non-reentrant libc. Wed Sep 23 19:52:12 1998 Matthew Becker <mbecker@glasscity.net> * [*/*.c] Miscellaneous documentation updates and debugging output standardizations. * [objects/clipping.c] Added ExtSelectClipRgn. Wed Sep 23 00:03:28 EDT 1998 Pete Ratzlaff <pratzlaff@cfa.harvard.edu> * [include/windows.h] [if1632/user.spec] [relay32/user32.spec] [windows/keyboard.c] Added, marginally implemented, GetKeyboardLayoutName(). Only returns US English keyboard name. Tue Sep 22 16:32:41 1998 Marcel Baur <mbaur@iiic.ethz.ch> * [programs/control/*] New Winelib application. Mon Sep 21 00:29:18 1998 Peter Hunnisett <hunnise@nortel.ca> * [include/dplay.h][multimedia/dplay.c][ole/compobj.c] Added all DirectPlayLobby interfaces and enhanced DirectPlay and DirectPlayLobby support. Still not all that much. Useful enough if you just need to start a program, don't try any real dplay/lobby stuff. * [documentation/status/directplay] Added a very little bit. * [graphics/ddraw.c] - Call to SetWindowLong32A wasn't working because there was no memory set aside when the window class was registered. - Fixed some xlib reference counting and change the behaviour of DirectDrawSurface3_SetPalette to mimic observed behaviour (palette is associated will all backbuffers) - Also stored all palette colour fields and spit back our saved colour fields rather than query X for them. - Added plenty of AddRef and Release traces. - Added Xlib support for using -desktop option. - Fixed Xlib message handling. Messages weren't being passed to the application. Fixes mouse movements in some xlib DDraw games. - Added a few stubs. * [windows/win.c][include/winerror.h] Fixed up some error handling in WIN_SetWindowLong. SetLastError wasn't being used. Could cause problems with 0 return codes. Added new error in winerror (1400). * [AUTHORS] [include/authors.h] Added myself as a Wine author. Sun Sep 20 21:22:44 1998 Alexander Larsson <alla@lysator.liu.se> * [loader/module.c] Changed GetModuleFileName32A so that is returns the long version of the filename. Note that just the name is long, not the directories. Sat Sep 19 20:05:30 1998 Per Ångström <pang@mind.nu> * [controls/menu.c] Made a couple of fixes to make life easier for applications that alter their menus at runtime. * [windows/defdlg.c] Removed the cast of the return value from dialog procedures to a 16-bit bool. The return value needs to retain all its 32 bits, since it is not always a bool, such as when responding to the WM_NCHITTEST message. Fri Sep 18 11:30:38 1998 Sergey Turchanov <turchanov@usa.net> * [loader/resource.c] Fixed very funny bug (though gravely affecting further excecution) with FindResource[Ex]32 functions. * [include/multimon.h] [windows/multimon.c] [relay32/user32.spec] [include/windows.h] [windows/sysmetrics.c] Default implementation for Multimonitor API. * [include/windows.h] [windows/winpos.c] Fixed incorrect declaration (and behaviour) of GetWindowRect32. Wed Sep 16 10:21:15 1998 Gerard Patel <G.Patel@Wanadoo.fr> * [controls/edit.c] Fixed EDIT_EM_GetLine to use correctly length of lines. Tue Sep 15 20:40:16 1998 Eric Kohl <ekohl@abo.rhein-zeitung.de> * [misc/tweak.c][include/tweak.h][controls/menu.c] Replaced the tweak graphic routines by calls to DrawEdge32(). * [misc/tweak.c][include/tweak.h][documentation/win95look] [wine.ini][*/*] Changed "look and feel" selection. Allows Win3.1, Win95 and Win98 (no GUI code implemented) look and feel. * [dlls/comctl32/header.c][include/header.h][include/commctrl.h] Started callback item support and did some minor improvements. * [dlls/comctl32/imagelist.c] Fixed bug in transparent image display. ImageList_GetIcon is still buggy :-( * [dlls/comctl32/toolbar.c] Fixed button drawing (partial hack). * [dlls/comctl32/commctrl.c] Fixed MenuHelp(). * [controls/button.c] Added 3d effect for groupbox. * [windows/msgbox.c] Added font support for message boxes. * [windows/nonclient.c] Fixed window moving bug. * [dlls/comctl32/*.c] Various improvements. * [dlls/comctl32/listview.c][dlls/comctl32/rebar.c] [include/commctrl.h] More messages. * [windows/syscolor.c][include/windows.h] Introduced new Win98 system colors. Tue Sep 15 18:29:45 1998 Wesley Filardo <eightknots@aol.com> * [files/profile.c] Added support in PROFILE_LoadWineIni for -config option * [misc/main.c] [include/options.h] Added -config option. Tue Sep 15 18:22:26 1998 Petter Reinholdtsen <pere@td.org.uit.no> * [documentation/Makefile.in] Make sure directory exists before installing into it. Tue Sep 15 01:47:33 1998 Pablo Saratxaga <pablo.sarachaga@ping.be> * [ole/nls/*] [ole/ole2nls.c] [include/winnls.h] Fixed a few errors and completed some NLS files. Mon Sep 14 01:23:45 1998 Joseph Pranevich <knight@baltimore.wwaves.com> * [include/miscemu.h] [msdos/interrupts.c] Removed a compilation warning, added INT 25 to the list of interrupts callable from DOS applications, added a debug message when unsupported interrupts are used. Sun Sep 13 19:55:22 1998 Lawson Whitney <lawson_whitney@juno.com> * [if1632/relay.c] CallProcEx32W should not reverse arguments. Sun Aug 17 21:18:12 1998 Eric Pouech <eric.pouech@lemel.fr> * [multimedia/midi.c] [multimedia/init.c] [multimedia/mmsys.c] [include/multimedia.h] [include/mmsystem.h] [multimedia/Makefile.in] [multimedia/midipatch.c] [if1632/multimedia.spec] Made MIDI input and output functional on OSS capable systems. * [multimedia/timer.c] Changes to trigger callbacks at the accurate pace even when fake timers are used.
973 lines
28 KiB
C
973 lines
28 KiB
C
/*
|
|
* Shell basics
|
|
*
|
|
* 1998 Marcus Meissner
|
|
* 1998 Juergen Schmied (jsch) * <juergen.schmied@metronet.de>
|
|
*/
|
|
#include <assert.h>
|
|
#include <stdlib.h>
|
|
#include <string.h>
|
|
#include <unistd.h>
|
|
#include <ctype.h>
|
|
#include "windows.h"
|
|
#include "winerror.h"
|
|
#include "file.h"
|
|
#include "shell.h"
|
|
#include "heap.h"
|
|
#include "module.h"
|
|
#include "neexe.h"
|
|
#include "resource.h"
|
|
#include "dlgs.h"
|
|
#include "win.h"
|
|
#include "graphics.h"
|
|
#include "cursoricon.h"
|
|
#include "interfaces.h"
|
|
#include "sysmetrics.h"
|
|
#include "shlobj.h"
|
|
#include "debug.h"
|
|
#include "winreg.h"
|
|
#include "imagelist.h"
|
|
#include "commctrl.h"
|
|
#include "authors.h"
|
|
|
|
#include "pidl.h"
|
|
#include "shell32_main.h"
|
|
|
|
/*************************************************************************
|
|
* CommandLineToArgvW [SHELL32.7]
|
|
*/
|
|
LPWSTR* WINAPI CommandLineToArgvW(LPWSTR cmdline,LPDWORD numargs)
|
|
{ LPWSTR *argv,s,t;
|
|
int i;
|
|
TRACE(shell,"\n");
|
|
|
|
/* to get writeable copy */
|
|
cmdline = HEAP_strdupW( GetProcessHeap(), 0, cmdline);
|
|
s=cmdline;i=0;
|
|
while (*s)
|
|
{ /* space */
|
|
if (*s==0x0020)
|
|
{ i++;
|
|
s++;
|
|
while (*s && *s==0x0020)
|
|
s++;
|
|
continue;
|
|
}
|
|
s++;
|
|
}
|
|
argv=(LPWSTR*)HeapAlloc( GetProcessHeap(), 0, sizeof(LPWSTR)*(i+1) );
|
|
s=t=cmdline;
|
|
i=0;
|
|
while (*s)
|
|
{ if (*s==0x0020)
|
|
{ *s=0;
|
|
argv[i++]=HEAP_strdupW( GetProcessHeap(), 0, t );
|
|
*s=0x0020;
|
|
while (*s && *s==0x0020)
|
|
s++;
|
|
if (*s)
|
|
t=s+1;
|
|
else
|
|
t=s;
|
|
continue;
|
|
}
|
|
s++;
|
|
}
|
|
if (*t)
|
|
argv[i++]=(LPWSTR)HEAP_strdupW( GetProcessHeap(), 0, t );
|
|
HeapFree( GetProcessHeap(), 0, cmdline );
|
|
argv[i]=NULL;
|
|
*numargs=i;
|
|
return argv;
|
|
}
|
|
|
|
/*************************************************************************
|
|
* Control_RunDLL [SHELL32.12]
|
|
*
|
|
* Wild speculation in the following!
|
|
*
|
|
* http://premium.microsoft.com/msdn/library/techart/msdn193.htm
|
|
*/
|
|
|
|
void WINAPI Control_RunDLL( HWND32 hwnd, LPCVOID code, LPCSTR cmd, DWORD arg4 )
|
|
{
|
|
FIXME(shell, "(0x%08x, %p, %s, 0x%08lx): stub\n", hwnd, code,
|
|
debugstr_a(cmd), arg4);
|
|
}
|
|
|
|
/*************************************************************************
|
|
* Shell_GetImageList [SHELL32.71]
|
|
*
|
|
* PARAMETERS
|
|
* imglist[1|2] [OUT] pointer which recive imagelist handles
|
|
*
|
|
* NOTES
|
|
* undocumented
|
|
* I don't know, which pointer is which. They may have to be
|
|
* exchanged. (jsch)
|
|
*/
|
|
BOOL32 WINAPI Shell_GetImageList(HIMAGELIST * imglist1,HIMAGELIST * imglist2)
|
|
{ WARN(shell,"(%p,%p):semi-stub.\n",imglist1,imglist2);
|
|
if (imglist1)
|
|
{ *imglist1=ShellSmallIconList;
|
|
}
|
|
if (imglist2)
|
|
{ *imglist2=ShellBigIconList;
|
|
}
|
|
|
|
return TRUE;
|
|
}
|
|
|
|
/*************************************************************************
|
|
* SHGetFileInfoA [SHELL32.218]
|
|
*
|
|
* FIXME
|
|
*
|
|
*/
|
|
HIMAGELIST ShellSmallIconList = 0;
|
|
HIMAGELIST ShellBigIconList = 0;
|
|
|
|
DWORD WINAPI SHGetFileInfo32A(LPCSTR path,DWORD dwFileAttributes,
|
|
SHFILEINFO32A *psfi, UINT32 sizeofpsfi,
|
|
UINT32 flags )
|
|
{ CHAR szTemp[MAX_PATH];
|
|
LPPIDLDATA pData;
|
|
DWORD ret=0;
|
|
|
|
TRACE(shell,"(%s,0x%lx,%p,0x%x,0x%x)\n",
|
|
path,dwFileAttributes,psfi,sizeofpsfi,flags);
|
|
|
|
/* translate the pidl to a path*/
|
|
if (flags & SHGFI_PIDL)
|
|
{ SHGetPathFromIDList32A ((LPCITEMIDLIST)path,szTemp);
|
|
TRACE(shell,"pidl=%p is %s\n",path,szTemp);
|
|
}
|
|
else
|
|
{ TRACE(shell,"path=%p\n",path);
|
|
}
|
|
|
|
if (flags & SHGFI_ATTRIBUTES)
|
|
{ if (flags & SHGFI_PIDL)
|
|
{ pData = _ILGetDataPointer((LPCITEMIDLIST)path);
|
|
psfi->dwAttributes = pData->u.generic.dwSFGAO; /* fixme: no direct access*/
|
|
ret=TRUE;
|
|
}
|
|
else
|
|
{ psfi->dwAttributes=SFGAO_FILESYSTEM;
|
|
ret=TRUE;
|
|
}
|
|
FIXME(shell,"file attributes, stub\n");
|
|
}
|
|
|
|
if (flags & SHGFI_DISPLAYNAME)
|
|
{ if (flags & SHGFI_PIDL)
|
|
{ strcpy(psfi->szDisplayName,szTemp);
|
|
}
|
|
else
|
|
{ strcpy(psfi->szDisplayName,path);
|
|
}
|
|
TRACE(shell,"displayname=%s\n", psfi->szDisplayName);
|
|
ret=TRUE;
|
|
}
|
|
|
|
if (flags & SHGFI_TYPENAME)
|
|
{ FIXME(shell,"get the file type, stub\n");
|
|
strcpy(psfi->szTypeName,"FIXME: Type");
|
|
ret=TRUE;
|
|
}
|
|
|
|
if (flags & SHGFI_ICONLOCATION)
|
|
{ FIXME(shell,"location of icon, stub\n");
|
|
strcpy(psfi->szDisplayName,"");
|
|
ret=TRUE;
|
|
}
|
|
|
|
if (flags & SHGFI_EXETYPE)
|
|
FIXME(shell,"type of executable, stub\n");
|
|
|
|
if (flags & SHGFI_LINKOVERLAY)
|
|
FIXME(shell,"set icon to link, stub\n");
|
|
|
|
if (flags & SHGFI_OPENICON)
|
|
FIXME(shell,"set to open icon, stub\n");
|
|
|
|
if (flags & SHGFI_SELECTED)
|
|
FIXME(shell,"set icon to selected, stub\n");
|
|
|
|
if (flags & SHGFI_SHELLICONSIZE)
|
|
FIXME(shell,"set icon to shell size, stub\n");
|
|
|
|
if (flags & SHGFI_USEFILEATTRIBUTES)
|
|
FIXME(shell,"use the dwFileAttributes, stub\n");
|
|
|
|
if (flags & SHGFI_ICON)
|
|
{ FIXME(shell,"icon handle\n");
|
|
if (flags & SHGFI_SMALLICON)
|
|
{ TRACE(shell,"set to small icon\n");
|
|
psfi->hIcon=pImageList_GetIcon(ShellSmallIconList,32,ILD_NORMAL);
|
|
ret = (DWORD) ShellSmallIconList;
|
|
}
|
|
else
|
|
{ TRACE(shell,"set to big icon\n");
|
|
psfi->hIcon=pImageList_GetIcon(ShellBigIconList,32,ILD_NORMAL);
|
|
ret = (DWORD) ShellBigIconList;
|
|
}
|
|
}
|
|
|
|
if (flags & SHGFI_SYSICONINDEX)
|
|
{ FIXME(shell,"get the SYSICONINDEX\n");
|
|
psfi->iIcon=32;
|
|
if (flags & SHGFI_SMALLICON)
|
|
{ TRACE(shell,"set to small icon\n");
|
|
ret = (DWORD) ShellSmallIconList;
|
|
}
|
|
else
|
|
{ TRACE(shell,"set to big icon\n");
|
|
ret = (DWORD) ShellBigIconList;
|
|
}
|
|
}
|
|
|
|
|
|
return ret;
|
|
}
|
|
|
|
/*************************************************************************
|
|
* ExtractIcon32A (SHELL32.133)
|
|
*/
|
|
HICON32 WINAPI ExtractIcon32A( HINSTANCE32 hInstance, LPCSTR lpszExeFileName,
|
|
UINT32 nIconIndex )
|
|
{ HGLOBAL16 handle = InternalExtractIcon(hInstance,lpszExeFileName,nIconIndex, 1);
|
|
TRACE(shell,"\n");
|
|
if( handle )
|
|
{
|
|
HICON16* ptr = (HICON16*)GlobalLock16(handle);
|
|
HICON16 hIcon = *ptr;
|
|
|
|
GlobalFree16(handle);
|
|
return hIcon;
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
/*************************************************************************
|
|
* ExtractIcon32W (SHELL32.180)
|
|
*/
|
|
HICON32 WINAPI ExtractIcon32W( HINSTANCE32 hInstance, LPCWSTR lpszExeFileName,
|
|
UINT32 nIconIndex )
|
|
{ LPSTR exefn;
|
|
HICON32 ret;
|
|
TRACE(shell,"\n");
|
|
|
|
exefn = HEAP_strdupWtoA(GetProcessHeap(),0,lpszExeFileName);
|
|
ret = ExtractIcon32A(hInstance,exefn,nIconIndex);
|
|
|
|
HeapFree(GetProcessHeap(),0,exefn);
|
|
return ret;
|
|
}
|
|
|
|
/*************************************************************************
|
|
* FindExecutable32A (SHELL32.184)
|
|
*/
|
|
HINSTANCE32 WINAPI FindExecutable32A( LPCSTR lpFile, LPCSTR lpDirectory,
|
|
LPSTR lpResult )
|
|
{ HINSTANCE32 retval=31; /* default - 'No association was found' */
|
|
char old_dir[1024];
|
|
|
|
TRACE(shell, "File %s, Dir %s\n",
|
|
(lpFile != NULL?lpFile:"-"),
|
|
(lpDirectory != NULL?lpDirectory:"-"));
|
|
|
|
lpResult[0]='\0'; /* Start off with an empty return string */
|
|
|
|
/* trap NULL parameters on entry */
|
|
if (( lpFile == NULL ) || ( lpResult == NULL ))
|
|
{ /* FIXME - should throw a warning, perhaps! */
|
|
return 2; /* File not found. Close enough, I guess. */
|
|
}
|
|
|
|
if (lpDirectory)
|
|
{ GetCurrentDirectory32A( sizeof(old_dir), old_dir );
|
|
SetCurrentDirectory32A( lpDirectory );
|
|
}
|
|
|
|
retval = SHELL_FindExecutable( lpFile, "open", lpResult );
|
|
|
|
TRACE(shell, "returning %s\n", lpResult);
|
|
if (lpDirectory)
|
|
SetCurrentDirectory32A( old_dir );
|
|
return retval;
|
|
}
|
|
|
|
typedef struct
|
|
{ LPCSTR szApp;
|
|
LPCSTR szOtherStuff;
|
|
HICON32 hIcon;
|
|
} ABOUT_INFO;
|
|
|
|
#define IDC_STATIC_TEXT 100
|
|
#define IDC_LISTBOX 99
|
|
#define IDC_WINE_TEXT 98
|
|
|
|
#define DROP_FIELD_TOP (-15)
|
|
#define DROP_FIELD_HEIGHT 15
|
|
|
|
extern HICON32 hIconTitleFont;
|
|
|
|
static BOOL32 __get_dropline( HWND32 hWnd, LPRECT32 lprect )
|
|
{ HWND32 hWndCtl = GetDlgItem32(hWnd, IDC_WINE_TEXT);
|
|
if( hWndCtl )
|
|
{ GetWindowRect32( hWndCtl, lprect );
|
|
MapWindowPoints32( 0, hWnd, (LPPOINT32)lprect, 2 );
|
|
lprect->bottom = (lprect->top += DROP_FIELD_TOP);
|
|
return TRUE;
|
|
}
|
|
return FALSE;
|
|
}
|
|
|
|
/*************************************************************************
|
|
* SHAppBarMessage32 [SHELL32.207]
|
|
*/
|
|
UINT32 WINAPI SHAppBarMessage32(DWORD msg, PAPPBARDATA data)
|
|
{ FIXME(shell,"(0x%08lx,%p): stub\n", msg, data);
|
|
#if 0
|
|
switch (msg)
|
|
{ case ABM_ACTIVATE:
|
|
case ABM_GETAUTOHIDEBAR:
|
|
case ABM_GETSTATE:
|
|
case ABM_GETTASKBARPOS:
|
|
case ABM_NEW:
|
|
case ABM_QUERYPOS:
|
|
case ABM_REMOVE:
|
|
case ABM_SETAUTOHIDEBAR:
|
|
case ABM_SETPOS:
|
|
case ABM_WINDOWPOSCHANGED:
|
|
;
|
|
}
|
|
#endif
|
|
return 0;
|
|
}
|
|
|
|
/*************************************************************************
|
|
* SHBrowseForFolderA [SHELL32.209]
|
|
*
|
|
*/
|
|
LPITEMIDLIST WINAPI SHBrowseForFolder32A (LPBROWSEINFO32A lpbi)
|
|
{ FIXME (shell, "(0x%lx,%s): stub\n", (DWORD)lpbi, debugstr_a(lpbi->lpszTitle));
|
|
return NULL;
|
|
}
|
|
|
|
/*************************************************************************
|
|
* SHGetDesktopFolder [SHELL32.216]
|
|
*
|
|
* SDK header win95/shlobj.h: This is equivalent to call CoCreateInstance with
|
|
* CLSID_ShellDesktop
|
|
* CoCreateInstance(CLSID_Desktop, NULL, CLSCTX_INPROC, IID_IShellFolder, &pshf);
|
|
*
|
|
* RETURNS
|
|
* the interface to the shell desktop folder.
|
|
*
|
|
* FIXME
|
|
* the pdesktopfolder has to be released at the end (at dll unloading???)
|
|
*/
|
|
LPSHELLFOLDER pdesktopfolder=NULL;
|
|
|
|
DWORD WINAPI SHGetDesktopFolder(LPSHELLFOLDER *shellfolder)
|
|
{ HRESULT hres = E_OUTOFMEMORY;
|
|
LPCLASSFACTORY lpclf;
|
|
TRACE(shell,"%p->(%p)\n",shellfolder,*shellfolder);
|
|
|
|
if (pdesktopfolder)
|
|
{ hres = NOERROR;
|
|
}
|
|
else
|
|
{ lpclf = IClassFactory_Constructor();
|
|
/* fixme: the buildin IClassFactory_Constructor is at the moment only
|
|
for rclsid=CLSID_ShellDesktop, so we get the right Interface (jsch)*/
|
|
if(lpclf)
|
|
{ hres = lpclf->lpvtbl->fnCreateInstance(lpclf,NULL,(REFIID)&IID_IShellFolder, (void*)&pdesktopfolder);
|
|
lpclf->lpvtbl->fnRelease(lpclf);
|
|
}
|
|
}
|
|
|
|
if (pdesktopfolder)
|
|
{ *shellfolder = pdesktopfolder;
|
|
pdesktopfolder->lpvtbl->fnAddRef(pdesktopfolder);
|
|
}
|
|
else
|
|
{ *shellfolder=NULL;
|
|
}
|
|
|
|
TRACE(shell,"-- %p->(%p)\n",shellfolder, *shellfolder);
|
|
return hres;
|
|
}
|
|
/*************************************************************************
|
|
* SHGetPathFromIDList [SHELL32.221][NT 4.0: SHELL32.219]
|
|
*/
|
|
BOOL32 WINAPI SHGetPathFromIDList32(LPCITEMIDLIST pidl,LPSTR pszPath)
|
|
{ TRACE(shell,"(pidl=%p,%p)\n",pidl,pszPath);
|
|
return SHGetPathFromIDList32A(pidl,pszPath);
|
|
}
|
|
|
|
/*************************************************************************
|
|
* SHGetSpecialFolderLocation [SHELL32.223]
|
|
* gets the folder locations from the registry and creates a pidl
|
|
* creates missing reg keys and directorys
|
|
*
|
|
* PARAMS
|
|
* hwndOwner [I]
|
|
* nFolder [I] CSIDL_xxxxx
|
|
* ppidl [O] PIDL of a special folder
|
|
*
|
|
* RETURNS
|
|
* HResult
|
|
*
|
|
* FIXME
|
|
* - look for "User Shell Folder" first
|
|
*
|
|
*/
|
|
HRESULT WINAPI SHGetSpecialFolderLocation(HWND32 hwndOwner, INT32 nFolder, LPITEMIDLIST * ppidl)
|
|
{ LPSHELLFOLDER shellfolder;
|
|
DWORD pchEaten,tpathlen=MAX_PATH,type,dwdisp,res;
|
|
CHAR pszTemp[256],buffer[256],tpath[MAX_PATH],npath[MAX_PATH];
|
|
LPWSTR lpszDisplayName = (LPWSTR)&pszTemp[0];
|
|
HKEY key;
|
|
|
|
enum
|
|
{ FT_UNKNOWN= 0x00000000,
|
|
FT_DIR= 0x00000001,
|
|
FT_DESKTOP= 0x00000002
|
|
} tFolder;
|
|
|
|
TRACE(shell,"(%04x,%d,%p)\n", hwndOwner,nFolder,ppidl);
|
|
|
|
strcpy(buffer,"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders\\");
|
|
|
|
res=RegCreateKeyEx32A(HKEY_CURRENT_USER,buffer,0,NULL,REG_OPTION_NON_VOLATILE,KEY_WRITE,NULL,&key,&dwdisp);
|
|
if (res)
|
|
{ ERR(shell,"Could not create key %s %08lx \n",buffer,res);
|
|
return E_OUTOFMEMORY;
|
|
}
|
|
|
|
tFolder=FT_DIR;
|
|
switch (nFolder)
|
|
{ case CSIDL_BITBUCKET:
|
|
strcpy (buffer,"xxx"); /*not in the registry*/
|
|
TRACE (shell,"looking for Recycler\n");
|
|
tFolder=FT_UNKNOWN;
|
|
break;
|
|
case CSIDL_CONTROLS:
|
|
strcpy (buffer,"xxx"); /*virtual folder*/
|
|
TRACE (shell,"looking for Control\n");
|
|
tFolder=FT_UNKNOWN;
|
|
break;
|
|
case CSIDL_DESKTOP:
|
|
strcpy (buffer,"xxx"); /*virtual folder*/
|
|
TRACE (shell,"looking for Desktop\n");
|
|
tFolder=FT_DESKTOP;
|
|
break;
|
|
case CSIDL_DESKTOPDIRECTORY:
|
|
strcpy (buffer,"Desktop");
|
|
break;
|
|
case CSIDL_DRIVES:
|
|
strcpy (buffer,"xxx"); /*virtual folder*/
|
|
TRACE (shell,"looking for Drives\n");
|
|
tFolder=FT_UNKNOWN;
|
|
break;
|
|
case CSIDL_FONTS:
|
|
strcpy (buffer,"Fonts");
|
|
break;
|
|
case CSIDL_NETHOOD:
|
|
strcpy (buffer,"NetHood");
|
|
break;
|
|
case CSIDL_NETWORK:
|
|
strcpy (buffer,"xxx"); /*virtual folder*/
|
|
TRACE (shell,"looking for Network\n");
|
|
tFolder=FT_UNKNOWN;
|
|
break;
|
|
case CSIDL_PERSONAL:
|
|
strcpy (buffer,"Personal");
|
|
break;
|
|
case CSIDL_FAVORITES:
|
|
strcpy (buffer,"Favorites");
|
|
break;
|
|
case CSIDL_PRINTERS:
|
|
strcpy (buffer,"PrintHood");
|
|
break;
|
|
case CSIDL_PROGRAMS:
|
|
strcpy (buffer,"Programs");
|
|
break;
|
|
case CSIDL_RECENT:
|
|
strcpy (buffer,"Recent");
|
|
break;
|
|
case CSIDL_SENDTO:
|
|
strcpy (buffer,"SendTo");
|
|
break;
|
|
case CSIDL_STARTMENU:
|
|
strcpy (buffer,"Start Menu");
|
|
break;
|
|
case CSIDL_STARTUP:
|
|
strcpy (buffer,"Startup");
|
|
break;
|
|
case CSIDL_TEMPLATES:
|
|
strcpy (buffer,"Templates");
|
|
break;
|
|
default:
|
|
ERR (shell,"unknown CSIDL\n");
|
|
tFolder=FT_UNKNOWN;
|
|
break;
|
|
}
|
|
|
|
TRACE(shell,"Key=%s\n",buffer);
|
|
|
|
type=REG_SZ;
|
|
|
|
switch (tFolder)
|
|
{ case FT_DIR:
|
|
/* Directory: get the value from the registry, if its not there
|
|
create it and the directory*/
|
|
if (RegQueryValueEx32A(key,buffer,NULL,&type,tpath,&tpathlen))
|
|
{ GetWindowsDirectory32A(npath,MAX_PATH);
|
|
PathAddBackslash(npath);
|
|
switch (nFolder)
|
|
{ case CSIDL_DESKTOPDIRECTORY:
|
|
strcat (npath,"Desktop");
|
|
break;
|
|
case CSIDL_FONTS:
|
|
strcat (npath,"Fonts");
|
|
break;
|
|
case CSIDL_NETHOOD:
|
|
strcat (npath,"NetHood");
|
|
break;
|
|
case CSIDL_PERSONAL:
|
|
strcpy (npath,"C:\\Personal");
|
|
break;
|
|
case CSIDL_FAVORITES:
|
|
strcat (npath,"Favorites");
|
|
break;
|
|
case CSIDL_PRINTERS:
|
|
strcat (npath,"PrintHood");
|
|
break;
|
|
case CSIDL_PROGRAMS:
|
|
strcat (npath,"Start Menu");
|
|
CreateDirectory32A(npath,NULL);
|
|
strcat (npath,"\\Programs");
|
|
break;
|
|
case CSIDL_RECENT:
|
|
strcat (npath,"Recent");
|
|
break;
|
|
case CSIDL_SENDTO:
|
|
strcat (npath,"SendTo");
|
|
break;
|
|
case CSIDL_STARTMENU:
|
|
strcat (npath,"Start Menu");
|
|
break;
|
|
case CSIDL_STARTUP:
|
|
strcat (npath,"Start Menu");
|
|
CreateDirectory32A(npath,NULL);
|
|
strcat (npath,"\\Startup");
|
|
break;
|
|
case CSIDL_TEMPLATES:
|
|
strcat (npath,"Templates");
|
|
break;
|
|
default:
|
|
RegCloseKey(key);
|
|
return E_OUTOFMEMORY;
|
|
}
|
|
if (RegSetValueEx32A(key,buffer,0,REG_SZ,npath,sizeof(npath)+1))
|
|
{ ERR(shell,"could not create value %s\n",buffer);
|
|
RegCloseKey(key);
|
|
return E_OUTOFMEMORY;
|
|
}
|
|
TRACE(shell,"value %s=%s created\n",buffer,npath);
|
|
CreateDirectory32A(npath,NULL);
|
|
strcpy(tpath,npath);
|
|
}
|
|
break;
|
|
case FT_DESKTOP:
|
|
strcpy (tpath,"Desktop");
|
|
break;
|
|
default:
|
|
RegCloseKey(key);
|
|
return E_OUTOFMEMORY;
|
|
break;
|
|
}
|
|
|
|
RegCloseKey(key);
|
|
|
|
TRACE(shell,"Value=%s\n",tpath);
|
|
LocalToWideChar32(lpszDisplayName, tpath, 256);
|
|
|
|
if (SHGetDesktopFolder(&shellfolder)==S_OK)
|
|
{ shellfolder->lpvtbl->fnParseDisplayName(shellfolder,hwndOwner, NULL,lpszDisplayName,&pchEaten,ppidl,NULL);
|
|
shellfolder->lpvtbl->fnRelease(shellfolder);
|
|
}
|
|
|
|
TRACE(shell, "-- (new pidl %p)\n",*ppidl);
|
|
return NOERROR;
|
|
}
|
|
/*************************************************************************
|
|
* SHHelpShortcuts_RunDLL [SHELL32.224]
|
|
*
|
|
*/
|
|
DWORD WINAPI SHHelpShortcuts_RunDLL (DWORD dwArg1, DWORD dwArg2, DWORD dwArg3, DWORD dwArg4)
|
|
{ FIXME (exec, "(%lx, %lx, %lx, %lx) empty stub!\n",
|
|
dwArg1, dwArg2, dwArg3, dwArg4);
|
|
|
|
return 0;
|
|
}
|
|
|
|
/*************************************************************************
|
|
* SHLoadInProc [SHELL32.225]
|
|
*
|
|
*/
|
|
|
|
DWORD WINAPI SHLoadInProc (DWORD dwArg1)
|
|
{ FIXME (shell, "(%lx) empty stub!\n", dwArg1);
|
|
return 0;
|
|
}
|
|
|
|
/*************************************************************************
|
|
* ShellExecute32A (SHELL32.245)
|
|
*/
|
|
HINSTANCE32 WINAPI ShellExecute32A( HWND32 hWnd, LPCSTR lpOperation,
|
|
LPCSTR lpFile, LPCSTR lpParameters,
|
|
LPCSTR lpDirectory, INT32 iShowCmd )
|
|
{ TRACE(shell,"\n");
|
|
return ShellExecute16( hWnd, lpOperation, lpFile, lpParameters,
|
|
lpDirectory, iShowCmd );
|
|
}
|
|
|
|
|
|
/*************************************************************************
|
|
* AboutDlgProc32 (not an exported API function)
|
|
*/
|
|
LRESULT WINAPI AboutDlgProc32( HWND32 hWnd, UINT32 msg, WPARAM32 wParam,
|
|
LPARAM lParam )
|
|
{ HWND32 hWndCtl;
|
|
char Template[512], AppTitle[512];
|
|
|
|
TRACE(shell,"\n");
|
|
|
|
switch(msg)
|
|
{ case WM_INITDIALOG:
|
|
{ ABOUT_INFO *info = (ABOUT_INFO *)lParam;
|
|
if (info)
|
|
{ const char* const *pstr = SHELL_People;
|
|
SendDlgItemMessage32A(hWnd, stc1, STM_SETICON32,info->hIcon, 0);
|
|
GetWindowText32A( hWnd, Template, sizeof(Template) );
|
|
sprintf( AppTitle, Template, info->szApp );
|
|
SetWindowText32A( hWnd, AppTitle );
|
|
SetWindowText32A( GetDlgItem32(hWnd, IDC_STATIC_TEXT),
|
|
info->szOtherStuff );
|
|
hWndCtl = GetDlgItem32(hWnd, IDC_LISTBOX);
|
|
SendMessage32A( hWndCtl, WM_SETREDRAW, 0, 0 );
|
|
SendMessage32A( hWndCtl, WM_SETFONT, hIconTitleFont, 0 );
|
|
while (*pstr)
|
|
{ SendMessage32A( hWndCtl, LB_ADDSTRING32, (WPARAM32)-1, (LPARAM)*pstr );
|
|
pstr++;
|
|
}
|
|
SendMessage32A( hWndCtl, WM_SETREDRAW, 1, 0 );
|
|
}
|
|
}
|
|
return 1;
|
|
|
|
case WM_PAINT:
|
|
{ RECT32 rect;
|
|
PAINTSTRUCT32 ps;
|
|
HDC32 hDC = BeginPaint32( hWnd, &ps );
|
|
|
|
if( __get_dropline( hWnd, &rect ) )
|
|
GRAPH_DrawLines( hDC, (LPPOINT32)&rect, 1, GetStockObject32( BLACK_PEN ) );
|
|
EndPaint32( hWnd, &ps );
|
|
}
|
|
break;
|
|
|
|
case WM_LBTRACKPOINT:
|
|
hWndCtl = GetDlgItem32(hWnd, IDC_LISTBOX);
|
|
if( (INT16)GetKeyState16( VK_CONTROL ) < 0 )
|
|
{ if( DragDetect32( hWndCtl, *((LPPOINT32)&lParam) ) )
|
|
{ INT32 idx = SendMessage32A( hWndCtl, LB_GETCURSEL32, 0, 0 );
|
|
if( idx != -1 )
|
|
{ INT32 length = SendMessage32A( hWndCtl, LB_GETTEXTLEN32, (WPARAM32)idx, 0 );
|
|
HGLOBAL16 hMemObj = GlobalAlloc16( GMEM_MOVEABLE, length + 1 );
|
|
char* pstr = (char*)GlobalLock16( hMemObj );
|
|
|
|
if( pstr )
|
|
{ HCURSOR16 hCursor = LoadCursor16( 0, MAKEINTRESOURCE16(OCR_DRAGOBJECT) );
|
|
SendMessage32A( hWndCtl, LB_GETTEXT32, (WPARAM32)idx, (LPARAM)pstr );
|
|
SendMessage32A( hWndCtl, LB_DELETESTRING32, (WPARAM32)idx, 0 );
|
|
UpdateWindow32( hWndCtl );
|
|
if( !DragObject16((HWND16)hWnd, (HWND16)hWnd, DRAGOBJ_DATA, 0, (WORD)hMemObj, hCursor) )
|
|
SendMessage32A( hWndCtl, LB_ADDSTRING32, (WPARAM32)-1, (LPARAM)pstr );
|
|
}
|
|
if( hMemObj )
|
|
GlobalFree16( hMemObj );
|
|
}
|
|
}
|
|
}
|
|
break;
|
|
|
|
case WM_QUERYDROPOBJECT:
|
|
if( wParam == 0 )
|
|
{ LPDRAGINFO lpDragInfo = (LPDRAGINFO)PTR_SEG_TO_LIN((SEGPTR)lParam);
|
|
if( lpDragInfo && lpDragInfo->wFlags == DRAGOBJ_DATA )
|
|
{ RECT32 rect;
|
|
if( __get_dropline( hWnd, &rect ) )
|
|
{ POINT32 pt = { lpDragInfo->pt.x, lpDragInfo->pt.y };
|
|
rect.bottom += DROP_FIELD_HEIGHT;
|
|
if( PtInRect32( &rect, pt ) )
|
|
{ SetWindowLong32A( hWnd, DWL_MSGRESULT, 1 );
|
|
return TRUE;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
break;
|
|
|
|
case WM_DROPOBJECT:
|
|
if( wParam == hWnd )
|
|
{ LPDRAGINFO lpDragInfo = (LPDRAGINFO)PTR_SEG_TO_LIN((SEGPTR)lParam);
|
|
if( lpDragInfo && lpDragInfo->wFlags == DRAGOBJ_DATA && lpDragInfo->hList )
|
|
{ char* pstr = (char*)GlobalLock16( (HGLOBAL16)(lpDragInfo->hList) );
|
|
if( pstr )
|
|
{ static char __appendix_str[] = " with";
|
|
|
|
hWndCtl = GetDlgItem32( hWnd, IDC_WINE_TEXT );
|
|
SendMessage32A( hWndCtl, WM_GETTEXT, 512, (LPARAM)Template );
|
|
if( !lstrncmp32A( Template, "WINE", 4 ) )
|
|
SetWindowText32A( GetDlgItem32(hWnd, IDC_STATIC_TEXT), Template );
|
|
else
|
|
{ char* pch = Template + strlen(Template) - strlen(__appendix_str);
|
|
*pch = '\0';
|
|
SendMessage32A( GetDlgItem32(hWnd, IDC_LISTBOX), LB_ADDSTRING32,
|
|
(WPARAM32)-1, (LPARAM)Template );
|
|
}
|
|
|
|
lstrcpy32A( Template, pstr );
|
|
lstrcat32A( Template, __appendix_str );
|
|
SetWindowText32A( hWndCtl, Template );
|
|
SetWindowLong32A( hWnd, DWL_MSGRESULT, 1 );
|
|
return TRUE;
|
|
}
|
|
}
|
|
}
|
|
break;
|
|
|
|
case WM_COMMAND:
|
|
if (wParam == IDOK)
|
|
{ EndDialog32(hWnd, TRUE);
|
|
return TRUE;
|
|
}
|
|
break;
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
|
|
/*************************************************************************
|
|
* ShellAbout32A (SHELL32.243)
|
|
*/
|
|
BOOL32 WINAPI ShellAbout32A( HWND32 hWnd, LPCSTR szApp, LPCSTR szOtherStuff,
|
|
HICON32 hIcon )
|
|
{ ABOUT_INFO info;
|
|
TRACE(shell,"\n");
|
|
info.szApp = szApp;
|
|
info.szOtherStuff = szOtherStuff;
|
|
info.hIcon = hIcon;
|
|
if (!hIcon) info.hIcon = LoadIcon16( 0, MAKEINTRESOURCE16(OIC_WINEICON) );
|
|
return DialogBoxIndirectParam32A( WIN_GetWindowInstance( hWnd ),
|
|
SYSRES_GetResPtr( SYSRES_DIALOG_SHELL_ABOUT_MSGBOX ),
|
|
hWnd, AboutDlgProc32, (LPARAM)&info );
|
|
}
|
|
|
|
|
|
/*************************************************************************
|
|
* ShellAbout32W (SHELL32.244)
|
|
*/
|
|
BOOL32 WINAPI ShellAbout32W( HWND32 hWnd, LPCWSTR szApp, LPCWSTR szOtherStuff,
|
|
HICON32 hIcon )
|
|
{ BOOL32 ret;
|
|
ABOUT_INFO info;
|
|
|
|
TRACE(shell,"\n");
|
|
|
|
info.szApp = HEAP_strdupWtoA( GetProcessHeap(), 0, szApp );
|
|
info.szOtherStuff = HEAP_strdupWtoA( GetProcessHeap(), 0, szOtherStuff );
|
|
info.hIcon = hIcon;
|
|
if (!hIcon) info.hIcon = LoadIcon16( 0, MAKEINTRESOURCE16(OIC_WINEICON) );
|
|
ret = DialogBoxIndirectParam32A( WIN_GetWindowInstance( hWnd ),
|
|
SYSRES_GetResPtr( SYSRES_DIALOG_SHELL_ABOUT_MSGBOX ),
|
|
hWnd, AboutDlgProc32, (LPARAM)&info );
|
|
HeapFree( GetProcessHeap(), 0, (LPSTR)info.szApp );
|
|
HeapFree( GetProcessHeap(), 0, (LPSTR)info.szOtherStuff );
|
|
return ret;
|
|
}
|
|
|
|
/*************************************************************************
|
|
* Shell_NotifyIcon [SHELL32.296]
|
|
* FIXME
|
|
* This function is supposed to deal with the systray.
|
|
* Any ideas on how this is to be implimented?
|
|
*/
|
|
BOOL32 WINAPI Shell_NotifyIcon( DWORD dwMessage, PNOTIFYICONDATA pnid )
|
|
{ TRACE(shell,"\n");
|
|
return FALSE;
|
|
}
|
|
|
|
/*************************************************************************
|
|
* Shell_NotifyIcon [SHELL32.297]
|
|
* FIXME
|
|
* This function is supposed to deal with the systray.
|
|
* Any ideas on how this is to be implimented?
|
|
*/
|
|
BOOL32 WINAPI Shell_NotifyIconA(DWORD dwMessage, PNOTIFYICONDATA pnid )
|
|
{ TRACE(shell,"\n");
|
|
return FALSE;
|
|
}
|
|
|
|
/*************************************************************************
|
|
* FreeIconList
|
|
*/
|
|
void WINAPI FreeIconList( DWORD dw )
|
|
{ FIXME(shell, "(%lx): stub\n",dw);
|
|
}
|
|
|
|
/*************************************************************************
|
|
* SHGetPathFromIDList32A [SHELL32.261][NT 4.0: SHELL32.220]
|
|
*
|
|
* PARAMETERS
|
|
* pidl, [IN] pidl
|
|
* pszPath [OUT] path
|
|
*
|
|
* RETURNS
|
|
* path from a passed PIDL.
|
|
*
|
|
* NOTES
|
|
* exported by name
|
|
*
|
|
* FIXME
|
|
* fnGetDisplayNameOf can return different types of OLEString
|
|
*/
|
|
DWORD WINAPI SHGetPathFromIDList32A (LPCITEMIDLIST pidl,LPSTR pszPath)
|
|
{ STRRET lpName;
|
|
LPSHELLFOLDER shellfolder;
|
|
CHAR buffer[MAX_PATH],tpath[MAX_PATH];
|
|
DWORD type,tpathlen=MAX_PATH,dwdisp;
|
|
HKEY key;
|
|
|
|
TRACE(shell,"(pidl=%p,%p)\n",pidl,pszPath);
|
|
|
|
if (!pidl)
|
|
{ strcpy(buffer,"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders\\");
|
|
|
|
if (RegCreateKeyEx32A(HKEY_CURRENT_USER,buffer,0,NULL,REG_OPTION_NON_VOLATILE,KEY_WRITE,NULL,&key,&dwdisp))
|
|
{ return E_OUTOFMEMORY;
|
|
}
|
|
type=REG_SZ;
|
|
strcpy (buffer,"Desktop"); /*registry name*/
|
|
if ( RegQueryValueEx32A(key,buffer,NULL,&type,tpath,&tpathlen))
|
|
{ GetWindowsDirectory32A(tpath,MAX_PATH);
|
|
PathAddBackslash(tpath);
|
|
strcat (tpath,"Desktop"); /*folder name*/
|
|
RegSetValueEx32A(key,buffer,0,REG_SZ,tpath,tpathlen);
|
|
CreateDirectory32A(tpath,NULL);
|
|
}
|
|
RegCloseKey(key);
|
|
strcpy(pszPath,tpath);
|
|
}
|
|
else
|
|
{ if (SHGetDesktopFolder(&shellfolder)==S_OK)
|
|
{ shellfolder->lpvtbl->fnGetDisplayNameOf(shellfolder,pidl,SHGDN_FORPARSING,&lpName);
|
|
shellfolder->lpvtbl->fnRelease(shellfolder);
|
|
}
|
|
/*WideCharToLocal32(pszPath, lpName.u.pOleStr, MAX_PATH);*/
|
|
strcpy(pszPath,lpName.u.cStr);
|
|
/* fixme free the olestring*/
|
|
}
|
|
TRACE(shell,"-- (%s)\n",pszPath);
|
|
return NOERROR;
|
|
}
|
|
/*************************************************************************
|
|
* SHGetPathFromIDList32W [SHELL32.262]
|
|
*/
|
|
DWORD WINAPI SHGetPathFromIDList32W (LPCITEMIDLIST pidl,LPWSTR pszPath)
|
|
{ FIXME (shell,"(pidl=%p %s):stub.\n", pidl, debugstr_w(pszPath));
|
|
return 0;
|
|
}
|
|
|
|
|
|
void (CALLBACK* pDLLInitComctl)();
|
|
INT32 (CALLBACK* pImageList_AddIcon) (HIMAGELIST himl, HICON32 hIcon);
|
|
INT32(CALLBACK* pImageList_ReplaceIcon) (HIMAGELIST, INT32, HICON32);
|
|
HIMAGELIST (CALLBACK * pImageList_Create) (INT32,INT32,UINT32,INT32,INT32);
|
|
HICON32 (CALLBACK * pImageList_GetIcon) (HIMAGELIST, INT32, UINT32);
|
|
|
|
/*************************************************************************
|
|
* SHELL32 LibMain
|
|
*
|
|
* FIXME
|
|
* at the moment the icons are extracted from shell32.dll
|
|
* free the imagelists
|
|
*/
|
|
HINSTANCE32 shell32_hInstance;
|
|
|
|
BOOL32 WINAPI Shell32LibMain(HINSTANCE32 hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
|
|
{ HICON32 htmpIcon;
|
|
UINT32 iiconindex;
|
|
UINT32 index;
|
|
CHAR szShellPath[MAX_PATH];
|
|
HINSTANCE32 hComctl32;
|
|
|
|
|
|
TRACE(shell,"0x%x 0x%lx %p\n", hinstDLL, fdwReason, lpvReserved);
|
|
|
|
shell32_hInstance = hinstDLL;
|
|
|
|
GetWindowsDirectory32A(szShellPath,MAX_PATH);
|
|
PathAddBackslash(szShellPath);
|
|
strcat(szShellPath,"system\\shell32.dll");
|
|
|
|
if (fdwReason==DLL_PROCESS_ATTACH)
|
|
{ hComctl32 = LoadLibrary32A("COMCTL32.DLL");
|
|
if (hComctl32)
|
|
{ pDLLInitComctl=GetProcAddress32(hComctl32,"InitCommonControlsEx");
|
|
if (pDLLInitComctl)
|
|
{ pDLLInitComctl();
|
|
}
|
|
pImageList_Create=GetProcAddress32(hComctl32,"ImageList_Create");
|
|
pImageList_AddIcon=GetProcAddress32(hComctl32,"ImageList_AddIcon");
|
|
pImageList_ReplaceIcon=GetProcAddress32(hComctl32,"ImageList_ReplaceIcon");
|
|
pImageList_GetIcon=GetProcAddress32(hComctl32,"ImageList_GetIcon");
|
|
FreeLibrary32(hComctl32);
|
|
}
|
|
else
|
|
{ /* panic, imediately exit wine*/
|
|
ERR(shell,"P A N I C error getting functionpointers\n");
|
|
exit (1);
|
|
}
|
|
if ( ! ShellSmallIconList )
|
|
{ if ( (ShellSmallIconList = pImageList_Create(sysMetrics[SM_CXSMICON],sysMetrics[SM_CYSMICON],ILC_COLORDDB | ILC_MASK,0,0x20)) )
|
|
{ for (index=0;index < 40; index++)
|
|
{ if ( ! ( htmpIcon = ExtractIcon32A(hinstDLL, szShellPath, index))
|
|
|| ( -1 == (iiconindex = pImageList_AddIcon (ShellSmallIconList, htmpIcon))) )
|
|
{ ERR(shell,"could not initialize iconlist (is shell32.dll in the system directory?)\n");
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if ( ! ShellBigIconList )
|
|
{ if ( (ShellBigIconList = pImageList_Create(SYSMETRICS_CXSMICON, SYSMETRICS_CYSMICON,ILC_COLORDDB | ILC_MASK,0,0x20)) )
|
|
{ for (index=0;index < 40; index++)
|
|
{ if ( ! (htmpIcon = ExtractIcon32A( hinstDLL, szShellPath, index))
|
|
|| (-1 == (iiconindex = pImageList_AddIcon (ShellBigIconList, htmpIcon))) )
|
|
{ ERR(shell,"could not initialize iconlist (is shell32.dll in the system directory?)\n");
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
TRACE(shell,"hIconSmall=%p hIconBig=%p\n",ShellSmallIconList, ShellBigIconList);
|
|
}
|
|
return TRUE;
|
|
}
|