|
|
1.1 root 1: /*
2: * COMMON.H
3: *
4: * Structures and definitions applicable to all OLE 2.0 UI dialogs.
5: *
6: * Copyright (c)1992 Microsoft Corporation, All Right Reserved
7: */
8:
9:
10: #ifndef _COMMON_H_
11: #define _COMMON_H_
12:
13:
14: //Macros to handle control message packing between Win16 and Win32
15: #ifdef WIN32
16:
17: #ifndef COMMANDPARAMS
18: #define COMMANDPARAMS(wID, wCode, hWndMsg) \
19: WORD wID = LOWORD(wParam); \
20: WORD wCode = HIWORD(wParam); \
21: HWND hWndMsg = (HWND)(UINT)lParam;
22: #endif //COMMANDPARAMS
23:
24: #ifndef SendCommand
25: #define SendCommand(hWnd, wID, wCode, hControl) \
26: SendMessage(hWnd, WM_COMMAND, MAKELONG(wID, wCode) \
27: , (LPARAM)hControl)
28: #endif //SendCommand
29:
30: #else //Start !WIN32
31:
32: #ifndef COMMANDPARAMS
33: #define COMMANDPARAMS(wID, wCode, hWndMsg) \
34: WORD wID = LOWORD(wParam); \
35: WORD wCode = HIWORD(lParam); \
36: HWND hWndMsg = (HWND)(UINT)lParam;
37: #endif //COMMANDPARAMS
38:
39: #ifndef SendCommand
40: #define SendCommand(hWnd, wID, wCode, hControl) \
41: SendMessage(hWnd, WM_COMMAND, wID \
42: , MAKELONG(hControl, wCode))
43: #endif //SendCommand
44:
45: #endif //!WIN32
46:
47:
48:
49: //Property labels used to store dialog structures and fonts
50: #define STRUCTUREPROP "Structure"
51: #define FONTPROP "Font"
52:
53:
54: /*
55: * Standard structure for all dialogs. This commonality lets us make
56: * a single piece of code that will validate this entire structure and
57: * perform any necessary initialization.
58: */
59:
60: typedef struct tagOLEUISTANDARD
61: {
62: //These IN fields are standard across all OLEUI dialog functions.
63: DWORD cbStruct; //Structure Size
64: DWORD dwFlags; //IN-OUT: Flags
65: HWND hWndOwner; //Owning window
66: LPCSTR lpszCaption; //Dialog caption bar contents
67: LPFNOLEUIHOOK lpfnHook; //Hook callback
68: LPARAM lCustData; //Custom data to pass to hook
69: HINSTANCE hInstance; //Instance for customized template name
70: LPCSTR lpszTemplate; //Customized template name
71: HRSRC hResource; //Customized template handle
72: } OLEUISTANDARD, *POLEUISTANDARD, FAR *LPOLEUISTANDARD;
73:
74:
75:
76: //Function prototypes
77: //COMMON.C
78: UINT WINAPI UStandardValidation(const LPOLEUISTANDARD, const UINT, const HGLOBAL FAR *);
79: UINT WINAPI UStandardInvocation(DLGPROC, LPOLEUISTANDARD, HGLOBAL, LPCSTR);
80: LPVOID WINAPI LpvStandardInit(HWND, UINT, BOOL, HFONT FAR *);
81: LPVOID WINAPI LpvStandardEntry(HWND, UINT, WPARAM, LPARAM, UINT FAR *);
82: UINT WINAPI UStandardHook(LPVOID, HWND, UINT, WPARAM, LPARAM);
83: void WINAPI StandardCleanup(LPVOID, HWND);
84: void WINAPI StandardShowDlgItem(HWND hDlg, int idControl, int nCmdShow);
85:
86:
87: //DRAWICON.C
88:
89: //Structure for label and source extraction from a metafile
90: typedef struct tagLABELEXTRACT
91: {
92: LPSTR lpsz;
93: UINT Index; // index in lpsz (so we can retrieve 2+ lines)
94: DWORD PrevIndex; // index of last line (so we can mimic word wrap)
95:
96: union
97: {
98: UINT cch; //Length of label for label extraction
99: UINT iIcon; //Index of icon in source extraction.
100: } u;
101:
102: //For internal use in enum procs
103: BOOL fFoundIconOnly;
104: BOOL fFoundSource;
105: BOOL fFoundIndex;
106: } LABELEXTRACT, FAR * LPLABELEXTRACT;
107:
108:
109: //Structure for extracting icons from a metafile (CreateIcon parameters)
110: typedef struct tagICONEXTRACT
111: {
112: HICON hIcon; //Icon created in the enumeration proc.
113:
114: /*
115: * Since we want to handle multitasking well we have the caller
116: * of the enumeration proc instantiate these variables instead of
117: * using statics in the enum proc (which would be bad).
118: */
119: BOOL fAND;
120: HGLOBAL hMemAND; //Enumeration proc allocates and copies
121: } ICONEXTRACT, FAR * LPICONEXTRACT;
122:
123:
124: //Structure to use to pass info to EnumMetafileDraw
125: typedef struct tagDRAWINFO
126: {
127: RECT Rect;
128: BOOL fIconOnly;
129: } DRAWINFO, FAR * LPDRAWINFO;
130:
131:
132: int CALLBACK EXPORT EnumMetafileIconDraw(HDC, HANDLETABLE FAR *, METARECORD FAR *, int, LPARAM);
133: int CALLBACK EXPORT EnumMetafileExtractLabel(HDC, HANDLETABLE FAR *, METARECORD FAR *, int, LPLABELEXTRACT);
134: int CALLBACK EXPORT EnumMetafileExtractIcon(HDC, HANDLETABLE FAR *, METARECORD FAR *, int, LPICONEXTRACT);
135: int CALLBACK EXPORT EnumMetafileExtractIconSource(HDC, HANDLETABLE FAR *, METARECORD FAR *, int, LPLABELEXTRACT);
136:
137:
138: //Shared globals: our instance, registered messages used from all dialogs and clipboard
139: // formats used by the PasteSpecial dialog
140: extern HINSTANCE ghInst;
141:
142: extern UINT uMsgHelp;
143: extern UINT uMsgEndDialog;
144: extern UINT uMsgBrowse;
145: extern UINT uMsgChangeIcon;
146: extern UINT uMsgFileOKString;
147: extern UINT uMsgCloseBusyDlg;
148:
149: extern UINT cfObjectDescriptor;
150: extern UINT cfLinkSrcDescriptor;
151: extern UINT cfEmbedSource;
152: extern UINT cfEmbeddedObject;
153: extern UINT cfLinkSource;
154: extern UINT cfOwnerLink;
155: extern UINT cfFileName;
156:
157: //Standard control identifiers
158: #define ID_NULL 98
159:
160: #endif //_COMMON_H_
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.