ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

precomp.h
Go to the documentation of this file.
00001 #ifndef _EXPLORER_PRECOMP__H_
00002 #define _EXPLORER_PRECOMP__H_
00003 #define COBJMACROS
00004 #include <windows.h>
00005 #include <commctrl.h>
00006 #include <oleidl.h>
00007 #include <ole2.h>
00008 #include <shlobj.h>
00009 #include <shlobj_undoc.h>
00010 #include <shlwapi.h>
00011 #include <servprov.h>
00012 #include <shlguid.h>
00013 #include <shlguid_undoc.h>
00014 #include <ocidl.h>
00015 #include <objidl.h>
00016 #include <docobj.h>
00017 #include <tchar.h>
00018 #include <stdio.h>
00019 #include <stdlib.h>
00020 
00021 #include "resource.h"
00022 #include "comcsup.h"
00023 #include "todo.h"
00024 #include "initguid.h"
00025 #include "undoc.h"
00026 
00027 /* dynamic imports due to lack of support in msvc linker libs */
00028 typedef INT (APIENTRY *REGSHELLHOOK)(HWND, DWORD);
00029 #ifdef UNICODE
00030 #define PROC_NAME_DRAWCAPTIONTEMP "DrawCaptionTempW"
00031 typedef BOOL (APIENTRY *DRAWCAPTEMP)(HWND, HDC, const RECT*, HFONT, HICON, LPCWSTR, UINT);
00032 #else
00033 #define PROC_NAME_DRAWCAPTIONTEMP "DrawCaptionTempA"
00034 typedef BOOL (APIENTRY *DRAWCAPTEMP)(HWND, HDC, const RECT*, HFONT, HICON, LPCSTR, UINT);
00035 #endif
00036 typedef HRESULT (APIENTRY *SHINVDEFCMD)(HWND, IShellFolder*, LPCITEMIDLIST);
00037 typedef void (APIENTRY *RUNFILEDLG)(HWND, HICON, LPCWSTR, LPCWSTR, LPCWSTR, UINT);
00038 typedef void (APIENTRY *EXITWINDLG)(HWND);
00039 typedef HRESULT (APIENTRY *SHWINHELP)(HWND, LPWSTR, UINT, DWORD);
00040 
00041 /* Constants for RunFileDlg */
00042 #define RFF_CALCDIRECTORY   0x04    /* Calculates the working directory from the file name. */
00043 
00044 static __inline ULONG
00045 Win32DbgPrint(const char *filename, int line, const char *lpFormat, ...)
00046 {
00047     char szMsg[512];
00048     char *szMsgStart;
00049     const char *fname;
00050     va_list vl;
00051     ULONG uRet;
00052 
00053     fname = strrchr(filename, '\\');
00054     if (fname == NULL)
00055     {
00056         fname = strrchr(filename, '/');
00057         if (fname != NULL)
00058             fname++;
00059     }
00060     else
00061         fname++;
00062 
00063     if (fname == NULL)
00064         fname = filename;
00065 
00066     szMsgStart = szMsg + sprintf(szMsg, "%s:%d: ", fname, line);
00067 
00068     va_start(vl, lpFormat);
00069     uRet = (ULONG)vsprintf(szMsgStart, lpFormat, vl);
00070     va_end(vl);
00071 
00072     OutputDebugStringA(szMsg);
00073 
00074     return uRet;
00075 }
00076 
00077 #define ASSERT(cond) \
00078     if (!(cond)) { \
00079         Win32DbgPrint(__FILE__, __LINE__, "ASSERTION %s FAILED!\n", #cond); \
00080     }
00081 
00082 #define DbgPrint(fmt, ...) \
00083     Win32DbgPrint(__FILE__, __LINE__, fmt, ##__VA_ARGS__);
00084 
00085 extern HINSTANCE hExplorerInstance;
00086 extern HMODULE hUser32;
00087 extern HANDLE hProcessHeap;
00088 extern HKEY hkExplorer;
00089 extern DRAWCAPTEMP DrawCapTemp;
00090 
00091 /*
00092  * dragdrop.c
00093  */
00094 
00095 typedef struct _DROPTARGET_CALLBACKS
00096 {
00097     HRESULT (*OnDragEnter)(IN IDropTarget *pDropTarget,
00098                            IN PVOID Context,
00099                            IN const FORMATETC *Format,
00100                            IN DWORD grfKeyState,
00101                            IN POINTL pt,
00102                            IN OUT DWORD *pdwEffect);
00103     HRESULT (*OnDragOver)(IN IDropTarget *pDropTarget,
00104                           IN PVOID Context,
00105                           IN DWORD grfKeyState,
00106                           IN POINTL pt,
00107                           IN OUT DWORD *pdwEffect);
00108     HRESULT (*OnDragLeave)(IN IDropTarget *pDropTarget,
00109                            IN PVOID Context);
00110     HRESULT (*OnDrop)(IN IDropTarget *pDropTarget,
00111                       IN PVOID Context,
00112                       IN const FORMATETC *Format,
00113                       IN DWORD grfKeyState,
00114                       IN POINTL pt,
00115                       IN OUT DWORD *pdwEffect);
00116 } DROPTARGET_CALLBACKS, *PDROPTARGET_CALLBACKS;
00117 
00118 IDropTarget *
00119 CreateDropTarget(IN HWND hwndTarget,
00120                  IN DWORD nSupportedFormats,
00121                  IN const FORMATETC *Formats  OPTIONAL,
00122                  IN PVOID Context  OPTIONAL,
00123                  IN const DROPTARGET_CALLBACKS *Callbacks  OPTIONAL);
00124 
00125 /*
00126  * explorer.c
00127  */
00128 
00129 LONG
00130 SetWindowStyle(IN HWND hWnd,
00131                IN LONG dwStyleMask,
00132                IN LONG dwStyle);
00133 
00134 LONG
00135 SetWindowExStyle(IN HWND hWnd,
00136                  IN LONG dwStyleMask,
00137                  IN LONG dwStyle);
00138 
00139 HMENU
00140 LoadPopupMenu(IN HINSTANCE hInstance,
00141               IN LPCTSTR lpMenuName);
00142 
00143 HMENU
00144 FindSubMenu(IN HMENU hMenu,
00145             IN UINT uItem,
00146             IN BOOL fByPosition);
00147 
00148 BOOL
00149 GetCurrentLoggedOnUserName(OUT LPTSTR szBuffer,
00150                            IN DWORD dwBufferSize);
00151 
00152 BOOL
00153 FormatMenuString(IN HMENU hMenu,
00154                  IN UINT uPosition,
00155                  IN UINT uFlags,
00156                  ...);
00157 
00158 BOOL
00159 GetExplorerRegValueSet(IN HKEY hKey,
00160                        IN LPCTSTR lpSubKey,
00161                        IN LPCTSTR lpValue);
00162 
00163 /*
00164  * traywnd.c
00165  */
00166 
00167 typedef HMENU (*PCREATECTXMENU)(IN HWND hWndOwner,
00168                                 IN PVOID *ppcmContext,
00169                                 IN PVOID Context  OPTIONAL);
00170 typedef VOID (*PCTXMENUCOMMAND)(IN HWND hWndOwner,
00171                                 IN UINT uiCmdId,
00172                                 IN PVOID pcmContext  OPTIONAL,
00173                                 IN PVOID Context  OPTIONAL);
00174 
00175 typedef struct _TRAYWINDOW_CTXMENU
00176 {
00177     PCREATECTXMENU CreateCtxMenu;
00178     PCTXMENUCOMMAND CtxMenuCommand;
00179 } TRAYWINDOW_CTXMENU, *PTRAYWINDOW_CTXMENU;
00180 
00181 extern const GUID IID_IShellDesktopTray;
00182 
00183 #define INTERFACE ITrayWindow
00184 DECLARE_INTERFACE_(ITrayWindow,IUnknown)
00185 {
00186     /*** IUnknown methods ***/
00187     STDMETHOD_(HRESULT,QueryInterface) (THIS_ REFIID riid, void** ppvObject) PURE;
00188     STDMETHOD_(ULONG,AddRef) (THIS) PURE;
00189     STDMETHOD_(ULONG,Release) (THIS) PURE;
00190     /*** ITrayWindow methods ***/
00191     STDMETHOD_(HRESULT,Open) (THIS) PURE;
00192     STDMETHOD_(HRESULT,Close) (THIS) PURE;
00193     STDMETHOD_(HWND,GetHWND) (THIS) PURE;
00194     STDMETHOD_(BOOL,IsSpecialHWND) (THIS_ HWND hWnd) PURE;
00195     STDMETHOD_(BOOL,IsHorizontal) (THIS) PURE;
00196     STDMETHOD_(HFONT,GetCaptionFonts) (THIS_ HFONT *phBoldCaption) PURE;
00197     STDMETHOD_(HWND,DisplayProperties) (THIS) PURE;
00198     STDMETHOD_(BOOL,ExecContextMenuCmd) (THIS_ UINT uiCmd) PURE;
00199     STDMETHOD_(BOOL,Lock) (THIS_ BOOL bLock) PURE;
00200 };
00201 #undef INTERFACE
00202 
00203 #if defined(COBJMACROS)
00204 /*** IUnknown methods ***/
00205 #define ITrayWindow_QueryInterface(p,a,b)   (p)->lpVtbl->QueryInterface(p,a,b)
00206 #define ITrayWindow_AddRef(p)               (p)->lpVtbl->AddRef(p)
00207 #define ITrayWindow_Release(p)              (p)->lpVtbl->Release(p)
00208 /*** ITrayWindow methods ***/
00209 #define ITrayWindow_Open(p)                 (p)->lpVtbl->Open(p)
00210 #define ITrayWindow_Close(p)                (p)->lpVtbl->Close(p)
00211 #define ITrayWindow_GetHWND(p)              (p)->lpVtbl->GetHWND(p)
00212 #define ITrayWindow_IsSpecialHWND(p,a)      (p)->lpVtbl->IsSpecialHWND(p,a)
00213 #define ITrayWindow_IsHorizontal(p)         (p)->lpVtbl->IsHorizontal(p)
00214 #define ITrayWindow_GetCaptionFonts(p,a)    (p)->lpVtbl->GetCaptionFonts(p,a)
00215 #define ITrayWindow_DisplayProperties(p)    (p)->lpVtbl->DisplayProperties(p)
00216 #define ITrayWindow_ExecContextMenuCmd(p,a) (p)->lpVtbl->ExecContextMenuCmd(p,a)
00217 #define ITrayWindow_Lock(p,a)               (p)->lpVtbl->Lock(p,a)
00218 #endif
00219 
00220 BOOL
00221 RegisterTrayWindowClass(VOID);
00222 
00223 VOID
00224 UnregisterTrayWindowClass(VOID);
00225 
00226 ITrayWindow *
00227 CreateTrayWindow(VOID);
00228 
00229 VOID
00230 TrayProcessMessages(IN OUT ITrayWindow *Tray);
00231 
00232 VOID
00233 TrayMessageLoop(IN OUT ITrayWindow *Tray);
00234 
00235 /*
00236  * trayprop.h
00237  */
00238 
00239 HWND
00240 DisplayTrayProperties(ITrayWindow *Tray);
00241 
00242 /*
00243  * desktop.c
00244  */
00245 HANDLE
00246 DesktopCreateWindow(IN OUT ITrayWindow *Tray);
00247 
00248 VOID
00249 DesktopDestroyShellWindow(IN HANDLE hDesktop);
00250 
00251 /*
00252  * taskband.c
00253  */
00254 
00255 /* Internal Task Band CLSID */
00256 extern const GUID CLSID_ITaskBand;
00257 
00258 #define INTERFACE ITaskBand
00259 DECLARE_INTERFACE_(ITaskBand,IUnknown)
00260 {
00261     /*** IUnknown methods ***/
00262     STDMETHOD_(HRESULT,QueryInterface) (THIS_ REFIID riid, void** ppvObject) PURE;
00263     STDMETHOD_(ULONG,AddRef) (THIS) PURE;
00264     STDMETHOD_(ULONG,Release) (THIS) PURE;
00265     /*** ITaskBand methods ***/
00266     STDMETHOD_(HRESULT,GetRebarBandID)(THIS_ DWORD *pdwBandID) PURE;
00267 };
00268 #undef INTERFACE
00269 
00270 #if defined(COBJMACROS)
00271 /*** IUnknown methods ***/
00272 #define ITaskBand_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
00273 #define ITaskBand_AddRef(p)             (p)->lpVtbl->AddRef(p)
00274 #define ITaskBand_Release(p)            (p)->lpVtbl->Release(p)
00275 /*** ITaskBand methods ***/
00276 #define ITaskBand_GetRebarBandID(p,a)   (p)->lpVtbl->GetRebarBandID(p,a)
00277 #endif
00278 
00279 ITaskBand *
00280 CreateTaskBand(IN OUT ITrayWindow *Tray);
00281 
00282 /*
00283  * tbsite.c
00284  */
00285 
00286 #define INTERFACE ITrayBandSite
00287 DECLARE_INTERFACE_(ITrayBandSite,IUnknown)
00288 {
00289     /*** IUnknown methods ***/
00290     STDMETHOD_(HRESULT,QueryInterface) (THIS_ REFIID riid, void** ppvObject) PURE;
00291     STDMETHOD_(ULONG,AddRef) (THIS) PURE;
00292     STDMETHOD_(ULONG,Release) (THIS) PURE;
00293     /*** IBandSiteStreamCallback ***/
00294     STDMETHOD_(HRESULT,OnLoad)(THIS_ IStream *pStm, REFIID riid, PVOID *pvObj) PURE;
00295     STDMETHOD_(HRESULT,OnSave)(THIS_ IUnknown *pUnk, IStream *pStm) PURE;
00296     /*** ITrayBandSite methods ***/
00297     STDMETHOD_(HRESULT,IsTaskBand) (THIS_ IUnknown *punk) PURE;
00298     STDMETHOD_(HRESULT,ProcessMessage) (THIS_ HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT *plResult) PURE;
00299     STDMETHOD_(HRESULT,AddContextMenus) (THIS_ HMENU hmenu, UINT indexMenu, UINT idCmdFirst, UINT idCmdLast, UINT uFlags, IContextMenu **ppcm) PURE;
00300     STDMETHOD_(HRESULT,Lock) (THIS_ BOOL bLock) PURE;
00301 };
00302 #undef INTERFACE
00303 
00304 #if defined(COBJMACROS)
00305 /*** IUnknown methods ***/
00306 #define ITrayBandSite_QueryInterface(p,a,b)             (p)->lpVtbl->QueryInterface(p,a,b)
00307 #define ITrayBandSite_AddRef(p)                         (p)->lpVtbl->AddRef(p)
00308 #define ITrayBandSite_Release(p)                        (p)->lpVtbl->Release(p)
00309 /*** IBandSiteStreamCallback methods ***/
00310 #define ITrayBandSite_OnLoad(p,a,b,c)                   (p)->lpVtbl->OnLoad(p,a,b,c)
00311 #define ITrayBandSite_OnSave(p,a,b)                     (p)->lpVtbl->OnSave(p,a,b)
00312 /*** ITrayBandSite methods ***/
00313 #define ITrayBandSite_IsTaskBand(p,a)                   (p)->lpVtbl->IsTaskBand(p,a)
00314 #define ITrayBandSite_ProcessMessage(p,a,b,c,d,e)       (p)->lpVtbl->ProcessMessage(p,a,b,c,d,e)
00315 #define ITrayBandSite_AddContextMenus(p,a,b,c,d,e,f)    (p)->lpVtbl->AddContextMenus(p,a,b,c,d,e,f)
00316 #define ITrayBandSite_Lock(p,a)                         (p)->lpVtbl->Lock(p,a)
00317 #endif
00318 
00319 ITrayBandSite *
00320 CreateTrayBandSite(IN OUT ITrayWindow *Tray,
00321                    OUT HWND *phWndRebar,
00322                    OUT HWND *phWndTaskSwitch);
00323 
00324 /*
00325  * startmnu.c
00326  */
00327 
00328 extern const TRAYWINDOW_CTXMENU StartMenuBtnCtxMenu;
00329 
00330 #define INTERFACE IStartMenuSite
00331 DECLARE_INTERFACE_(IStartMenuSite,IUnknown)
00332 {
00333     /*** IUnknown methods ***/
00334     STDMETHOD_(HRESULT,QueryInterface) (THIS_ REFIID riid, void** ppvObject) PURE;
00335     STDMETHOD_(ULONG,AddRef) (THIS) PURE;
00336     STDMETHOD_(ULONG,Release) (THIS) PURE;
00337     /*** IStartMenuSite ***/
00338 };
00339 #undef INTERFACE
00340 
00341 #if defined(COBJMACROS)
00342 /*** IUnknown methods ***/
00343 #define IStartMenuSite_QueryInterface(p,a,b)             (p)->lpVtbl->QueryInterface(p,a,b)
00344 #define IStartMenuSite_AddRef(p)                         (p)->lpVtbl->AddRef(p)
00345 #define IStartMenuSite_Release(p)                        (p)->lpVtbl->Release(p)
00346 /*** IStartMenuSite methods ***/
00347 #endif
00348 
00349 IMenuPopup*
00350 CreateStartMenu(IN ITrayWindow *Tray,
00351                 OUT IMenuBand **ppMenuBand,
00352                 IN HBITMAP hbmBanner  OPTIONAL,
00353                 IN BOOL bSmallIcons);
00354 
00355 HRESULT
00356 UpdateStartMenu(IN OUT IMenuPopup *pMenuPopup,
00357                 IN HBITMAP hbmBanner  OPTIONAL,
00358                 IN BOOL bSmallIcons);
00359 
00360 /*
00361  * trayntfy.c
00362  */
00363 
00364 /* TrayClockWnd */
00365 #define TCWM_GETMINIMUMSIZE (WM_USER + 0x100)
00366 #define TCWM_UPDATETIME     (WM_USER + 0x101)
00367 
00368 /* TrayNotifyWnd */
00369 #define TNWM_GETMINIMUMSIZE (WM_USER + 0x100)
00370 #define TNWM_UPDATETIME     (WM_USER + 0x101)
00371 #define TNWM_SHOWCLOCK      (WM_USER + 0x102)
00372 #define TNWM_SHOWTRAY       (WM_USER + 0x103)
00373 #define TNWM_CHANGETRAYPOS  (WM_USER + 0x104)
00374 
00375 #define NTNWM_REALIGN   (0x1)
00376 
00377 BOOL
00378 RegisterTrayNotifyWndClass(VOID);
00379 
00380 VOID
00381 UnregisterTrayNotifyWndClass(VOID);
00382 
00383 HWND
00384 CreateTrayNotifyWnd(IN OUT ITrayWindow *TrayWindow,
00385                     IN BOOL bHideClock);
00386 
00387 /*
00388  * taskswnd.c
00389  */
00390 
00391 #define TSWM_ENABLEGROUPING (WM_USER + 1)
00392 #define TSWM_UPDATETASKBARPOS   (WM_USER + 2)
00393 
00394 BOOL
00395 RegisterTaskSwitchWndClass(VOID);
00396 
00397 VOID
00398 UnregisterTaskSwitchWndClass(VOID);
00399 
00400 HWND
00401 CreateTaskSwitchWnd(IN HWND hWndParent,
00402                     IN OUT ITrayWindow *Tray);
00403 
00404 #endif /* _EXPLORER_PRECOMP__H_ */

Generated on Sat May 26 2012 04:15:25 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.