📄 priv.h
字号:
#ifndef _PRIV_H_
#define _PRIV_H_
/*****************************************************************************
*
* Magic comments:
*
* BUGBUG: Something that needs to be fixed before being released.
*
* _UNDOCUMENTED_: Something that is not documented in the SDK.
*
* _UNOBVIOUS_: Some unusual feature that isn't obvious from the
* documentation. A candidate for a "Tips and Tricks" chapter.
*
* _HACKHACK_: Something that is gross but necessary.
*
* _CHARSET_: Character set issues.
*
* Magic ifdefs:
*
*****************************************************************************/
/*****************************************************************************
*
* Global Includes
*
*****************************************************************************/
#define WIN32_LEAN_AND_MEAN
#define NOIME
#define NOSERVICE
// This stuff must run on Win95
#define _WIN32_WINDOWS 0x0400
#ifndef WINVER
#define WINVER 0x0400
#endif // WINVER
#define _OLEAUT32_ // get DECLSPEC_IMPORT stuff right, we are defing these
#define _FSMENU_ // for DECLSPEC_IMPORT
#define _WINMM_ // for DECLSPEC_IMPORT in mmsystem.h
#define _SHDOCVW_ // for DECLSPEC_IMPORT in shlobj.h
#define _WINX32_ // get DECLSPEC_IMPORT stuff right for WININET API
#define _URLCACHEAPI_ // get DECLSPEC_IMPORT stuff right for wininet urlcache
#define STRICT
#define POST_IE5_BETA
#include <w95wraps.h>
#include <windows.h>
#ifdef RC_INVOKED /* Define some tags to speed up rc.exe */
#define __RPCNDR_H__ /* Don't need RPC network data representation */
#define __RPC_H__ /* Don't need RPC */
#include <oleidl.h> /* Get the DROPEFFECT stuff */
#define _OLE2_H_ /* But none of the rest */
#define _WINDEF_
#define _WINBASE_
#define _WINGDI_
#define NONLS
#define _WINCON_
#define _WINREG_
#define _WINNETWK_
#define _INC_COMMCTRL
#define _INC_SHELLAPI
#define _SHSEMIP_H_ /* _UNDOCUMENTED_: Internal header */
#else // RC_INVOKED
#include <windowsx.h>
#endif // RC_INVOKED
#ifdef __cplusplus
extern "C" { /* Assume C declarations for C++. */
#endif /* __cplusplus */
#ifdef __cplusplus
} /* End of extern "C" {. */
#endif /* __cplusplus */
#include "resource.h"
#define _FIX_ENABLEMODELESS_CONFLICT // for shlobj.h
//WinInet need to be included BEFORE ShlObjp.h
#include <wininet.h>
#include <urlmon.h>
#include <shlobj.h>
#include <shlobjp.h> // For IProgressDialog
#include <exdisp.h>
#include <objidl.h>
#include <shlwapi.h>
#include <shlwapip.h>
#include <shellapi.h>
#include <shlapip.h>
#include <shsemip.h>
#include <crtfree.h>
#include <ole2ver.h>
#include <olectl.h>
#include <shellp.h>
#include <commctrl.h>
#include <comctrlp.h>
#include <shdocvw.h>
#include <shguidp.h>
#include <shlguidp.h>
#include <isguids.h>
#include <shdguid.h>
#include <mimeinfo.h>
#include <hlguids.h>
#include <mshtmdid.h>
#include <dispex.h> // IDispatchEx
#include <perhist.h>
#include <help.h>
#include <krnlcmn.h> // GetProcessDword
#include <multimon.h>
#define DISALLOW_Assert // Force to use ASSERT instead of Assert
#define DISALLOW_DebugMsg // Force to use TraceMsg instead of DebugMsg
#include <debug.h>
#include <urlhist.h>
#include <regstr.h> // for REGSTR_PATH_EXPLORE
#define USE_SYSTEM_URL_MONIKER
#include <urlmon.h>
//#include <winineti.h> // Cache APIs & structures
#include <inetreg.h>
#define _INTSHCUT_ // get DECLSPEC_IMPORT stuff right for INTSHCUT.h
#include <intshcut.h>
#include <propset.h> // BUGBUG (scotth): remove this once OLE adds an official header
#define HLINK_NO_GUIDS
#include <hlink.h>
#include <hliface.h>
#include <docobj.h>
#include <ccstock.h>
#include <port32.h>
#include <prsht.h>
#include <inetcpl.h>
#include <commctrl.h>
#include "unithunk.h"
// Trace flags
#define TF_FTPREF 0x00000100 // Dll Reference
#define TF_FTPPERF 0x00000200 // Perf
#define TF_FTPALLOCS 0x00000400 // Object Allocs
#define TF_FTPDRAGDROP 0x00000800 // Drag and Drop
#define TF_FTPLIST 0x00001000 // HDPA Wrapper
#define TF_FTPISF 0x00002000 // IShellFolder
#define TF_FTPQI 0x00004000 // QueryInterface
#define TF_FTPSTATUSBAR 0x00008000 // Status Bar Spew
#define TF_FTPOPERATION 0x00010000 // Ftp Operation (Put File, Get File, CreateDir, DeleteDir, ...)
#define TF_FTPURL_UTILS 0x00020000 // Ftp Url Operations (Pidl->Url, Url->Pidl, ...)
#define TF_FTP_DLLLOADING 0x00040000 // Loading Other DLLs
#define TF_FTP_OTHER 0x00080000 // Misc.
#define TF_FTP_IDENUM 0x00100000 // IDList Enum (IIDEnum).
#define TF_CHANGENOTIFY 0x00200000 // Change Notify
#define TF_PIDLLIST_DUMP 0x00400000 // Dump the contents in the Pidl List
#define TF_WININET_DEBUG 0x00800000 // Dump wininet calls
#define TF_BKGD_THREAD 0x01000000 // Background thread that caches wininet handles.
#define TF_FOLDER_SHRTCUTS 0x02000000 // Info about Folder Shortcuts.
/*****************************************************************************
*
* Global Helper Macros/Typedefs
*
*****************************************************************************/
//////////////////////////// IE 5 vs IE 4 /////////////////////////////////
// These are functions that IE5 exposes (normally in shlwapi), but
// if we want to be compatible with IE4, we need to have our own copy.
// If we turn on USE_IE5_UTILS, we won't work with IE4's DLLs (like shlwapi).
//
// #define USE_IE5_UTILS
//////////////////////////// IE 5 vs IE 4 /////////////////////////////////
#ifdef OLD_HLIFACE
#define HLNF_OPENINNEWWINDOW HLBF_OPENINNEWWINDOW
#endif // OLD_HLIFACE
#define ISVISIBLE(hwnd) ((GetWindowStyle(hwnd) & WS_VISIBLE) == WS_VISIBLE)
// shorthand
#ifndef ATOMICRELEASE
#define ATOMICRELEASET(p,type) { type* punkT=p; p=NULL; punkT->Release(); }
// doing this as a function instead of inline seems to be a size win.
//
#ifdef NOATOMICRELESEFUNC
#define ATOMICRELEASE(p) ATOMICRELEASET(p, IUnknown)
#else // NOATOMICRELESEFUNC
//////////////////////////// IE 5 vs IE 4 /////////////////////////////////
#ifndef USE_IE5_UTILS
#define ATOMICRELEASE(p) FtpCopy_IUnknown_AtomicRelease((LPVOID*)&p)
void FtpCopy_IUnknown_AtomicRelease(LPVOID* ppunk);
#endif // USE_IE5_UTILS
//////////////////////////// IE 5 vs IE 4 /////////////////////////////////
#endif // NOATOMICRELESEFUNC
#endif // ATOMICRELEASE
#ifdef SAFERELEASE
#undef SAFERELEASE
#endif // SAFERELEASE
#define SAFERELEASE(p) ATOMICRELEASE(p)
#define IsInRange InRange
// Include the automation definitions...
#include <exdisp.h>
#include <exdispid.h>
#include <shldispp.h>
#include <ocmm.h>
#include <mshtmhst.h>
#include <simpdata.h>
#include <htiface.h>
#include <objsafe.h>
//
// Neutral ANSI/UNICODE types and macros... 'cus Chicago seems to lack them
//
#ifdef UNICODE
typedef WCHAR TUCHAR, *PTUCHAR;
#else /* UNICODE */
typedef unsigned char TUCHAR, *PTUCHAR;
#endif /* UNICODE */
STDAPI_(void) DllAddRef(void);
STDAPI_(void) DllRelease(void);
#define CALLWNDPROC WNDPROC
extern HINSTANCE g_hinst;
#define HINST_THISDLL g_hinst
#include "idispids.h"
// Count of characters to count of bytes
//
#define CbFromCchW(cch) ((cch)*sizeof(WCHAR))
#define CbFromCchA(cch) ((cch)*sizeof(CHAR))
#ifdef UNICODE
#define CbFromCch CbFromCchW
#else // UNICODE
#define CbFromCch CbFromCchA
#endif // UNICODE
// General flag macros
//
#define SetFlag(obj, f) do {obj |= (f);} while (0)
#define ToggleFlag(obj, f) do {obj ^= (f);} while (0)
#define ClearFlag(obj, f) do {obj &= ~(f);} while (0)
#define IsFlagSet(obj, f) (BOOL)(((obj) & (f)) == (f))
#define IsFlagClear(obj, f) (BOOL)(((obj) & (f)) != (f))
#pragma intrinsic(memcmp, memcpy)
/*****************************************************************************
*
* Baggage - Stuff I carry everywhere
*
*****************************************************************************/
#define BEGIN_CONST_DATA data_seg(".text", "CODE")
#define END_CONST_DATA data_seg(".data", "DATA")
// Convert an array name (A) to a generic count (c).
#define ARRAYSIZE(a) (sizeof(a)/sizeof(a[0]))
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -