Started with shell-clipboard handling (context menu cut&paste,

drag&drop).
This commit is contained in:
Juergen Schmied 2000-02-20 18:49:16 +00:00 committed by Alexandre Julliard
parent f37028370d
commit 40bf27e4ef
2 changed files with 85 additions and 48 deletions

View File

@ -393,30 +393,47 @@ static BOOL __get_dropline( HWND hWnd, LPRECT lprect )
*/
UINT WINAPI SHAppBarMessage(DWORD msg, PAPPBARDATA data)
{
FIXME("(0x%08lx,%p hwnd=0x%08x): stub\n", msg, data, data->hWnd);
switch (msg)
{ case ABM_GETSTATE:
return ABS_ALWAYSONTOP | ABS_AUTOHIDE;
case ABM_GETTASKBARPOS:
/* fake a taskbar on the bottom of the desktop */
{ RECT rec;
GetWindowRect(GetDesktopWindow(), &rec);
rec.left = 0;
rec.top = rec.bottom - 2;
}
return TRUE;
case ABM_ACTIVATE:
case ABM_GETAUTOHIDEBAR:
case ABM_NEW:
case ABM_QUERYPOS:
case ABM_REMOVE:
case ABM_SETAUTOHIDEBAR:
case ABM_SETPOS:
case ABM_WINDOWPOSCHANGED:
return FALSE;
}
return 0;
int width=data->rc.right - data->rc.left;
int height=data->rc.bottom - data->rc.top;
RECT rec=data->rc;
switch (msg)
{ case ABM_GETSTATE:
return ABS_ALWAYSONTOP | ABS_AUTOHIDE;
case ABM_GETTASKBARPOS:
GetWindowRect(data->hWnd, &rec);
data->rc=rec;
return TRUE;
case ABM_ACTIVATE:
SetActiveWindow(data->hWnd);
return TRUE;
case ABM_GETAUTOHIDEBAR:
data->hWnd=GetActiveWindow();
return TRUE;
case ABM_NEW:
SetWindowPos(data->hWnd,HWND_TOP,rec.left,rec.top,
width,height,SWP_SHOWWINDOW);
return TRUE;
case ABM_QUERYPOS:
GetWindowRect(data->hWnd, &(data->rc));
return TRUE;
case ABM_REMOVE:
CloseHandle(data->hWnd);
return TRUE;
case ABM_SETAUTOHIDEBAR:
SetWindowPos(data->hWnd,HWND_TOP,rec.left+1000,rec.top,
width,height,SWP_SHOWWINDOW);
return TRUE;
case ABM_SETPOS:
data->uEdge=(ABE_RIGHT | ABE_LEFT);
SetWindowPos(data->hWnd,HWND_TOP,data->rc.left,data->rc.top,
width,height,SWP_SHOWWINDOW);
return TRUE;
case ABM_WINDOWPOSCHANGED:
SetWindowPos(data->hWnd,HWND_TOP,rec.left,rec.top,
width,height,SWP_SHOWWINDOW);
return TRUE;
}
return FALSE;
}
/*************************************************************************
@ -432,12 +449,22 @@ DWORD WINAPI SHHelpShortcuts_RunDLL (DWORD dwArg1, DWORD dwArg2, DWORD dwArg3, D
/*************************************************************************
* SHLoadInProc [SHELL32.225]
*
* Create an instance of specified object class from within
* the shell process and release it immediately
*/
DWORD WINAPI SHLoadInProc (DWORD dwArg1)
{ FIXME("(%lx) empty stub!\n", dwArg1);
return 0;
DWORD WINAPI SHLoadInProc (REFCLSID rclsid)
{
IUnknown * pUnk = NULL;
TRACE("%s\n", debugstr_guid(rclsid));
CoCreateInstance(rclsid, NULL, CLSCTX_INPROC_SERVER, &IID_IUnknown,(LPVOID*)pUnk);
if(pUnk)
{
IUnknown_Release(pUnk);
return NOERROR;
}
return DISP_E_MEMBERNOTFOUND;
}
/*************************************************************************
@ -727,15 +754,7 @@ LPVOID (WINAPI *pDPA_DeletePtr) (const HDPA hdpa, INT i);
HICON (WINAPI *pLookupIconIdFromDirectoryEx)(LPBYTE dir, BOOL bIcon, INT width, INT height, UINT cFlag);
HICON (WINAPI *pCreateIconFromResourceEx)(LPBYTE bits,UINT cbSize, BOOL bIcon, DWORD dwVersion, INT width, INT height,UINT cFlag);
/* ole2 */
HRESULT (WINAPI* pOleInitialize)(LPVOID reserved);
void (WINAPI* pOleUninitialize)(void);
HRESULT (WINAPI* pDoDragDrop)(IDataObject* pDataObject, IDropSource * pDropSource, DWORD dwOKEffect, DWORD *pdwEffect);
HRESULT (WINAPI* pRegisterDragDrop)(HWND hwnd, IDropTarget* pDropTarget);
HRESULT (WINAPI* pRevokeDragDrop)(HWND hwnd);
static HINSTANCE hComctl32;
static HINSTANCE hOle32;
static INT shell32_RefCount = 0;
INT shell32_ObjCount = 0;
@ -773,10 +792,9 @@ BOOL WINAPI Shell32LibMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID fImpLoad)
shell32_hInstance = hinstDLL;
hComctl32 = LoadLibraryA("COMCTL32.DLL");
hOle32 = LoadLibraryA("OLE32.DLL");
hUser32 = GetModuleHandleA("USER32");
if (!hComctl32 || !hUser32 || !hOle32)
if (!hComctl32 || !hUser32)
{
ERR("P A N I C SHELL32 loading failed\n");
return FALSE;
@ -803,12 +821,6 @@ BOOL WINAPI Shell32LibMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID fImpLoad)
/* user32 */
pLookupIconIdFromDirectoryEx=(void*)GetProcAddress(hUser32,"LookupIconIdFromDirectoryEx");
pCreateIconFromResourceEx=(void*)GetProcAddress(hUser32,"CreateIconFromResourceEx");
/* ole2 */
pOleInitialize=(void*)GetProcAddress(hOle32,"OleInitialize");
pOleUninitialize=(void*)GetProcAddress(hOle32,"OleUninitialize");
pDoDragDrop=(void*)GetProcAddress(hOle32,"DoDragDrop");
pRegisterDragDrop=(void*)GetProcAddress(hOle32,"RegisterDragDrop");
pRevokeDragDrop=(void*)GetProcAddress(hOle32,"RevokeDragDrop");
/* initialize the common controls */
if (pDLLInitComctl)
@ -851,7 +863,6 @@ BOOL WINAPI Shell32LibMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID fImpLoad)
}
}
FreeLibrary(hOle32);
FreeLibrary(hComctl32);
TRACE("refcount=%u objcount=%u \n", shell32_RefCount, shell32_ObjCount);

View File

@ -54,12 +54,13 @@ extern HICON (WINAPI *pLookupIconIdFromDirectoryEx)(LPBYTE dir, BOOL bIcon, INT
extern HICON (WINAPI *pCreateIconFromResourceEx)(LPBYTE bits,UINT cbSize, BOOL bIcon, DWORD dwVersion, INT width, INT height,UINT cFlag);
/* ole2 */
/*
extern HRESULT (WINAPI* pOleInitialize)(LPVOID reserved);
extern void (WINAPI* pOleUninitialize)(void);
extern HRESULT (WINAPI* pDoDragDrop)(IDataObject* pDataObject, IDropSource * pDropSource, DWORD dwOKEffect, DWORD * pdwEffect);
extern HRESULT (WINAPI* pRegisterDragDrop)(HWND hwnd, IDropTarget* pDropTarget);
extern HRESULT (WINAPI* pRevokeDragDrop)(HWND hwnd);
*/
BOOL WINAPI Shell_GetImageList(HIMAGELIST * lpBigList, HIMAGELIST * lpSmallList);
HRESULT WINAPI StrRetToStrNA (LPVOID dest, DWORD len, LPSTRRET src, LPITEMIDLIST pidl);
@ -93,8 +94,8 @@ LPDATAOBJECT IDataObject_Constructor(HWND hwndOwner, LPITEMIDLIST myPidl, LPITEM
LPENUMFORMATETC IEnumFORMATETC_Constructor(UINT, const FORMATETC []);
LPCLASSFACTORY IClassFactory_Constructor(REFCLSID);
IContextMenu * IContextMenu_Constructor(LPSHELLFOLDER pSFParent, LPCITEMIDLIST pidl, LPCITEMIDLIST *aPidls, UINT uItemCount);
IContextMenu * ISvBgCm_Constructor(void);
IContextMenu * ISvItemCm_Constructor(LPSHELLFOLDER pSFParent, LPCITEMIDLIST pidl, LPCITEMIDLIST *aPidls, UINT uItemCount);
IContextMenu * ISvBgCm_Constructor(LPSHELLFOLDER pSFParent);
LPSHELLVIEW IShellView_Constructor(LPSHELLFOLDER);
LPSHELLLINK IShellLink_Constructor(BOOL);
@ -141,4 +142,29 @@ HRESULT WINAPI Shell_MergeMenus (HMENU hmDst, HMENU hmSrc, UINT uInsert, UINT uI
/* Systray */
BOOL SYSTRAY_Init(void);
/* Clipboard */
void InitShellOle(void);
void FreeShellOle(void);
BOOL GetShellOle(void);
HRESULT (WINAPI* pOleInitialize)(LPVOID reserved);
void (WINAPI* pOleUninitialize)(void);
HRESULT (WINAPI* pRegisterDragDrop)(HWND hwnd, IDropTarget* pDropTarget);
HRESULT (WINAPI* pRevokeDragDrop)(HWND hwnd);
HRESULT (WINAPI* pDoDragDrop)(LPDATAOBJECT,LPDROPSOURCE,DWORD,DWORD*);
void (WINAPI* pReleaseStgMedium)(STGMEDIUM* pmedium);
HRESULT (WINAPI* pOleSetClipboard)(IDataObject* pDataObj);
HRESULT (WINAPI* pOleGetClipboard)(IDataObject** ppDataObj);
HGLOBAL RenderHDROP(LPITEMIDLIST pidlRoot, LPITEMIDLIST * apidl, UINT cidl);
HGLOBAL RenderSHELLIDLIST (LPITEMIDLIST pidlRoot, LPITEMIDLIST * apidl, UINT cidl);
HGLOBAL RenderSHELLIDLISTOFFSET (LPITEMIDLIST pidlRoot, LPITEMIDLIST * apidl, UINT cidl);
HGLOBAL RenderFILECONTENTS (LPITEMIDLIST pidlRoot, LPITEMIDLIST * apidl, UINT cidl);
HGLOBAL RenderFILEDESCRIPTOR (LPITEMIDLIST pidlRoot, LPITEMIDLIST * apidl, UINT cidl);
HGLOBAL RenderFILENAME (LPITEMIDLIST pidlRoot, LPITEMIDLIST * apidl, UINT cidl);
HGLOBAL RenderPREFEREDDROPEFFECT (DWORD dwFlags);
/* Change Notification */
void InitChangeNotifications(void);
void FreeChangeNotifications(void);
#endif