added some development tools
[windows-sources.git] / developer / VSSDK / VisualStudioIntegration / Common / Inc / office10 / msosdm.h
blobe07b835aecc1306630ea984fd094aa826d6c607f
1 #pragma once
3 /*------------------------------------------------------------------------*
4 * msosdm.h (previously known as sdm.h): SDM Main PUBLIC include file. *
5 * *
6 * Please do not modify or check in this file without contacting MsoSdmQs.*
7 *------------------------------------------------------------------------*/
10 //----------------------------------------------------------------------//
11 // #IFDEF Use when...
12 // ------------ ----------------------------------------
13 // WIN32 Always true for WIN
14 // DEBUG
15 // TSMTE FE version
17 //----------------------------------------------------------------------//
19 #ifndef SDM_INCLUDED // Entire file.
20 #define SDM_INCLUDED
22 #include <msostd.h>
23 #include <msouser.h>
24 #include <msoswct.h>
25 #define SDMPUBLIC MSOAPICALLTYPE
27 //============================
28 // who's not defined?
29 #ifdef SDM_TYPES_DEFINED
30 #error
31 #endif
32 #ifdef DBCS
33 // REVIEW KirkG: DBCS is not defined for Mso. It is defined for Word
34 // (in word.h), but I don't think anything in Word's build uses it.
35 // What does this mean for its use in the TMW struct below? Does the
36 // client indeed allocate those things?
37 //#error
38 #endif
39 // who's already defined?
40 #ifndef SDM_WCT_DEFINED
41 #error
42 #endif
43 //============================
45 ///////////////////////////////////////////////////////////////////////////////
46 // Standard types and values.
48 #ifndef CSTD_H
49 typedef char * LSZ;
50 typedef char * SZ;
51 #endif
52 typedef WCHAR * LWZ;
53 typedef WCHAR * WZ;
55 typedef const char * CONST_SZ;
56 typedef const WCHAR * CONST_WZ;
58 #ifndef SDM_TYPES_DEFINED
59 #define SDM_TYPES_DEFINED
60 typedef unsigned char U8_SDM;
61 typedef char S8_SDM;
62 typedef unsigned short U16_SDM;
63 typedef short S16_SDM;
64 typedef unsigned short BIT_SDM; // short ==> better packing in Win32
67 // AKadatch: all these types hold pointers
68 // typedef long S32_SDM;
69 // typedef unsigned long U32_SDM;
70 // typedef int INT_SDM;
71 // typedef unsigned int UINT_SDM;
72 // typedef unsigned long BARG_SDM;
75 // AKadatch: some apps use obsolete and/or modified WinNT.h
76 // *_PTR types should be declared manually
77 #include <basetsd.h>
79 typedef LONG_PTR S32_SDM;
80 typedef ULONG_PTR U32_SDM;
81 typedef INT_PTR INT_SDM;
82 typedef UINT_PTR UINT_SDM;
83 typedef ULONG_PTR BARG_SDM;
85 //FEH: typedef short INT_SDM;
86 //FEH: typedef unsigned short UINT_SDM;
87 typedef UINT_SDM UCAB_SDM; //cab arg
88 typedef UINT_SDM UCBK_SDM; //callback parameter/return
90 // FUTURE Should we change Win to also define ILBE_SDM as INT_SDM?
92 // The Mac needsILBE_SDM to signed, since ilbeFirst can be < 0 in
93 // droplists, since there can be blank list items above the first
94 // real list item. However changing ILBE_SDM to INT_SDM on the
95 // Windows side caused problems in WinWord16, since ilbeNil was
96 // being sign-extended in longs in some structures. I tried to
97 // change ilbeNil and uNinchList to 0x7fff but ran into many places
98 // which hard-coded returning -1 instead of ilbeNil or that counted
99 // on ilbeNil+1==0
100 typedef UINT_SDM ILBE_SDM; // first entry in listbox
102 typedef int BOOL_SDM; //BOOL
104 typedef int XY_SDM; //screen coordinate
105 #endif //SDM_TYPES_DEFINED
106 ///////////////////////////////////////////////////////////////////////////////
107 // Function storage class.
109 #define SDM_MAC_EXPORT
111 typedef union _pnt
113 struct
115 XY_SDM x;
116 XY_SDM y;
118 XY_SDM rgxy[2];
119 } PNT;
121 typedef struct _rec
123 XY_SDM x;
124 XY_SDM y;
125 XY_SDM dx;
126 XY_SDM dy;
127 } REC; // Rectangle.
129 typedef POINTS PT_SDM;
132 ///////////////////////////////////////////////////////////////////////////////
133 // Convert RECT's to REC's, and vice-versa.
135 // Environment independant conversion.
136 #define RectOfRec(P1, P2) \
138 (P1).left = (P2).x; \
139 (P1).top = (P2).y; \
140 (P1).right = (P2).x + (P2).dx; \
141 (P1).bottom = (P2).y + (P2).dy; \
144 // Environment dependant conversion.
145 #define RecOfRect(P1, P2) \
147 (P1).x = ((P2).left); \
148 (P1).dx = ((P2).right - (P2).left); \
149 (P1).dy = ((P2).bottom - (P2).top); \
150 (P1).y = ((P2).top); \
153 #define FPtInRec(P1, P2) \
155 (P1).x >= (P2).x && \
156 (P1).x < (P2).x + (P2).dx && \
157 (P1).y >= (P2).y && \
158 (P1).y < (P2).y + (P2).dy \
162 ///////////////////////////////////////////////////////////////////////////////
163 // Text Selection.
164 typedef U32_SDM TXS;
166 #define ichLimLast 0x7fff // Go to end of edit item.
167 #define TxsOfFirstLim(f, l) ((TXS)MAKELONG((f), (l)))
168 #define TxsAll() TxsOfFirstLim(0, ichLimLast)
169 #define IchFirstOfTxs(txs) LOWORD(txs)
170 #define IchLimOfTxs(txs) HIWORD(txs)
174 ///////////////////////////////////////////////////////////////////////////////
175 // Base dialog types.
177 typedef VOID ** HDLG; // A near handle.
179 #define HdlgOfWNewWOld(wNew, wOld) ((HDLG)(wOld))
180 #define HdlgOfWNewWOldFar(wNew, wOld) ((HDLG)MAKELONG((wNew), (wOld)))
182 typedef char * STR; // String (SZ or STZ).
183 #define strNull (char *)NULL // (Use "char *" instead of SZ since
184 // not all apps. use cstd.h.)
186 typedef WCHAR * WSTR;
187 #define wstrNull (WCHAR *)NULL
189 #define hdlgNull ((HDLG) NULL)
190 #define hdlgError ((HDLG) -1)
191 #define hdlgCabError ((HDLG) -1)
192 #define hdltNull ((struct _dlt * *) NULL)
196 ///////////////////////////////////////////////////////////////////////////////
197 // TMC.
199 typedef UINT_SDM TMC; // Item codes.
201 // Standard item codes (tmc).
202 #define tmcNull ((TMC)0)
203 #define tmcError ((TMC)-1)
204 #define tmcOK ((TMC)1)
205 #define tmcOk tmcOK
206 #define tmcCancel ((TMC)2)
207 #define tmcSysMin ((TMC)0x10)
208 #define tmcSysMax ((TMC)0x400)
209 #define ftmcGrouped 0x8000 // OR'd to specify whole group as
210 // opposed to first item.
211 #define tmcUserMin tmcSysMax
212 #define tmcUserMax ((TMC)ftmcGrouped)
216 ///////////////////////////////////////////////////////////////////////////////
217 // Tmc macros.
219 #define TmcValue(tmc) ((tmc) & ~ftmcGrouped)
220 #define FIsGroupTmc(tmc) ((tmc & ftmcGrouped) != fFalse)
223 ///////////////////////////////////////////////////////////////////////////////
224 // TMT
225 typedef UINT_SDM TMT; /* TM types */
228 ///////////////////////////////////////////////////////////////////////////////
229 // DLM.
231 typedef UINT_SDM DLM; // Dialog proc / item proc messages.
233 // Global Messages.
234 #define dlmInit ((DLM)0x0001) // Do custom initialization.
235 #define dlmPlayBackInit ((DLM)0x0002) // Do custom noninteractive init.
236 #define dlmTerm ((DLM)0x0003) // Termination for one of many
237 // reasons.
238 #define dlmExit ((DLM)0x0004) // Dialog is about to be blown away.
240 // Item messages.
241 #define dlmChange ((DLM)0x0005) // Edit control may have changed.
242 #define dlmClick ((DLM)0x0006) // Item was clicked.
243 #define dlmDblClk ((DLM)0x0007) // Double click in listbox/radio.
244 #define dlmClickDisabled ((DLM)0x0008) // Noninteractive Dialog-sessions
245 // only, the button passed to
246 // FSetNoninteractive() has been
247 // disabled by a call to
248 // EnableNoninteractiveTmc() at dlmInit
249 // time.
251 // Rare Item Messages.
252 #define dlmTab ((DLM)0x0009) // Tab key intercept
253 #define dlmKey ((DLM)0x000a) // Any untrapped key.
254 #define dlmSetItmFocus ((DLM)0x000b) // Item gets focus.
255 #define dlmKillItmFocus ((DLM)0x000c) // Item loses focus.
257 // Rare Dialog Proc Messages.
258 #define dlmSetDlgFocus ((DLM)0x000d) // Dialog gets focus.
259 #define dlmKillDlgFocus ((DLM)0x000e) // Dialog loses focus.
260 #define dlmAdjustPos ((DLM)0x000f) // Adjust item's rec?
261 #define dlmTabOut ((DLM)0x0010) // Tab out of dialog?
262 #define dlmIdle ((DLM)0x0011) // Idle for modal dialogs.
263 #define dlmDlgClick ((DLM)0x0012) // Click in dialog's window.
264 #define dlmDlgDblClick ((DLM)0x0013) // Double click in dialog's window.
265 #define dlmShowCaret ((DLM)0x0014) // Show a caret.
266 #define dlmHideCaret ((DLM)0x0015) // Hide a caret.
267 #define dlmButtonDown ((DLM)0x0016) // Sent at mousedown on a button
268 #define dlmCreate ((DLM)0x0017) // Items are about to be created
269 #define dlmDlgMove ((DLM)0x0018) // Dialog window was just moved by user (JOHNTE)
270 #define dlmQueryNewPalette ((DLM)0x0019) // WM_QUERYNEWPALETTE (Win only)
271 #define dlmPaletteChanged ((DLM)0x001a) // WM_PALETTECHANGED (Win only)
272 #define dlmSubDialog ((DLM)0x001b) // New subdialog is about to appear
273 #define dlmFilterKey ((DLM)0x001c) // Dialog key message detected
274 #define dlmContextHelp ((DLM)0x001d) // Context Help (QuickTip)
275 #define dlmCtrlTab ((DLM)0x001e) // Ctrl+Tab pressed
276 #define dlmUpdateDefault ((DLM)0x001f) // give the app a chance
277 #define dlmDrag ((DLM)0x0020) // for Owner Drag listboxes
278 #define dlmRefEditShrink ((DLM)0x0021) //for notifying app of a dialog shrinking for ref edits
279 #define dlmChangeCheckBox ((DLM)0x0022) // for querying App if the Check box should be changed
280 #define dlmGetRefEditBmp ((DLM)0x0023)
281 #define dlmGetRefEditBmpShrunk ((DLM)0x0024)
282 #define dlmSemiSubDialog ((DLM)0x0025) // half way through a sub dialog
283 #define dlmActivateApp ((DLM)0x0026) // Recieved WM_ACTIVATEAPP TRUE.
284 #define dlmAskEnable ((DLM)0x0027) // Give a app to disallow enabling of TMC
285 #define dlmClickNotify ((DLM)0x0028) // User click on a disabled item
286 #define dlmRedisplayLbx ((DLM)0x0029) // Redisplay of list requested
287 #define dlmContextHelpOverride ((DLM)0x0030) // Redisplay of list requested
288 #define dlmAutoLayout ((DLM)0x0031) // Called to invoke AutoLayout code
289 #define dlmComboBoxDrop ((DLM)0x0032) // Called when lbox is dropped down
290 #define dlmUserMin ((DLM)0x0040) // For App use.
293 ///////////////////////////////////////////////////////////////////////////////
294 // TMM Messages.
296 typedef UINT_SDM TMM; // Control proc messages.
298 // ListboxProc messages.
299 #define tmmCount ((TMM)0x0002) // Return # of items.
300 #define tmmText ((TMM)0x0003) // Return text of n'th item. (always sent sequentially).
301 #define tmmEditText ((TMM)0x0004) // Like tmmText but send randomly.
302 #define tmmTooltipText ((TMM)0x0005) // Return tooltip for nth item (sent randomly)
303 // DON'T USE 0X0009. (See tmm's for both general pictures and listboxes below.)
304 #define cszUnknown ((UINT_SDM) -1) // Return to tmmCount if unknown.
306 // Gallery control context menu messages (a Gallery is a type of Listbox)
307 #define tmmCountContext ((TMM)0x0006) // Context menu entries this ilbe.
308 #define tmmContextSTCR ((TMM)0x0007) // The n'th Simple Toolbar Control Record.
309 #define tmmContextClicked ((TMM)0x0008) // Which STCR was clicked.
311 // ParseProc messages.
312 #define tmmFormat ((TMM)0x0001) // Format data.
313 #define tmmParse ((TMM)0x0002) // Parse data.
315 // Render Procs
316 #define tmmRender ((TMM)0x0001) // Repaint entire item.
317 #define tmmNewState ((TMM)0x0002) // State has changed.
318 #define tmmRepaint ((TMM)0x0003) // Repaint everything but text.
319 #define tmmNewText ((TMM)0x0004) // Repaint text alone
321 // GeneralPictures and ListboxProc
322 #define tmmCreate ((TMM)0x0001) // Create windows and such.
323 #define tmmAboutToResize ((TMM)0x0009) // Listbox or general picture is about to resize.
325 // General Pictures
326 // don't use the value 2 since tmmNewState is also used
327 // by general pictures
328 #define tmmPaint ((TMM)0x0003) // Paint yourself.
329 #define tmmFocus ((TMM)0x0004) // Show yourself with/without focus.
330 #define tmmInput ((TMM)0x0005) // User input received.
331 #define tmmMeasure ((TMM)0x0006) // Provide optimal default control size based on content (DAL)
332 #define tmmResize ((TMM)0x0007) // Alert the control that its size has changed.
333 #define tmmMetricsChange ((TMM)0x0008) // Alert the control that system metrics
334 // have changed (as SDM is notified through
335 // a WM_WININICHANGE message)
336 // DON'T USE 0X0009. (See tmm's for both general pictures and listboxes above.)
338 #define tmmTabStop ((TMM)0x000a) // Query if item is tabstop
339 #define tmmDestroy ((TMM)0x000b) // Inform item is being destroyed.
340 #define tmmMatchAccel ((TMM)0x000c) // Attempt to match accelerator key
341 #define tmmWctControl ((TMM)0x000d) // Complete a WPCTL structure (WM_GETCONTROLS)
342 #define tmmWctText ((TMM)0x000e) // Fill a WTXI structure (WM_GETTEXT)
343 #define tmmWctListCount ((TMM)0x000f) // Get list count (WM_GETLISTCOUNT)
344 #define tmmCtrlTab ((TMM)0x0010) // Ctrl+Tab pressed
345 #define tmmAccelerate ((TMM)0x0011) // picture was just sent focus by an accelerator key
346 #define tmmFilterKey ((TMM)0x0012) // allows pictures to filter their keystrokes before SDM mucks with them.
347 #define tmmGccKeydown ((TMM)0x0013) // keydowns for gcc color dropdowns
348 #define tmmGccDefaultChanged ((TMM)0x0014) //default tmc changed, so gcc doesn't need to reset it
349 #define tmmGccClick ((TMM)0x0015) // a buttondown occured while a picture has the focus
350 #define tmmSysInput ((TMM)0x0016) // User input (syskeydown) received
352 #if VSMSODEBUG
353 #define tmmSaveBe ((TMM)0x003f) // debug memory accounting
354 #endif
356 #define tmmUserMin ((TMM)0x0040) // For user extensions.
358 #define wFilterEaten ((UINT_SDM)0xFFED) // return value for tmmFilterKey when
359 // the event was handled by the picture proc
361 typedef struct _drm_sdm
363 WCHAR * wzTmpl;
364 WCHAR * wzName;
365 WCHAR * wzType;
366 } DRM_SDM;
370 ///////////////////////////////////////////////////////////////////////////////
371 // FTMS - Item States.
373 typedef UINT_SDM FTMS;
375 #define ftmsNull ((FTMS)0x0000) // None of the following.
377 // The folowing four alignment bits are specific to static text
378 // Note: the contiguity and ordering of the following 3 is assumed.
380 #define ftmsLeft ((FTMS)0x0000) // left aligned (default)
381 #define ftmsCenter ((FTMS)0x0001) // centered
382 #define ftmsRight ((FTMS)0x0002) // right aligned
383 #define ftmsAlt ((FTMS)(ftmsLeft|ftmsCenter|ftmsRight))
385 #define ftmsDefault ((FTMS)0x0002) // Item is default pushbutton.
386 #define ftmsPushed ((FTMS)0x0004) // Button is "depressed".
387 #define ftmsMouseDown ftmsPushed // newer name for ftmsPushed
388 #define ftmsInvert ftmsPushed // Old name for ftmsPushed.
389 #define ftmsOn ((FTMS)0x0008) // Item is "on".
390 #define ftmsNinch ((FTMS)0x0010) // Tri-state only - third state.
392 // Note: the contiguity and ordering of the following 4 is assumed.
393 #define ftmsEnable ((FTMS)0x0020) // Item is enabled.
394 #define ftmsVisible ((FTMS)0x0040) // Item is invisible.
395 #define ftmsMember ((FTMS)0x0080) // Member of current subdialog.
397 #define ftmsNewText ((FTMS)0x0100) // Text has changed
399 //The following ftms are for drawing static text
401 #define ftmsMultiline ((FTMS)0x0200) // multiline static text
402 #define ftmsBorder ((FTMS)0x0400) // has a border
403 #define ftmsNoPrefix ((FTMS)0x0800) // don't treat chAccel as a prefix
405 #define ftmsNoRedraw ((FTMS)0x1000) // don't redraw until clear
407 #define ftmsLight ((FTMS)0x2000) // use light font (sdi.hfontLight)
409 #define ftmsFocus ((FTMS)0x4000) // Item has the focus.
411 #define ftmsTempHidden ((FTMS)0x8000) // Item is temporarily hidden
412 /* FMidEast */
413 #define ftmsHasReo ftmsMultiline // make edit item respect ftmsRTLReo
414 #define ftmsRTLReo ((FTMS)0x10000) // draw static strings with RTL reading
415 // order. edit text requires ftmsHasReo
416 /* FMidEast End */
418 #define ftmsHyperlink ((FTMS)0x20000) // Draw this control as a hyperlink
419 #define ftmsMouseOver ((FTMS)0x80000) // Draws control in the mouse over state
421 ///////////////////////////////////////////////////////////////////////////////
422 // TMV - Item Values.
424 typedef UINT_SDM TMV;
426 #define tmvNoType ((TMV)0)
427 #define tmvWord ((TMV)1)
428 #define tmvFixed ((TMV)2)
429 #define tmvString ((TMV)3)
430 #define tmvRgw ((TMV)4)
433 ///////////////////////////////////////////////////////////////////////////////
434 // dlmChange notifications
436 typedef UINT_SDM FTMN;
438 #define ftmnNull ((FTMN)0x0000)
439 #define ftmnCombo ((FTMN)0x0001)
440 #define ftmnCharValidated ((FTMN)0x0002)
441 #define ftmnKillFocus ((FTMN)0x0004)
442 #define ftmnCabVal ((FTMN)0x0008)
445 ///////////////////////////////////////////////////////////////////////////////
446 // CAB info.
448 typedef void * * * PCABH; // Pointer to a handle value inside of a CAB.
449 typedef void * * HCAB; // CAB is an abstract data type.
450 typedef void * PCAB; // Pointer to arbitrary CAB.
451 typedef UINT_SDM CABI; // CAB initializer.
452 typedef UINT_SDM IAG; // Iag
453 #define Cabi(cwTotal, cHandle) ((cwTotal) + (cHandle << 8))
454 #define hcabNull ((HCAB)NULL)
455 #define hcabNonNull ((HCAB)1)
456 #define hcabNotFilled ((HCAB)-1) // Could be returned by HcabFromDlg().
458 typedef unsigned SAB_SDM;
460 // Command argument block header.
461 typedef struct _cabh
463 UINT_SDM cwSimple; // Total size of CAB less CABH.
464 UINT_SDM cHandle; // # of handles.
465 } CABH;
467 // Minimum CAB size : header + sab.
468 #define cwCabMin ((sizeof(CABH) + sizeof(SAB_SDM)) / sizeof(UCAB_SDM))
469 #define cbCabMin (cwCabMin * sizeof(UCAB_SDM))
470 #define cbCabOverhead (cwCabMin * sizeof(UCAB_SDM))
472 // Iag macro - returns iag corresponding to field fld in application structure
473 #define iagNil ((UINT_SDM)0x00ff)
475 // AKadatch: use FIELD_OFFSET
476 // #define Iag(sz, fld) \
477 // ((BARG_SDM)((BARG_SDM)&(((sz *)0)->fld) / sizeof(UCAB_SDM) - cwCabMin))
478 #define Iag(sz, fld) \
479 ((BARG_SDM)((BARG_SDM)FIELD_OFFSET(sz,fld) / sizeof(UCAB_SDM) - cwCabMin))
481 // Macro to get void pointer to general CAB arg given offset.
482 #define PvParseArg(hv, bArg) \
483 (((hv) == (VOID **)NULL) ? (VOID *)(bArg) : \
484 (VOID *)(*(char * *)(hv) + (bArg)))
486 //----------originally in sdmparse.h----------
487 #define SetPpvBToW(ppv, bArg, w) *((UCAB_SDM *) PvParseArg(ppv, bArg)) = w
488 #define WFromPpvB(ppv, bArg) *((UCAB_SDM *) PvParseArg(ppv, bArg))
490 /* Dialog Parse Values */
492 // Publisher has a conflict with the typedef of DPV, so in some cases, they
493 // need to be able to remove it by #defining REMOVE_TYPEDEF_DPV
494 #ifndef REMOVE_TYPEDEF_DPV
495 typedef int DPV;
496 #endif // REMOVE_TYPEDEF_DPV
498 #define dpvError 0x00
499 #define dpvNormal 0x01
500 #define dpvBlank 0x02
501 #define dpvAuto 0x04
502 #define dpvDouble 0x08
503 #define dpvSpaces 0x10
504 //--------------------------------------------
506 // Macro to get void pointer to general CAB arg given iag.
507 #define PvFromCabIag(hcab, iag) \
508 ((VOID *)(*((UCAB_SDM * *)(hcab)) + cwCabMin + (iag)))
510 // Cab string/data pointers.
511 typedef WCHAR * WTZ_CAB;
512 typedef const WCHAR * CONST_WTZ_CAB;
514 typedef WCHAR * WZ_CAB;
515 typedef const WCHAR * CONST_WZ_CAB;
517 typedef char * SZ_CAB;
518 typedef const char * CONST_SZ_CAB;
520 typedef WCHAR * RGB_CAB;
521 typedef const WCHAR * CONST_RGB_CAB;
523 typedef WCHAR * WT_CAB;
524 typedef WCHAR * LWTZ_CAB;
525 typedef WCHAR * LRGB_CAB;
528 ///////////////////////////////////////////////////////////////////////////////
529 // structure passed with dlmInit message
531 typedef struct _dmi_sdm
533 HDC hpdc;
534 HCAB hcab;
535 } DMI_SDM;
539 ///////////////////////////////////////////////////////////////////////////////
540 // Other special values.
542 // Special ninch (No Input, No CHange) value.
543 #define wNinch (-32767) // Ints.
544 #define uNinch ((UINT_SDM)-1) // Unsigned.
545 #define uNinchRadio uNinch // RadioGroups.
546 #define uNinchCheck uNinch // CheckBoxes
547 #define wNinchCheck uNinchCheck // Old name.
548 #define uNinchList ((ILBE_SDM)-1) // Listboxes.
550 #define iszNinchList uNinchList // Other name.
552 // Special parse error values.
553 #define wError (-32766) // Ints.
554 //original source: #define uError (0xfffe) // Unsigneds.
555 //current source: #define uError ((short)0xfffe) // Unsigneds.
556 #define uError ((UINT_SDM)-2) // Unsigneds.
558 // Default no help.
559 #define hidDlgNull 0 // For no help.
562 // For Memory allocation callbacks
563 typedef U32_SDM SB_SDM;
566 // Scroll Bar notification messages (wNew in dlmClick)
567 typedef unsigned SBN_SDM;
568 #define sbnLineUp SB_LINEUP
569 #define sbnLineDown SB_LINEDOWN
570 #define sbnPageUp SB_PAGEUP
571 #define sbnPageDown SB_PAGEDOWN
572 #define sbnThumbPosition SB_THUMBPOSITION
573 #define sbnThumbTrack SB_THUMBTRACK
574 #define sbnTop SB_TOP
575 #define sbnBottom SB_BOTTOM
576 #define sbnEndScroll SB_ENDSCROLL
580 // Max size of SDM strings, and the buffer size w/ zero term.
582 #define cchSDMWzMax MSO_MAX_PATH
583 #define cchSDMWzBufMax (MSO_MAX_PATH + 1)
585 // This is our old string size, so that we can keep things the same for
586 // legacy dialogs, and so that we can use short strings if we'll never
587 // need anything larger than 255, like on tab controls.
589 #define cchSDMWzMaxShort 255
590 #define cchSDMWzBufMaxShort 256
594 ///////////////////////////////////////////////////////////////////////////////
595 // Dialog Initialization.
597 typedef U32_SDM FDLG;
599 #define fdlgNull ((FDLG)0x00000000)
601 #define fdlgModal ((FDLG)0x00000001) // Create Modal.
602 #define fdlgInvisible ((FDLG)0x00000002) // Start invisible.
603 #define fdlgEnableTabOut ((FDLG)0x00000004) // Send dlmTabOut.
605 #define fdlgPopup ((FDLG)0x00000008) // Popup dialog - Win only
606 #define fdlgScreenCoords fdlgPopup // Mac: same as above.
608 #define fdlgClipChildren ((FDLG)0x00000020) // Clip controls - Win only
609 #define fdlgFedt ((FDLG)0x00000040) // EditItem is FEDT - Win only
610 #define fdlgAdjustPos ((FDLG)0x00000080) // Adjust item rec's.
611 #define fdlgOwnDC ((FDLG)0x00000100) // Dialog owns a DC.
612 #define fdlgNoHelpIcon ((FDLG)0x00000200) // No Win95 Help Icon - Win only
613 #define fdlgNoMvDefBut ((FDLG)0x00000400) // Don't move defaultness
615 #define fdlgRepainting ((FDLG)0x00000800) // currently processing WM_PAINT - Win only
617 #define fdlgEditConvert ((FDLG)0x00001000) // ANSI -=> OEM -=> ANSI :-P - !MAC only
619 #define fdlgSysModal ((FDLG)0x00002000) // Sys modal dialog
621 #define fdlgEditMenu ((FDLG)0x00004000) // TEs respond to edit menu - MAC only
622 #ifndef fdlgNoSabResize
623 #define fdlgNoSabResize fdlgEditMenu // let app resize on sab switch - !MAC only
624 #endif
626 #define fdlgDelayListbox ((FDLG)0x00008000) // Delay listbox fill
627 #define fdlgHideAccel ((FDLG)0x00010000) // No accel underlines
628 #define fdlgOnDemandSubdlg ((FDLG)0x00020000) // Init only member controls
629 #define fdlgNoUpdate ((FDLG)0x00040000) // Don't UpdateWindow
630 #define fdlgShrunk ((FDLG)0x00080000) // RefEdits
631 #define fdlgRefEditEnabled fdlgShrunk // RefEdits - initialization, dialog is refedit enabled
633 #define fdlgUseTrueTypeFonts ((FDLG)0x00100000) // MAC only, use truetype fonts for drawing
634 #define fdlgImeOff fdlgUseTrueTypeFonts // FE - WinOnly, turn on DES IME control.
636 // This was added to help with SW Pane's perf wrt hidden controls. Since
637 // SDM can't dynamically create controls, the maximum was allocated in
638 // the resource file, but we don't need to show all of them most of the time.
639 // Note: same as the old fdlgMacDisabled, which is not referenced by MSO at all.
640 // (Raid O10 223434)
641 // Note: This flag is mutually exclusive of fdlgOnDemandSubdlg
642 // Note; O10 257833 Using this to lazy create tmw's can cause FEnumTmw to return fFalse for
643 // some functions. Check enormous for details.
644 #define fdlgCreateOnDemand ((FDLG)0x00200000) // Create and init only controls that are needed
646 // WARNING: The following bits are private to SDM -- do not
647 // set these bits in dli.fdlg! Additionally, support for these
648 // bits are not guaranteed.
649 // REVIEW fdlgSendUpdDflt isn't private. We are out of bits, and need more!
650 #define fdlgDisabled ((FDLG)0x80000000)
651 #define fdlgHasButtons ((FDLG)0x40000000) // Has a pushbutton.
652 #define fdlgInitializing ((FDLG)0x20000000) // Is initializing.
653 #define fdlgAbort ((FDLG)0x10000000) // Being destroyed.
654 #define fdlgListOOM ((FDLG)0x08000000) // sevList hit.
655 #define fdlgCreating ((FDLG)0x04000000) // Creating dialog.
656 #define fdlgNoninteractive ((FDLG)0x02000000) // Non-Interactive?
657 #define fdlgDestroyed ((FDLG)0x01000000) // Non-Interactive?
658 #define fdlgNoPaint ((FDLG)0x00800000) // Don't paint dialog
659 #define fdlgChildDlg ((FDLG)0x00400000) // MAC only, Dialog is item of parent
660 #define fdlgSendUpdDflt fdlgChildDlg // !MAC only, notify to update default ring
661 #define fdlgImeOn fdlgMacDisabled // FE - Turn On IME when a dialog gets focus.
662 #define fdlgPrivateMask ((FDLG)0xff800000) // All private bits.
664 // REVIEW old FDLGS included so that we link properly
665 // with older applications
667 // all dialogs do this now
668 #define fdlgNoPopupRetDismiss fdlgNull // return in dropped does not dismiss popups
669 #define fdlgNoKey fdlgNull // keyboard interface for controls
671 #define FDlgCurNoKey() (fFalse)
674 #define FTestFdlg(fdlg, fdlgTest) (((fdlg) & (fdlgTest)) != fdlgNull)
675 #define ClearFdlg(fdlg, fdlgClear) ((fdlg) &= ~(fdlgClear))
676 #define SetFdlg(fdlg, fdlgSet) ((fdlg) |= (fdlgSet))
677 #define FlipFdlg(fdlg, fdlgFlip) ((fdlg) ^= (fdlgFlip))
679 typedef struct _dli // DiaLog Initializer.
681 HWND hwnd;
682 XY_SDM dx, dy;
683 FDLG fdlg;
684 UINT_SDM wRef;
685 BYTE * rgb; // App-supplied rgtmw (in sbDlg).
686 DWORD clrWindow; // not used yet on the Mac
687 SB_SDM sb; // majic number to pass back to mem alloc callbacks
688 } DLI;
689 #define pdliNull ((DLI *)0)
693 ///////////////////////////////////////////////////////////////////////////////
694 // Misc Functions .
696 extern UINT_SDM wRefDlgCur; // Cached value.
697 extern HCAB hcabDlgCur; // Cached value.
699 #define HcabDlgCur() HcabQueryCur()
700 #define WRefDlgCur() WRefQueryCur()
702 ///////////////////////////////////////////////////////////////////////////////
703 // RenderProc environment-specific Draw Structure.
705 typedef struct _rds
707 HDC hpdc;
708 HWND hwnd;
709 RECT rect;
711 WCHAR * * pwz;
712 BOOL_SDM fNoKey; //no keybd interface
713 } RDS;
715 #define SM_SETSECRET 0x800a // Tell (any) FEDT text is "secret".
716 #define SM_GETSECRET 0x800b // Is the FEDT secret?
718 // Private message sent from fedt to dialog window.
719 #define SM_USER 0x8005
722 ///////////////////////////////////////////////////////////////////////////////
723 // PictureProc message-specific parameter.
725 typedef struct _sdmp
727 HWND hwnd;
728 REC * prec;
729 FTMS ftms;
730 union
732 LPMSG lpmsg; // tmmInput
733 unsigned chAccel; // tmmMatchAccel
734 BOOL_SDM fBackTab; // tmmCtrlTab
735 struct
737 BOOL_SDM fAction; // tmmCreate
738 BOOL_SDM fHelp; // tmmCreate
740 #ifdef SDM_WCT_DEFINED //msoswct.h included
741 LPWCTL lpwctl; // tmmWctControl
742 struct
744 LPWTXI lpwtxi; // tmmWctText
745 int cch; // tmmWctText output
747 int cwz; // tmmWctListCount output
748 #endif //SDM_WCT_DEFINED
749 struct
751 HDC hpdc; // tmmPaint, tmmMeasure
752 POINT ptDesiredDimensions; // tmmMeasure, tmmAboutToResize
755 } SDMP;
757 #define psdmpNull ((SDMP *)NULL)
759 ///////////////////////////////////////////////////////////////////////////////
760 // Procedure templates (for callbacks).
762 #define SDM_CALLBACK PASCAL // Far callback.
764 typedef BOOL_SDM (SDM_CALLBACK * PFN_DIALOG)(DLM, TMC, UCBK_SDM, UCBK_SDM, UCBK_SDM);
765 typedef PFN_DIALOG PFN_ITEM;
767 // EB/EL Cab Save CallBack.
769 typedef VOID (SDM_CALLBACK * PFN_SAVECAB)(HCAB, UINT_SDM, TMC, BOOL_SDM);
770 #define pfnSaveCabNull ((PFN_SAVECAB)0)
772 // Top level Modal Message Filter.
773 typedef BOOL_SDM (SDM_CALLBACK * PFN_FILTERMSG)(LPMSG);
775 #define pfnFilterMsgNull ((PFN_FILTERMSG)0)
777 typedef int (WINAPI * PFN_ALERT)(HWND, LPCWSTR, LPCWSTR, UINT);
778 #define pfnAlertNull ((PFN_ALERT)NULL)
780 // General control proc template.
781 typedef UCBK_SDM (SDM_CALLBACK * PFN_CTRL)(TMM, VOID *, UCBK_SDM, UCBK_SDM, TMC, UCBK_SDM);
782 #define pfnCtrlNull ((PFN_CTRL)0)
784 typedef UCBK_SDM (SDM_CALLBACK * PFN_PIC)(TMM, SDMP *, UCBK_SDM, UCBK_SDM, TMC, UCBK_SDM);
785 typedef UCBK_SDM (SDM_CALLBACK * PFN_PARSE)(TMM, WCHAR *, VOID * *, BARG_SDM, TMC, UCBK_SDM);
786 typedef UCBK_SDM (SDM_CALLBACK * PFN_LISTBOX)(TMM, WCHAR *, ILBE_SDM, UCBK_SDM, TMC, UCBK_SDM);
787 typedef UCBK_SDM (SDM_CALLBACK * PFN_RENDER)(TMM, RDS *, FTMS, FTMS, TMC, UCBK_SDM);
788 typedef PFN_PARSE PFN_FORMAT;
790 // Autocomplete call back
791 // Second Argument(WCHAR *) is the string to be autocompleted
792 // Third Argument(WCHAR *) is the return string by the function
793 // Return TRUE if autocompleting should occur
794 // Return FALSE if no changes(i.e. autocompletion) should occur
795 typedef BOOL_SDM (SDM_CALLBACK * PFN_AUTOCOMPLETE)(void *, TMC, WCHAR *, WCHAR *);
797 // Resize callback
798 // first arg = tmc of control being moved
799 // second arg = REC pointing at move location
800 typedef void (SDM_CALLBACK * PFN_RESIZE)(TMC, REC *);
803 // Dialog Creation callback
804 // Argument is the new dialog hwnd which might be useful for subclassing.
805 typedef void (SDM_CALLBACK * PFN_DLGCREATED)(HWND);
807 // Peek/GetMessage callback
809 typedef BOOL_SDM (SDM_CALLBACK *SDM_PFNPEEKMESSAGE)(MSG *, HWND, UINT, UINT, UINT);
810 typedef BOOL_SDM (SDM_CALLBACK *SDM_PFNGETMESSAGE)(MSG *, HWND, UINT, UINT);
811 ///////////////////////////////////////////////////////////////////////////////
812 // Procedure Templates.
815 MSOAPI_(HDLG) HdlgGetCur( void );
816 MSOAPI_(HDLG) HdlgGetFocus( void );
817 MSOAPI_(BOOL) MsoFDlgIsWorkpane(HDLG hdlg);
818 MSOAPI_(void) MsoProtectSDMInWorkpane(void);
819 MSOAPIX_(void) MsoUnprotectSDMInWorkpane(void);
820 MSOAPI_(void) MsoNotifySdmOfFocus(TMC tmc, BOOL fFocus);
821 MSOAPI_(FARPROC) LpfnMsoSetSdmMessageWrap(FARPROC lpfn, int fUnicode, int fPeek);
824 ///////////////////////////////////////////////////////////////////////////////
825 // FtmeIsSdmMessage() return values.
827 // Need special return values for functions that normally return fTrue/fFalse.
828 typedef UINT_SDM FTME;
829 #define ftmeNull ((FTME)0)
830 #define ftmeTrue ((FTME)1)
831 #define ftmeError ((FTME)2)
832 #define ftmeDone ((FTME)4)
833 #define ftmeEaten ((FTME)8) // modal dialog is front window,
834 // and received click on other
835 // window. App should beep.b
840 ///////////////////////////////////////////////////////////////////////////////
841 // Hard-coded callbacks.
843 // Out Of Memory Support.
844 typedef UINT_SDM SEV;
845 #define sevMinor 1 // Minor (painting) error.
846 // don't cast, since used in MASM
847 #define sevMajor ((SEV)2) // Major error.
848 #define sevLmem ((SEV)3) // Out of LMEM memory.
849 #define sevHcabFromDlg ((SEV)4) // HcabFromDlg() failure.
850 #define sevList ((SEV)6) // ListBox fill failure.
852 /* Current SDM mem functions. */
853 #ifndef PpvSdmAllocCb
854 MSOMACAPI_(VOID**) SDM_CALLBACK PpvSdmAllocCb(SB_SDM, UINT_SDM);
855 MSOMACAPI_(BOOL_SDM) SDM_CALLBACK FSdmReallocPpv(SB_SDM, VOID **, UINT_SDM);
856 MSOMACAPI_(VOID) SDM_CALLBACK FreeSdmPpv(SB_SDM, VOID **);
857 #if VSMSODEBUG
858 MSOMACAPI_(BOOL_SDM) SDM_CALLBACK FSaveSdmBe(HMSOINST hinst, LPARAM lparam, VOID** ppv, int bt);
859 #endif
860 MSOMACAPI_(UINT_SDM) SDM_CALLBACK CbSdmSizePpv(SB_SDM, VOID **);
861 MSOMACAPI_(BOOL_SDM) SDM_CALLBACK FSdmDoIdle(BOOL_SDM);
862 MSOMACAPI_(BOOL_SDM) SDM_CALLBACK FRetrySdmError(UINT_SDM, HDLG, SEV);
863 #endif
865 /* Default SDM mem functions. */
866 MSOMACAPIX_(VOID**) SDM_CALLBACK MsoPpvSdmAllocCb(SB_SDM, UINT_SDM);
867 BOOL_SDM SDM_CALLBACK MsoFSdmReallocPpv(SB_SDM, VOID **, UINT_SDM);
868 VOID SDM_CALLBACK MsoFreeSdmPpv(SB_SDM, VOID **);
869 UINT_SDM SDM_CALLBACK MsoCbSdmSizePpv(SB_SDM, VOID **);
870 #if VSMSODEBUG
871 BOOL_SDM SDM_CALLBACK MsoFSaveSdmBe(HMSOINST hinst, LPARAM lparam, VOID** ppv, int bt);
872 #endif
873 BOOL_SDM SDM_CALLBACK MsoFSdmDoIdle(BOOL_SDM);
874 BOOL_SDM SDM_CALLBACK MsoFRetrySdmError(UINT_SDM, HDLG, SEV);
876 // Bitmap support - handle from id.
878 typedef HBITMAP HBITMAP_SDM;
880 HBITMAP_SDM SDM_CALLBACK MsoHbmpFromIBmp(UINT_SDM);
881 #ifndef HbmpFromIBmp
882 MSOMACAPI_(HBITMAP_SDM) SDM_CALLBACK HbmpFromIBmp(UINT_SDM);
883 #endif
884 #define hbmpNull ((HBITMAP_SDM)NULL)
887 ///////////////////////////////////////////////////////////////////////////////
888 // Misc types.
890 #define hNull NULL // Generic null handle.
891 #define ppvNull NULL // Null lmem handle.
893 #define hfontNull ((HFONT)NULL)
897 ///////////////////////////////////////////////////////////////////////////////
898 // SDM Initialization structure.
900 typedef FARPROC SDM_FARPROC;
902 #ifndef lpfncompNull
903 #define lpfncompNull ((SDM_FARPROC)NULL)
904 #endif //!lpfncompNull
907 typedef struct _sdi
909 char * szApp; // Unique application name.
910 HANDLE hinstCur; // Current application instance.
911 HANDLE hinstPrev; // Previous application instance.
912 HCURSOR hcursorArrow; // For dialog class
913 HDC hdcMem; // Memory DC.
914 XY_SDM dyLeading; // TextMetrics tmExternalLeading.
916 HWND hwndApp; // Application's main window.
917 XY_SDM dxSysFontChar; // Width of system font (average).
918 XY_SDM dySysFontChar; // Height of system font (maximum).
919 XY_SDM dySysFontAscent; // Height of system font ascenders.
921 PFN_FILTERMSG pfnFilterMsg; // Message filter callback.
922 PFN_ALERT pfnAlert; // client supplied replacement for MessageBox
924 SB_SDM sbEL; // majic number
926 char * szFedtClass; // Class name for FEDT.
928 SDM_FARPROC lpfncomp;
929 char * szScrollClass; // class for listbox scrollbars
931 HFONT hfont; // Font for dialogs; use system font if NULL
932 HFONT hfontLight; // Font for "light" text items; use hfont if NULL
933 HFONT hfontBold; // Bold font; is hfont for FE
935 BOOL_SDM (SDM_CALLBACK *pfnDlmDlgFilter) (DLM, TMC, UCBK_SDM, UCBK_SDM, UCBK_SDM);
936 BOOL_SDM (SDM_CALLBACK *pfnDlmItemFilter) (TMM, TMC, UCBK_SDM, UCBK_SDM, UCBK_SDM);
937 BOOL_SDM (SDM_CALLBACK *pfnDlmEmDlgFilter) (TMM, TMC, UCBK_SDM, UCBK_SDM, UCBK_SDM);
939 HBITMAP_SDM (SDM_CALLBACK *pfnHbmpFromIBmp) (UINT_SDM);
940 BOOL_SDM (SDM_CALLBACK *pfnFSdmDoIdle)(BOOL_SDM);
941 BOOL_SDM (SDM_CALLBACK *pfnFRetrySdmError)(UINT_SDM, HDLG, SEV);
942 UINT_SDM cbWndExtraClient;
943 BOOL_SDM fChisled; //that gratuitous "chisled" look
944 BOOL_SDM fPixelScale; // no scaling (JOHNTE)
945 BOOL_SDM fExtendedTmm; // extended listboxes get tmmCount?
946 int iDBCSCtry;
948 WNDPROC pfnLSdmWP; // class window proc
949 UINT_SDM lid; // Language for dialogs
950 UINT_SDM uCodePage; // Code page for dialogs
952 SDM_PFNPEEKMESSAGE pfnPeekMessageW;
953 SDM_PFNPEEKMESSAGE pfnPeekMessageA;
954 SDM_PFNGETMESSAGE pfnGetMessageW;
955 SDM_PFNGETMESSAGE pfnGetMessageA;
956 } SDI;
958 #define psdiNull ((SDI *)0)
962 ///////////////////////////////////////////////////////////////////////////////
963 // DLG access. defined here for the following macros that are defined
965 typedef struct _dlh
967 struct _dlt * * hdlt; // Dialog Template.
968 HCAB hcab; // Initial CAB for Dialog.
969 HWND hwndDlg; // Dialog's (frame) window.
971 #define hwndDlgClient hwndDlg // I know its gross, but it saves a lot
972 // of mess in the sdm .c files.
974 UINT_SDM wRef; // User supplied Dialog word.
975 FDLG fdlg; // Dialog flags.
976 UINT_SDM hid; // Help ID.
977 UINT_SDM hidBase; // Base Help ID.
978 TMC tmcContext; // tmc that was clicked in QuickTip mode
979 BOOL_SDM fTmcContextEnabled; // was that tmc enabled or not?
980 PT_SDM ptClick; // Mouse position of click for QuickTip
981 } DLH; // Public part of DLG structure.
985 ///////////////////////////////////////////////////////////////////////////////
986 // SDS access. (Only defined here for the following macros that are defined
987 // by the SDM project. This struct is NOT for public use!)
990 typedef struct _sds_sdm // State of SDM.
992 SB_SDM sbDlgCur; // SbDds if not SDM_MULTI_SB.
993 SB_SDM sbDlgFocus;
994 void * * ppdlgCur; // Current Dialog.
995 void * * ppdlgFocus; // Dialog with input focus.
996 } SDS_SDM;
997 #define SbsdmDlgCur() sds.sbDlgCur
999 ///////////////////////////////////////////////////////////////////////////////
1000 // Other common functions
1002 // Return the value TMC (first TMC in group usually) or do nothing if not
1003 // grouped.
1004 #define TmcValue(tmcG) ((tmcG) & ~ftmcGrouped)
1005 #define FIsGroupTmc(tmc) ((tmc & ftmcGrouped) != fFalse)
1009 ///////////////////////////////////////////////////////////////////////////////
1010 // General objects support.
1012 typedef VOID ** HOBJ_SDM; // A near handle.
1014 #define hobjNull ((HOBJ_SDM) NULL)
1016 typedef struct _gobj
1018 HOBJ_SDM hobjBase; // Handle to base object.
1019 BARG_SDM bArg; // Offset from that object.
1020 } GOBJ; // Reference to any object.
1022 #define GobjToGobj(g1, g2) (g2 = g1)
1024 #define FIsNullGobj(g) ((g).hobjBase == hobjNull && (g).bArg == 0)
1025 #define FIsNullHobjbArg(h, b) ((h) == hobjNull && (b) == 0)
1026 #define PvFromGobj(h, b) \
1027 ((h) == hobjNull ? (VOID *)(b) : *(VOID * *)(h) + (b))
1029 #define FIsEmptyGobj(g) FIsEmptyHobjBArg((g).hobjBase, (g).bArg)
1031 #define FIsEmptyHobjBArg(h, b) ((h) == hobjNull && (b) == 0)
1033 ///////////////////////////////////////////////////////////////////////////////
1034 // Miscellaneous LBOX stuff (for apps that don't include msolbox.h but use the //
1035 // toolbox. //
1036 ///////////////////////////////////////////////////////////////////////////////
1038 typedef struct _LBX * * HLBX;
1040 typedef RECT LBR;
1042 typedef UINT_SDM LBC;
1044 #define LBOX_CALLBACK SDM_CALLBACK
1045 #define LBOX_CALLBACK_NAT SDM_CALLBACK
1048 typedef struct _lbm
1050 HLBX hlbx;
1051 ILBE_SDM cEntryVisible; // Number of entries visible in list
1052 XY_SDM dySmall; // Height of small list
1053 } LBM;
1055 #define cEntryVariable ((ILBE_SDM)0x8000)
1057 #include "msosproc.h"
1060 ///////////////////////////////////////////////////////////////////////////////
1061 // rgtmw allocataion stuff
1062 ///////////////////////////////////////////////////////////////////////////////
1064 // DOUBLE SUPER WARNING - this is a private SDM structure, here only
1065 // because the client has to allocate these things. Use these fields,
1066 // and it's guaranteed you will get broken.
1068 // Sizeof runtime space.
1069 // WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
1070 // This structure is also defined in sdmnat.asm. If you change it here,
1071 // then change it there!!
1072 // WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
1073 typedef U32_SDM FTMW_SDM;
1075 typedef struct _tmw
1077 //WARNING: for 32 bit alignment, the items in this structure must
1078 // be ordered with all 32-bit data before any 16-bit data
1079 // (so the hokey CbRuntimeCtm will work out right)
1081 union
1083 HWND hwnd; // Window handle for edit.
1085 HLBX hlbx; //list
1086 WCHAR * * pwzTitle; // Control text.
1087 UCAB_SDM ibmp; //non-CAB bitmap id
1088 } ctl;
1090 union
1092 GOBJ gobjTitle; // Item title.
1094 GOBJ gobjData; // CAB (or other) data.
1096 REC rec; // Scaled rectangle.
1097 #ifdef DBCS
1098 BYTE bCharSet;
1099 #endif
1100 DWORD himcOld; //Original himc assosiated to edit contorol.
1102 U32_SDM lUser; // User dword
1104 FTMS ftms; // DialogItem state - see list.
1105 FTMS ftmsOld; // Previous state (for buttons).
1106 FTMW_SDM ftmw; // DialogItem flags.
1108 TMC tmc; // iTeM Code.
1109 TMT tmt; // Item type.
1110 UINT_SDM cwVal; // Data size (-1=> var length).
1111 TMC tmcGroup; // tmcNull or TMC of group (for Combo/
1112 // ListBox/RadioButton).
1113 int tcidIcon; // tcid of icon used inside a button
1114 int iWidth; // width of the galley control.
1116 WCHAR *wtzTooltip; // wtz of the tooltip for this item or NULL
1117 int fmtTip; // format of the tip
1119 int cdxText; // Used for caching text dimensions for DAL.
1120 int cdyText; // these are only valid if != TEXT_MEASURE_NOT_CACHED
1121 DWORD grfSDMTextMeasure;
1123 // SDM_PRIVATE
1125 ///////////////////////////////////////////////////////////////////////////////
1126 // -- Private part of TMW_SDM, only used by sdmtmw
1128 // The following 4/5 fields are indices back into the template.
1129 UINT_SDM itmBase; // Index of base tm for item.
1130 /* FMidEast */
1131 U16_SDM itmExt2; // Extension #2 or itmNil.
1132 U16_SDM itmExt3; // Extension #3 or itmNil.
1133 /* FMidEast End */
1134 U16_SDM itmExt4;
1135 UINT_SDM itmTmxdFirst; // First dummy item or itmNil.
1136 UINT_SDM itmTmxiFirst; // First item proc or itmNil or itmUnknown.
1138 WCHAR ch; // Accelerator.
1139 WCHAR ch2; // Kana Accelerator.
1140 BYTE iagData; // CAB index of value.
1141 BYTE fNonseqTmc:1; // => Special or Imported TMC.
1142 BYTE fHandleData:1; // If iagData != iagNil, => if data is
1143 // handle.
1144 BYTE fAction:1; // => call dialog proc.
1145 BYTE fHelp:1; // => wants context help
1146 BYTE fRichEdit :1; //Indicates the genralpicture is for Word's RTE.
1147 BYTE fSpecialTab :1; // => wants the special autocomplete tab behaviour
1148 BYTE fUnused :2;
1149 //SDM_PRIVATE
1150 } TMW_SDM_PRIVATE;
1152 #define CbRuntimeCtm(ctm) ((ctm) * sizeof(TMW_SDM_PRIVATE))
1154 #define iFENone 0
1155 #define iFEJapan 81
1156 #define iFEKorea 82
1157 #define iFETaiwan 886
1158 #define iFEPRChina 86
1160 // Flags that can be passed in as a grf to MsoUPicContainerEx
1161 #define msoupicExtended 0x00000001
1162 #define msoupicNoResize 0x00000002
1164 MSOAPI_(UCBK_SDM SDM_CALLBACK) MsoWPicContainer(HMSOINST pinst,
1165 void **hwndDlg,
1166 TMM tmm, SDMP *psdmp,
1167 UCBK_SDM rsvd2, UCBK_SDM rsvd,
1168 TMC tmc, UCBK_SDM wBtn,
1169 /* PFNFFillPictureContainer */ void *pfnFPC);
1171 MSOAPI_(UCBK_SDM SDM_CALLBACK) MsoUPicContainerEx(HMSOINST pinst,
1172 void **hwndDlg,
1173 TMM tmm, SDMP *psdmp,
1174 UCBK_SDM rsvd2, UCBK_SDM rsvd,
1175 TMC tmc, UCBK_SDM wBtn,
1176 void *pfnFPC, UINT grf);
1178 // Call to set the contexthelp override
1179 MSOAPIX_(void) MsoSetContextOverride(BOOL fContextHelpOverride);
1181 // Call to set the autocomplete function for a dialog.
1182 MSOAPI_(void) MsoSetPfnAutoComplete(/*PFN_AUTOCOMPLETE*/ void *pfnAutoComplete, void *pvData);
1184 // Return the WhatsThis status
1185 MSOAPIX_(int) MsoSDMWhatsThis();
1187 //Following is the private message sent by sdm to edit filter
1188 //it sends unicode string
1189 #define msoWmSdmPrivSetTextMsg (WM_USER+289)
1190 #define msoWmSdmPrivGetTextMsg (WM_USER+290)
1192 #endif //!SDM_INCLUDED Entire file.