Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1346 lines
48 KiB

  1. ////////////////////////////////////////////////////////////////////////////////
  2. //
  3. // UIMISC.H - header for common miscellaneous functions used by the UI
  4. //
  5. //
  6. ////////////////////////////////////////////////////////////////////////////////
  7. #ifndef __UIMISC_H_
  8. #define __UIMISC_H_
  9. #define IDC_TREEVIEW 9010 //These should really be in resource.h
  10. #define IDC_SPLITTER 9011
  11. #define TOOLTIP
  12. #define MAX_DISPLAY_NAME_LENGTH 32
  13. #define MAX_UI_STR 200
  14. #define MAX_BUF_STR 4*MAX_UI_STR
  15. #ifndef WIN16
  16. static LPTSTR g_szWABHelpFileName = TEXT("WAB.HLP");
  17. #else
  18. static LPTSTR g_szWABHelpFileName = TEXT("WAB16.HLP");
  19. #endif
  20. extern const LPTSTR szInternetCallKey;
  21. extern const LPTSTR szCallto;
  22. extern const LPTSTR szCRLF;
  23. extern const LPTSTR szColon;
  24. extern const LPTSTR szTrailingDots;
  25. extern const LPTSTR szArrow;
  26. extern const LPTSTR szBackSlash;
  27. #define IDC_BB_NEW 8080
  28. #define IDC_BB_PROPERTIES 8082
  29. #define IDC_BB_DELETE 8083
  30. #define IDC_BB_FIND 8084
  31. #define IDC_BB_PRINT 8085
  32. #define IDC_BB_ACTION 8086
  33. #define IDC_BB_ADD_TO_ADDRBOOK 8087
  34. // This should not be an enumeration as tbPrint can drop out at
  35. // run-time. Be very careful if you change the order of this
  36. // enumeration - search for all uses of these enumerated values
  37. // first. There is code in ui_abook.c which relies on tbPrint
  38. // being in front of tbAction.
  39. enum _Toolbar
  40. {
  41. tbNew=0,
  42. tbProperties,
  43. tbDelete,
  44. tbFind,
  45. tbPrint,
  46. tbAction, //upto this many on the toolbar
  47. tbAddToWAB,
  48. tbCopy, //these on the context menu
  49. tbPaste,
  50. tbNewEntry,
  51. tbNewGroup,
  52. tbNewFolder,
  53. tbMAX
  54. };
  55. enum _AddressModalDialogState // Used in various forms of modal IAB_ADDRESS dialogs
  56. {
  57. STATE_SELECT_RECIPIENTS = 0,
  58. STATE_PICK_USER,
  59. STATE_BROWSE,
  60. STATE_BROWSE_MODAL
  61. };
  62. // Returned values from our Search Dialog Proc
  63. enum _SearchDialogReturnValues
  64. {
  65. SEARCH_CANCEL=0,
  66. SEARCH_OK,
  67. SEARCH_ERROR,
  68. SEARCH_CLOSE,
  69. SEARCH_USE
  70. };
  71. //#define VCARD
  72. // **** Keep this enum below in sync with the Main menu structure in CoolUI.RC
  73. enum _MainMenuSubMenus
  74. {
  75. idmFile = 0,
  76. idmEdit,
  77. idmView,
  78. idmTools,
  79. idmHelp
  80. };
  81. enum _FileMenu
  82. {
  83. idmNewContact = 0,
  84. idmNewGroup,
  85. idmNewFolder,
  86. idmFSep1,
  87. idmProperties,
  88. idmDelete,
  89. idmFSep2,
  90. idmImport,
  91. idmExport,
  92. idmFSep3,
  93. idmPrint,
  94. idmFSep4,
  95. #ifdef FUTURE
  96. idmFolders,
  97. idmSepFolders,
  98. #endif
  99. idmSwitchUsers,
  100. idmAllContents,
  101. idmFSep5,
  102. idmClose,
  103. idmFileMax,
  104. };
  105. enum _EditMenu
  106. {
  107. idmCopy=0,
  108. idmPaste,
  109. idmESep1,
  110. idmSelectAll,
  111. idmESep2,
  112. // idmProfile,
  113. // idmESep3,
  114. idmFindPeople,
  115. };
  116. enum _ViewMenus
  117. {
  118. idmToolBar=0,
  119. idmStatusBar,
  120. idmGroupsList,
  121. idmSepUI,
  122. idmLargeIcon,
  123. idmSmallIcon,
  124. idmList,
  125. idmDetails,
  126. idmSepListStyle,
  127. idmSortBy,
  128. idmSepSort,
  129. idmRefresh,
  130. idmViewMax,
  131. };
  132. enum _ToolsMenus
  133. {
  134. idmAccounts=0,
  135. idmSepAccounts,
  136. idmOptions,
  137. idsSepOptions,
  138. idmAction,
  139. };
  140. #define WAB_ONEOFF_NOADDBUTTON 0x00000080 // Flag used to surpress AddToWABButton in iAddrBook::Details
  141. #ifdef HM_GROUP_SYNCING
  142. // [PaulHi] Private message to begin a second group synchronization pass to main UI thread
  143. #define WM_USER_SYNCGROUPS WM_USER+102
  144. #endif
  145. // Private message we send to our toolbar container so it can forward it to
  146. // the toolbar.
  147. #define WM_PRVATETOOLBARENABLE WM_USER+101
  148. //////////////////////////////////////////////////////////////////////////////
  149. //
  150. // IMPORTANT NOTE: If you change this, you must change lprgAddrBookColHeaderIDs in
  151. // globals.c!
  152. //
  153. enum _AddrBookColumns
  154. {
  155. colDisplayName=0,
  156. colEmailAddress,
  157. colOfficePhone,
  158. colHomePhone,
  159. NUM_COLUMNS
  160. };
  161. //////////////////////////////////////////////////////////////////////////////
  162. //
  163. // This structure is used for storing the address book position and column sizes
  164. // in the registry for persistence
  165. //
  166. typedef struct _AddressBookPosColSize
  167. {
  168. RECT rcPos;
  169. int nColWidth[NUM_COLUMNS];
  170. BOOL bViewToolbar;
  171. DWORD dwListViewStyle;
  172. int nListViewStyleMenuID;
  173. BOOL bViewStatusBar;
  174. int colOrderArray[NUM_COLUMNS];
  175. BOOL bViewGroupList;
  176. int nTab;
  177. int nTViewWidth;
  178. } ABOOK_POSCOLSIZE, * LPABOOK_POSCOLSIZE;
  179. //////////////////////////////////////////////////////////////////////////////
  180. extern const TCHAR *g_rgszAdvancedFindAttrs[];
  181. /////////////////////////////////////////////////////////////////////////////
  182. // This represents all the listview boxes in the UI
  183. // Using these tags we can customize the context sensitive menus
  184. // in one sub routine saving code duplication ...
  185. /////////////////////////////////////////////////////////////////////////////
  186. enum _AllTheListViewBoxes
  187. {
  188. lvMainABView = 0,
  189. lvDialogABContents, // Modeless address view LV
  190. lvDialogModalABContents, // Modal addres vuew LV
  191. lvDialogABTo, // To Well LV
  192. lvDialogABCC, // CC Well LV
  193. lvDialogABBCC, // BCC Well LV
  194. lvDialogDistList, // Disttribution list UI LV
  195. lvDialogResolve, // Resolve dialog LV
  196. lvDialogFind, // Find dialog results LV
  197. lvMainABTV, // TreeView in main AB
  198. lvToolBarAction,
  199. lvToolBarNewEntry,
  200. #ifdef COLSEL_MENU
  201. lvMainABHeader, // column selection viewin main AB
  202. #endif // COLSEL_MENU
  203. };
  204. /////////////////////////////////////////////////////////////////////////////
  205. // These are indexes into the bitmaps to show the little bitmap
  206. // next to each entry - this has to be synchronized with the bmps
  207. /////////////////////////////////////////////////////////////////////////////
  208. enum _ListViewImages
  209. {
  210. imageMailUser=0, //Common to small and large imagelists
  211. imageDistList,
  212. imageSortDescending,
  213. imageSortAscending,
  214. imageDirectoryServer,
  215. imageUnknown,
  216. imageMailUserLDAP,
  217. imageAddressBook,
  218. imageMailUserWithCert,
  219. imageMailUserMe,
  220. imageFolderClosed,
  221. imageFolderOpen,
  222. imageMailUserOneOff,
  223. imageMax
  224. };
  225. //
  226. // cellwidth of LV image lists
  227. //
  228. #define S_BITMAP_WIDTH 16
  229. #define S_BITMAP_HEIGHT 16
  230. #define L_BITMAP_WIDTH 32
  231. #define RGB_TRANSPARENT (COLORREF)0x00FF00FF
  232. //
  233. // UI control spacing - TBD confirm these numbers
  234. //
  235. #define BORDER 3 //pixels
  236. #define CONTROL_SPACING 3
  237. // UI Refresh timer defines
  238. #define WAB_REFRESH_TIMER 14 // timer identifier
  239. #define WAB_REFRESH_TIMEOUT 4000 // time-out value - 4 seconds
  240. /////////////////////////////////////////////////////////////////////////////
  241. // LDAP_SEARCH_PARAMS - specifies parameters for LDAP searches
  242. /////////////////////////////////////////////////////////////////////////////
  243. enum _LDAPSearch
  244. {
  245. ldspDisplayName,
  246. ldspEmail,
  247. ldspAddress,
  248. ldspPhone,
  249. ldspOther,
  250. ldspMAX
  251. };
  252. typedef struct _LDAPSearchParams
  253. {
  254. LPADRBOOK lpIAB;
  255. TCHAR szContainerName[MAX_UI_STR];
  256. TCHAR szData[ldspMAX][MAX_UI_STR];
  257. BOOL bUseOtherBase;
  258. } LDAP_SEARCH_PARAMS, * LPLDAP_SEARCH_PARAMS;
  259. /////////////////////////////////////////////////////////////////////////////
  260. // Stores info about each entry in the list view control
  261. // Each entry in the list view controls has 1 structure corresponding to that
  262. // entry
  263. /////////////////////////////////////////////////////////////////////////////
  264. typedef struct _RecipientInfo
  265. {
  266. ULONG cbEntryID;
  267. LPENTRYID lpEntryID;
  268. TCHAR szDisplayName[MAX_DISPLAY_NAME_LENGTH];//The actual text that is displayed
  269. // LPTSTR szDisplayName;
  270. TCHAR szEmailAddress[MAX_DISPLAY_NAME_LENGTH];
  271. TCHAR szHomePhone[MAX_DISPLAY_NAME_LENGTH];
  272. TCHAR szOfficePhone[MAX_DISPLAY_NAME_LENGTH];
  273. TCHAR szByLastName[MAX_DISPLAY_NAME_LENGTH]; // Stores the text preloaded by last name first
  274. TCHAR szByFirstName[MAX_DISPLAY_NAME_LENGTH];// Stores preloaded DisplayName
  275. ULONG ulRecipientType;
  276. ULONG ulObjectType;
  277. BOOL bHasCert;
  278. BOOL bIsMe;
  279. ULONG ulOldAdrListEntryNumber; //if this was an element passed into the Address lpAdrList
  280. //we store its original AdrList index here so that we dont
  281. //have to do inefficient searches later ...
  282. // ***VERY IMPORTANT*** Legal values range from 1 to AdrList->cValues (not from 0)
  283. LPTSTR lpByRubyFirstName;
  284. LPTSTR lpByRubyLastName;
  285. struct _RecipientInfo * lpNext;
  286. struct _RecipientInfo * lpPrev;
  287. } RECIPIENT_INFO, * LPRECIPIENT_INFO;
  288. //////////////////////////////////////////////////////////////////////////////
  289. // Hack structure used for talking between the Find dialog and the select
  290. // recipients dialog
  291. //////////////////////////////////////////////////////////////////////////////
  292. typedef struct _AdrParmFindInfo
  293. {
  294. LPADRPARM lpAdrParms;
  295. LPRECIPIENT_INFO * lppTo;
  296. LPRECIPIENT_INFO * lppCC;
  297. LPRECIPIENT_INFO * lppBCC;
  298. int DialogState; // identifies where it was called from
  299. int nRetVal; // return code identifies what action closed the dialog
  300. LPENTRYID lpEntryID;
  301. ULONG cbEntryID;
  302. } ADRPARM_FINDINFO, * LPADRPARM_FINDINFO;
  303. //////////////////////////////////////////////////////////////////////////////
  304. //////////////////////////////////////////////////////////////////////////////
  305. // A structure that will contain the LDAP URL subparts ...
  306. typedef struct _LDAPURL
  307. {
  308. LPTSTR lpszServer; // Server name
  309. LPTSTR lpszBase; // Base <dn>
  310. LPTSTR * ppszAttrib; // Attributes requested
  311. ULONG ulAttribCount; //
  312. ULONG ulScope; // Search scope
  313. LPTSTR lpszFilter; // search filter
  314. LPTSTR lpszExtension; // And extension part of the URL
  315. LPTSTR lpszBindName; // A bindname extension for the URL
  316. BOOL bServerOnly; // Only found a server entry
  317. DWORD dwAuthType; // Authentication Type
  318. LPRECIPIENT_INFO lpList;// used to cache multple query results
  319. } LDAPURL, * LPLDAPURL;
  320. //////////////////////////////////////////////////////////////////////////////
  321. /////////////////////////////////////////////////////////////////////////////
  322. // This structure holds information about
  323. // the sort order of a particular list view
  324. /////////////////////////////////////////////////////////////////////////////
  325. typedef struct _SortInfo
  326. {
  327. int iOldSortCol;
  328. int iOlderSortCol;
  329. BOOL bSortAscending;
  330. BOOL bSortByLastName;
  331. } SORT_INFO, *LPSORT_INFO;
  332. /////////////////////////////////////////////////////////////////////////////
  333. // We will subclass some of the child controls on the main Address Book View to
  334. // enable tabbing between the controls - the following
  335. // are used in this subclassing
  336. /////////////////////////////////////////////////////////////////////////////
  337. enum _SubClassedControlIndexs
  338. {
  339. s_EditQF=0,
  340. s_ListAB,
  341. s_TV,
  342. s_Max
  343. };
  344. typedef struct _ToolTipInfo
  345. {
  346. int iItem;
  347. BOOL bActive;
  348. TCHAR szTipText[MAX_BUF_STR];
  349. UINT_PTR uTooltipTimer;
  350. BOOL bShowTooltip;
  351. } TOOLTIP_INFO, * LPTOOLTIPINFO;
  352. typedef struct _TVItemStuff
  353. {
  354. ULONG ulObjectType;
  355. LPSBinary lpsbEID;
  356. LPSBinary lpsbParent;
  357. HTREEITEM hItemParent;
  358. } TVITEM_STUFF, * LPTVITEM_STUFF;
  359. // There may be several property sheets in the final version of the details pane
  360. // Each list will have a seperate set of controls corresponding to different properties
  361. // We want to retrieve the control values and map them into a property-array
  362. // Each dialog will create its own proparray on exiting. The original record will also
  363. // have some properties that never got mapped in the first place and some which may have been
  364. // deleted thru the ui. Hence we look at the old array and the new array and create a merged
  365. // list of props ... all mapped props in the new arrays superscede props in the
  366. // old array
  367. enum _PropSheets{ propSummary = 0,
  368. propPersonal, // a list of all the property sheets on this page
  369. propHome,
  370. propBusiness,
  371. propNotes,
  372. propConferencing,
  373. propCert,
  374. propOrg,
  375. propTrident,
  376. propFamily,
  377. TOTAL_PROP_SHEETS
  378. };
  379. enum _DLPropSheets{ propGroup = 0,
  380. propGroupOther,
  381. propDLMax
  382. };
  383. enum _DetailsDialogReturnValues
  384. {
  385. DETAILS_RESET = 0, //blank return value
  386. DETAILS_OK,
  387. DETAILS_CANCEL,
  388. DETAILS_ADDTOWAB
  389. };
  390. enum
  391. {
  392. contactHome=0,
  393. contactBusiness,
  394. groupOther,
  395. contactPersonal,
  396. };
  397. //////////////////////////////////////////////////////////////////////////////
  398. //
  399. // The PropArrayInfo is used by the property sheets displaying details on
  400. // contacts or groups
  401. //
  402. //////////////////////////////////////////////////////////////////////////////
  403. // Misc flags used here
  404. #define DETAILS_DNisCompanyName 0x00000001
  405. #define DETAILS_DNisNickName 0x00000002
  406. #define DETAILS_DNisFMLName 0x00000004
  407. #define DETAILS_UseRubyPersonal 0x00000008 // Determines if the displayed prop sheet is a RUBY one for Japan/China/Korea
  408. #define DETAILS_Initializing 0x00000010 // Prevents WM_COMMAND triggers during initialization
  409. #define DETAILS_ProgChange 0x00000020 // Diffrentiates between changes in Display Name caused by user and by other parts of the code
  410. #define DETAILS_EditingEmail 0x00000040 // So we can abort the email editing if user cancels
  411. #define DETAILS_HideAddToWABButton 0x00000080 // Hides the add-to-wab button for some one-offs
  412. #define DETAILS_ShowCerts 0x00000100 // Decides whether or not to show certs UI
  413. #define DETAILS_ShowTrident 0x00000200 // Decides whether or not to show Trident in UI
  414. #define DETAILS_ShowNetMeeting 0x00000400 // Decides whether or not to show Netmeeting stuff
  415. #define DETAILS_ShowOrg 0x00000800 // Decides whether or not to show Org UI
  416. #define DETAILS_EditingConf 0x00001000 // Tracks if editing a server/email pair
  417. #define DETAILS_ShowSummary 0x00002000 // Decides whether or not to present summary information
  418. #define DETAILS_EditingOneOff 0x00004000 // Tracks if editing a group one-off
  419. #define DETAILS_DefHomeChanged 0x00008000 // Used to track changes in non-Edit controls on the Home prop sheets
  420. #define DETAILS_DefBusChanged 0x00010000 // Used to track changes in non-Edit controls on the Business prop sheets
  421. #define DETAILS_GenderChanged 0x00020000 // Used to track changes in Gender
  422. #define DETAILS_DateChanged 0x00040000 // Used to track changes in Date-Time fields
  423. #define DETAILS_ChildrenChanged 0x00080000 // Used to track changes in PR_CHILDRENS_NAMES
  424. #define DETAILS_EditingChild 0x00100000 // Tracks if we're in the middle of editing a children name
  425. typedef struct _PropArrayInfo
  426. {
  427. ULONG cbEntryID; // Entryid of this item
  428. LPENTRYID lpEntryID;
  429. ULONG ulOperationType; // SHOW_DETAILS or SHOW_NEW_ENTRY
  430. ULONG ulObjectType; // MAILUSER or DISTLIST
  431. LPMAPIPROP lpPropObj; // Actual object we are displaying
  432. int nRetVal;
  433. BOOL bSomethingChanged; // flags changes so we dont waste processing
  434. BOOL bPropSheetOpened[TOTAL_PROP_SHEETS];
  435. ULONG ulFlags;
  436. HWND hWndDisplayNameField; // Holds HWND of DN edit field
  437. int ulTridentPageIndex; // index of the trident sheet in case we need to remove it
  438. LPADRBOOK lpIAB;
  439. LPIWABDOCHOST lpIWABDocHost;
  440. int nDefaultServerIndex;
  441. int nBackupServerIndex;
  442. LPTSTR szDefaultServerName; // LocalAlloc storage for these and then free them later ..
  443. ULONG cchDefaultServerName;
  444. LPTSTR szBackupServerName;
  445. ULONG cchBackupServerName;
  446. int nConfEditIndex;
  447. SBinary sbDLEditingOneOff;
  448. HWND hWndComboConf;
  449. LPRECIPIENT_INFO lpContentsList; // Used by groups only for member lists
  450. LPCERT_ITEM lpCItem; // Keeps a list of all our cert items ...
  451. int nPropSheetPages; // Total number of propsheets for this item
  452. HPROPSHEETPAGE * lphpages; // An array of all the prop sheets created for this item
  453. LPWABEXTDISPLAY lpWED; // Stores info about extended prop sheets
  454. LPEXTDLLINFO lpExtList; // List of shell extension objects
  455. LPTSTR lpLDAPURL; // Points to the LDAP URL, if any, being displayed
  456. BOOL bIsNTDSURL; // True if the LDAP URL represents an object from an NTDS
  457. LPTSTR lpszOldName; // used for caching the old name of the prop being displayed
  458. int nNTDSPropSheetPages; // Tracks the number of NTDS PropSheet extensions
  459. HPROPSHEETPAGE * lphNTDSpages; // We cache the NTDS extension prop pages seperately since we may need to replace out own pages with these
  460. GUID guidExt; // Used while creating prop sheet extensions for identifying the appropriate extension
  461. } PROP_ARRAY_INFO, * LPPROP_ARRAY_INFO;
  462. #define DL_INFO PROP_ARRAY_INFO
  463. #define LPDL_INFO LPPROP_ARRAY_INFO
  464. //
  465. // The following structure is used to cache various data associated with the
  466. // main browse UI for the WAB
  467. //
  468. typedef struct _tabBrowseWindowInfo
  469. {
  470. // Following are used in ui_abook.c in the main ui
  471. HWND hWndListAB; // Handle of main list view
  472. HWND hWndBB; // Handle of Button Bar
  473. HWND hWndEditQF;
  474. HWND hWndStaticQF;
  475. HWND hWndAB; // Handle of the Address Book Window
  476. HWND hWndSB; // Status bar
  477. int iFocus; // Tracks who has the focus
  478. LPRECIPIENT_INFO lpContentsList;
  479. LPADRBOOK lpAdrBook; // Hangs on to AdrBook object
  480. LPIAB lpIAB; // Internal version of AdrBook object
  481. WNDPROC fnOldProc[s_Max]; // Subclass some of the control procs
  482. HWND s_hWnd[s_Max]; // HWNDS of subclasses controls
  483. LPFNDISMISS lpfnDismiss;// Context for dismissing in the case of modeless IAdrBook window
  484. LPVOID lpvDismissContext; // Dismiss context as above
  485. HWND hWndTools; // handle of the toolbar window
  486. SORT_INFO SortInfo; // Sort Info
  487. #ifdef TOOLBAR_BACK
  488. HBITMAP hbmBack; // handle of the toolbar background
  489. HPALETTE hpalBkgnd; // handle of the toolbar background palette
  490. #endif
  491. HWND hWndTT; // Tooltip control info in ui_abook.c
  492. TOOLTIP_INFO tti;
  493. BOOL bDoQuickFilter;
  494. // bobn: brianv says we have to take this out...
  495. //int nCount;
  496. // Used to override automatic notification-fueled refreshes
  497. BOOL bDontRefreshLV;
  498. // Related to Treeview in ui_Abook.c
  499. HWND hWndTV;
  500. HWND hWndSplitter;
  501. // Related to drag and drop
  502. LPIWABDRAGDROP lpIWABDragDrop;
  503. // Related to Notifications and updates
  504. LPMAPIADVISESINK lpAdviseSink;
  505. ULONG ulAdviseConnection;
  506. BOOL bDeferNotification; // Used to defer next notification request
  507. HTREEITEM hti; //used for caching rt-click items for treeview
  508. LPWABFOLDER lpUserFolder; // Used only to mark the User-Folder being rt-clicked
  509. #ifdef COLSEL_MENU
  510. ULONG iSelColumn; // Used for Column Selection caching
  511. #endif
  512. } BWI, * LPBWI;
  513. #define bwi_lpUserFolder lpbwi->lpUserFolder
  514. #define bwi_hti lpbwi->hti
  515. #define bwi_hWndListAB lpbwi->hWndListAB
  516. #define bwi_hWndBB lpbwi->hWndBB
  517. #define bwi_hWndSB lpbwi->hWndSB
  518. #define bwi_bDoQuickFilter lpbwi->bDoQuickFilter
  519. // bobn: brianv says we have to take this out...
  520. //#define bwi_nCount lpbwi->nCount
  521. #define bwi_bDeferNotification lpbwi->bDeferNotification
  522. #define bwi_SortInfo lpbwi->SortInfo
  523. #define bwi_hWndTT lpbwi->hWndTT
  524. #define bwi_tt_iItem ((lpbwi->tti).iItem)
  525. #define bwi_tt_bActive lpbwi->tti.bActive
  526. #define bwi_tt_szTipText ((lpbwi->tti).szTipText)
  527. #define bwi_tt_TooltipTimer ((lpbwi->tti).uTooltipTimer)
  528. #define bwi_tt_bShowTooltip ((lpbwi->tti).bShowTooltip)
  529. #define bwi_hWndTV (lpbwi->hWndTV)
  530. #define bwi_hWndSplitter (lpbwi->hWndSplitter)
  531. #define bwi_hWndEditQF lpbwi->hWndEditQF
  532. #define bwi_hWndStaticQF lpbwi->hWndStaticQF
  533. #define bwi_hWndAB lpbwi->hWndAB
  534. #define bwi_iFocus lpbwi->iFocus
  535. #define bwi_lpIAB (lpbwi->lpIAB)
  536. #define bwi_lpAdrBook (lpbwi->lpAdrBook)
  537. #define bwi_fnOldProc (lpbwi->fnOldProc)
  538. #define bwi_s_hWnd (lpbwi->s_hWnd)
  539. #define bwi_lpContentsList (lpbwi->lpContentsList)
  540. #define bwi_lpfnDismiss (lpbwi->lpfnDismiss)
  541. #define bwi_lpvDismissContext (lpbwi->lpvDismissContext)
  542. #define bwi_hWndTools (lpbwi->hWndTools)
  543. #ifdef TOOLBAR_BACK
  544. #define bwi_hbmBack (lpbwi->hbmBack)
  545. #define bwi_hpalBkgnd (lpbwi->hpalBkgnd)
  546. #endif
  547. #define bwi_bDontRefreshLV (lpbwi->bDontRefreshLV)
  548. #define bwi_lpIWABDragDrop (lpbwi->lpIWABDragDrop)
  549. #define bwi_lpAdviseSink (lpbwi->lpAdviseSink)
  550. #define bwi_ulAdviseConnection (lpbwi->ulAdviseConnection)
  551. /////////////////////////////////////////////////////////////////////////////
  552. // Each thread can generate a different Address Book window .. need to
  553. // keep the data thread safe ...
  554. /////////////////////////////////////////////////////////////////////////////
  555. typedef struct _tagPerThreadGlobalData
  556. {
  557. // Persistent search params
  558. LDAP_SEARCH_PARAMS LDAPsp;// Search parameters for LDAP
  559. LPADRBOOK lpIAB;
  560. HACCEL hAccTable; // Accelerator TAble
  561. HWND hWndFind; // hWnd of Find dialog so LDAP cancel dialog has a parent
  562. HWND hDlgCancel; // hWnd of the Cancel dialog
  563. BOOL bDontShowCancel; // Dont show the cancel dialog when the find is launched ...
  564. // Used in print dialog
  565. BOOL bPrintUserAbort;
  566. HWND hWndPrintAbortDlg;
  567. // Tracks if this is an OpenExSession
  568. BOOL bIsWABOpenExSession;
  569. BOOL bIsUnicodeOutlook; // Tracks if this WAB supports Unicode in which case we don't need to do Unicode conversions for it
  570. #ifdef HM_GROUP_SYNCING
  571. LPTSTR lptszHMAccountId; // Keeps Hotmail syncing account ID across two synchronization passes.
  572. #endif
  573. BOOL bDisableParent;
  574. // Tracks first run for Directory Service modification
  575. BOOL bFirstRun;
  576. // Default Platform/Dialog Font
  577. HFONT hDefFont;
  578. HFONT hDlgFont;
  579. // Caches a cookie for LDAP paged results
  580. struct berval * pCookie;
  581. } PTGDATA, * LPPTGDATA;
  582. #define pt_hDefFont (lpPTGData->hDefFont)
  583. #define pt_hDlgFont (lpPTGData->hDlgFont)
  584. #define pt_pCookie (lpPTGData->pCookie)
  585. #define pt_LDAPsp (lpPTGData->LDAPsp)
  586. #define pt_hWndFind lpPTGData->hWndFind
  587. #define pt_hDlgCancel lpPTGData->hDlgCancel
  588. #define pt_bDontShowCancel lpPTGData->bDontShowCancel
  589. #define pt_bPrintUserAbort (lpPTGData->bPrintUserAbort)
  590. #define pt_hWndPrintAbortDlg (lpPTGData->hWndPrintAbortDlg)
  591. #define pt_bIsWABOpenExSession (lpPTGData->bIsWABOpenExSession)
  592. #define pt_bIsUnicodeOutlook (lpPTGData->bIsUnicodeOutlook)
  593. #define pt_bDisableParent (lpPTGData->bDisableParent)
  594. #define pt_bFirstRun (lpPTGData->bFirstRun)
  595. #define pt_lpIAB (lpPTGData->lpIAB)
  596. #define pt_hAccTable (lpPTGData->hAccTable)
  597. // This is a global
  598. DWORD dwTlsIndex; // index for private thread storage
  599. // for COLSEL_MENU stuff
  600. #ifdef COLSEL_MENU
  601. extern const ULONG MenuToPropTagMap[];
  602. #endif // COLSEL_MENU
  603. /**** MISC UI FUNCTIONS ****/
  604. // Gets a threads storage pointer or creates a new one if none found
  605. LPPTGDATA __fastcall GetThreadStoragePointer();
  606. //This function frees up RECIPIENT_INFO structures
  607. void FreeRecipItem(LPRECIPIENT_INFO * lppItem);
  608. // This function loads a string and allocates space for it.
  609. LPTSTR LoadAllocString(int StringID);
  610. // This function initializes a list view
  611. HRESULT HrInitListView( HWND hWndLV, // List view hWnd
  612. DWORD dwStyle, // Style
  613. BOOL bShowHeaders); // Hide or show column headers
  614. // This function fills a list view from a contents list
  615. HRESULT HrFillListView( HWND hWndLV,
  616. LPRECIPIENT_INFO lpContentsList);
  617. // Call to create main view to address book
  618. HWND hCreateAddressBookWindow( LPADRBOOK lpIAB,
  619. HWND hWndParent,
  620. LPADRPARM lpszCaption);
  621. // Creates a ContentsList from the property store
  622. HRESULT HrGetWABContentsList( LPIAB lpIAB,
  623. SORT_INFO SortInfo,
  624. LPSPropTagArray lpPTA,
  625. LPSPropertyRestriction lpPropRes,
  626. ULONG ulFlags,
  627. LPSBinary lpsbContainer,
  628. BOOL bGetProfileContents,
  629. LPRECIPIENT_INFO * lppContentsList);
  630. #define LDAP_USE_ADVANCED_FILTER 0x04000000 // completely made up flag
  631. // for passing a advanced filter
  632. // to the LDAP_FindRow
  633. // Creates ContentsList from an LDAP container
  634. HRESULT HrGetLDAPContentsList( LPADRBOOK lpIAB,
  635. ULONG cbContainerEID,
  636. LPENTRYID lpContainerEID,
  637. SORT_INFO SortInfo,
  638. LPSRestriction lpPropRes,
  639. LPTSTR lpAdvFilter,
  640. LPSPropTagArray lpPTA,
  641. ULONG ulFlags,
  642. LPRECIPIENT_INFO * lppContentsList);
  643. // Trims leading and trailing spaces from strings
  644. BOOL TrimSpaces(TCHAR * szBuf);
  645. // Sort Call Back funciton for list views
  646. int CALLBACK ListViewSort( LPARAM lParam1,
  647. LPARAM lParam2,
  648. LPARAM lParamSort);
  649. // Retrieves the HWND for a list view column header
  650. //HWND GetListViewColumnHeader(HWND hWndLV, DWORD dwPos);
  651. // Paints bmps onto list view column headers
  652. void SetColumnHeaderBmp( HWND hWndLV,
  653. SORT_INFO SortInfo);
  654. // Returns TRUE if the current viewed container is the PAB
  655. BOOL CurrentContainerIsPAB(HWND hWndCombo);
  656. // Cleans up the list view and releases the contents list
  657. void ClearListView( HWND hWndLV,
  658. LPRECIPIENT_INFO * lppContentsList);
  659. // Deletes the selected items from a list view control and the property store
  660. void DeleteSelectedItems( HWND hWndLV,
  661. LPADRBOOK lpIAB,
  662. HANDLE hPropertyStore,
  663. LPFILETIME lpftLast);
  664. // Calls properties on a list view item
  665. HRESULT HrShowLVEntryProperties( HWND hWndLV,
  666. ULONG ulFlags,
  667. LPADRBOOK lpIAB,
  668. LPFILETIME lpftLast);
  669. // Exports list view items to vCard files
  670. HRESULT VCardExportSelectedItems(HWND hWndLV,
  671. LPADRBOOK lpIAB);
  672. // Imports vCard file to property store
  673. HRESULT VCardImport(HWND hWnd, LPADRBOOK lpIAB, LPTSTR szVCardFile, LPSPropValue * lppProp);
  674. // Selects the specified list view item
  675. void LVSelectItem( HWND hWndList,
  676. int iItemIndex);
  677. // Given an entryid, reads a single item from the store and creates a list view item
  678. BOOL ReadSingleContentItem( LPADRBOOK lpIAB,
  679. ULONG cbEntryID,
  680. LPENTRYID lpEntryID,
  681. LPRECIPIENT_INFO * lppItem);
  682. // Converts an lpPropArray into a LPRECIPIENT_INFO item
  683. void GetRecipItemFromPropArray( ULONG ulcPropCount,
  684. LPSPropValue rgPropVals,
  685. LPRECIPIENT_INFO * lppItem);
  686. // Inserts a single RecipientInfo item into a list view
  687. void AddSingleItemToListView( HWND hWndLV,
  688. LPRECIPIENT_INFO lpItem);
  689. // Higher level function that takes a WAB entryid and puts it in the list view
  690. // Calls most of the above functions (this function assumes caller has checked that
  691. // the entryid is a valid wab entryid
  692. BOOL AddWABEntryToListView( LPADRBOOK lpIAB,
  693. HWND hWndLV,
  694. ULONG cbEID,
  695. LPENTRYID lpEID,
  696. LPRECIPIENT_INFO * lppContentsList);
  697. // Called by the NewContact menu items or buttons
  698. HRESULT AddNewObjectToListViewEx( LPADRBOOK lpIAB,
  699. HWND hWndLV,
  700. HWND hWndTV,
  701. HTREEITEM hSelItem,
  702. LPSBinary lpsbContEID,
  703. ULONG ulObjectType,
  704. SORT_INFO * lpSortInfo,
  705. LPRECIPIENT_INFO * lppContentsList,
  706. LPFILETIME lpftLast,
  707. LPULONG lpcbEID,
  708. LPENTRYID * lppEID);
  709. HRESULT AddEntryToContainer(LPADRBOOK lpIAB,
  710. ULONG ulObjType, //MAPI_DISTLIST or MAPI_ABCONT
  711. ULONG cbGroupEntryID,
  712. LPENTRYID lpGroupEntryID,
  713. DWORD cbEID,
  714. LPENTRYID lpEID);
  715. // Customizes and displays the context menu for various list views in the UI
  716. int ShowLVContextMenu(int LV, // idicates which list view this is
  717. HWND hWndLV,
  718. HWND hWndCombo,
  719. LPARAM lParam, // contains the mouse pos info when called from WM_CONTEXTMENU
  720. LPVOID lpVoid, //misc stuff we want to pass in
  721. LPADRBOOK lpIAB, HWND hWndTV);
  722. // Gets the child's coordinates in client units
  723. void GetChildClientRect( HWND hWndChild,
  724. LPRECT lprc);
  725. // Finds the item in the LV matching the text in the EditBox
  726. void DoLVQuickFind(HWND hWndEdit, HWND hWndLV);
  727. // Does string searching of one within the other
  728. BOOL SubstringSearch(LPTSTR pszTarget, LPTSTR pszSearch);
  729. // Gets the props from a object
  730. HRESULT HrGetPropArray( LPADRBOOK lpIAB,
  731. LPSPropTagArray lpPTA,
  732. ULONG cbEntryID,
  733. LPENTRYID lpEntryID,
  734. ULONG ulFlags,
  735. ULONG * lpcValues,
  736. LPSPropValue * lppPropArray);
  737. // Calls CreateEntry for a new mailuser/distlist ...
  738. HRESULT HrCreateNewEntry( LPADRBOOK lpIAB, //AdrBook Object
  739. HWND hWndParent, //Hwnd for dialog
  740. ULONG ulCreateObjectType, //MAILUSER or DISTLIST
  741. ULONG cbEIDContainer,
  742. LPENTRYID lpEIDContainer,
  743. ULONG ulContObjectType,
  744. ULONG ulFlags,
  745. BOOL bShowBeforeAdding,
  746. ULONG cValues,
  747. LPSPropValue lpPropArray,
  748. ULONG *lpcbEntryID,
  749. LPENTRYID *lppEntryID );
  750. HRESULT HrGetWABTemplateID( LPADRBOOK lpIAB,
  751. ULONG ulObjectType,
  752. ULONG * lpcbEID,
  753. LPENTRYID * lppEID);
  754. BOOL CheckForCycle( LPADRBOOK lpAdrBook,
  755. LPENTRYID lpEIDChild,
  756. ULONG cbEIDChild,
  757. LPENTRYID lpEIDParent,
  758. ULONG cbEIDParent); //from distlist.c
  759. // Used for sorting columns in various list views ...
  760. void SortListViewColumn( LPIAB lpIAB,
  761. HWND hWndLV, //ListView Handle
  762. int iSortCol, //Column to sort by
  763. LPSORT_INFO lpSortInfo,
  764. BOOL bUseCurrentSettings); // Sort Info structre specific for each dialog
  765. // Used for storing sort info for persistence between sessions.
  766. BOOL ReadRegistrySortInfo(LPIAB lpIAB, LPSORT_INFO lpSortInfo);
  767. BOOL WriteRegistrySortInfo(LPIAB lpIAB, SORT_INFO SortInfo);
  768. // Constructs a localized display name from individual pieces
  769. BOOL SetLocalizedDisplayName(
  770. LPTSTR lpszFirstName,
  771. LPTSTR lpszMiddleName,
  772. LPTSTR lpszLastName,
  773. LPTSTR lpszCompanyName,
  774. LPTSTR lpszNickName,
  775. LPTSTR * lppszBuf,
  776. ULONG ulszBuf,
  777. BOOL bDNbyLN,
  778. LPTSTR lpTemplate,
  779. LPTSTR * lppszRetBuf);
  780. // Callback for setting all the children windows to default GUI font ..
  781. #define PARENT_IS_DIALOG 0 // We treat dialog children differently from window children
  782. #define PARENT_IS_WINDOW 1 // so need these LPARAM values to differentiate..
  783. STDAPI_(BOOL) SetChildDefaultGUIFont(HWND hWndChild, LPARAM lParam);
  784. // Used for populating the Combo box with LDAP server names ...
  785. HRESULT PopulateContainerList( LPADRBOOK lpIAB,
  786. HWND hWndLV,
  787. LPTSTR lpszSelection,
  788. LPTSTR lptszPreferredSelection);
  789. // Used for freeing the associated structure in each container List Views
  790. void FreeLVItemParam(HWND hWndLV);
  791. // Gets the EntryID of the current container ...
  792. void GetCurrentContainerEID(HWND hWndLV,
  793. LPULONG lpcbContEID,
  794. LPENTRYID * lppContEID);
  795. // Shows the LDAP search dialog and creates a restriction
  796. HRESULT HrShowSearchDialog(LPADRBOOK lpIAB,
  797. HWND hWndParent,
  798. LPADRPARM_FINDINFO lpAPFI,
  799. LPLDAPURL lplu,
  800. LPSORT_INFO lpSortInfo);
  801. // Gets contents from an LDAP search and container
  802. HRESULT HrSearchAndGetLDAPContents(
  803. LDAP_SEARCH_PARAMS LDAPsp,
  804. LPTSTR lpAdvFilter,
  805. HWND hWndList,
  806. LPADRBOOK lpIAB,
  807. SORT_INFO SortInfo,
  808. LPRECIPIENT_INFO * lppContentsList);
  809. // Gets contents from a WAB local store container
  810. HRESULT HrGetWABContents( HWND hWndList,
  811. LPADRBOOK lpIAB,
  812. LPSBinary lpsbContainer,
  813. SORT_INFO SortInfo,
  814. LPRECIPIENT_INFO * lppContentsList);
  815. // Shows UI to modify current list of servers
  816. HRESULT HrShowDirectoryServiceModificationDlg(HWND hWndParent, LPIAB lpIAB);
  817. // Creates a new blank mailuser object
  818. HRESULT HrCreateNewObject(LPADRBOOK lpIAB,
  819. LPSBinary lpsbContainer,
  820. ULONG ulObjectType,
  821. ULONG ulFlags,
  822. LPMAPIPROP * lppPropObj);
  823. // Generic message box displayer ...
  824. int ShowMessageBox(HWND hWndParent, int MsgId, int ulFlags);
  825. int __cdecl ShowMessageBoxParam(HWND hWndParent, int MsgId, int ulFlags, ...);
  826. // atoi converter
  827. int my_atoi(LPTSTR lpsz);
  828. // Reads the default registry LDAP country name
  829. BOOL ReadRegistryLDAPDefaultCountry(LPTSTR szCountry, DWORD cchCountry, LPTSTR szCountryCode, DWORD cchCountryCode);
  830. #ifdef OLD_STUFF
  831. // Fills a drop down list with the LDAP country names
  832. void FillComboLDAPCountryNames(HWND hWndCombo);
  833. // Writes the defaule country name to the registry
  834. BOOL WriteRegistryLDAPDefaultCountry(LPTSTR szCountry);
  835. #endif //OLD_STUFF
  836. // Looks at Combo and ListView and determines which options to enable or disable
  837. void GetCurrentOptionsState(HWND hWndCombo,
  838. HWND hWndLV,
  839. LPBOOL lpbState);
  840. // Adds selected LDAP items to the Address Book
  841. HRESULT HrAddToWAB( LPADRBOOK lpIAB,
  842. HWND hWndLV,
  843. LPFILETIME lpftLast);
  844. // Coolbar creating function ...
  845. HWND CreateCoolBar(LPBWI lpbwi, HWND hwndParent);
  846. // Directory Services Proeprties property sheet
  847. HRESULT HrShowDSProps(HWND hWndParent,LPTSTR ptszAcct, LPTSTR *pptszName, BOOL bAddNew);
  848. // Saves the modeless dialog size and position to registry for persistence
  849. BOOL WriteRegistryPositionInfo(LPIAB lpIAB, LPABOOK_POSCOLSIZE lpABPosColSize, LPTSTR szKey);
  850. // Retrieves the modeless dialog size and position to registry for persistence
  851. BOOL ReadRegistryPositionInfo(LPIAB lpIAB, LPABOOK_POSCOLSIZE lpABPosColSize, LPTSTR szKey);
  852. // Processes the nmcustomdraw message from the list view
  853. LRESULT ProcessLVCustomDraw(HWND hWnd, LPARAM lParam, BOOL bIsDialog);
  854. // Quick Filter for list view
  855. void DoLVQuickFilter( LPADRBOOK lpIAB,
  856. HWND hWndEdit,
  857. HWND hWndLV,
  858. LPSORT_INFO lpSortInfo,
  859. ULONG ulFlags,
  860. int nMinLen,
  861. LPRECIPIENT_INFO * lppContentsList);
  862. // Sets the objects name in the properties window title
  863. void SetWindowPropertiesTitle(HWND hDlg, LPTSTR lpszName);
  864. void SCS(HWND hwndParent);
  865. // Copies an items (partial) contents into the clipboard
  866. HRESULT HrCopyItemDataToClipboard(HWND hWnd, LPADRBOOK lpIAB, HWND hWndLV);
  867. // Gets the items data and puts it all into 1 long string
  868. HRESULT HrGetLVItemDataString(LPADRBOOK lpIAB, HWND hWndLV, int iItemIndex, LPTSTR * lppszData);
  869. LPTSTR FormatAllocFilter(int StringID1, LPCTSTR lpFilter1,
  870. int StringID2, LPCTSTR lpFilter2,
  871. int StringID3, LPCTSTR lpFilter3);
  872. // Shellexecutes a "mailto" to selected entry ...
  873. HRESULT HrSendMailToSelectedContacts(HWND hWndLV, LPADRBOOK lpIAB, int nExtEmail);
  874. // Show certificate properties
  875. //HRESULT HrShowCertProps(HWND hWndParent,
  876. // LPCERT_DISPLAY_PROPS lpCDP);
  877. // Shows the Help About dialog box
  878. INT_PTR CALLBACK HelpAboutDialogProc( HWND hDlg,
  879. UINT message,
  880. WPARAM wParam,
  881. LPARAM lParam);
  882. // Helps truncate DBCS strings correctly
  883. ULONG TruncatePos(LPTSTR lpsz, ULONG nMaxLen);
  884. // Local WAB search
  885. HRESULT HrDoLocalWABSearch( IN HANDLE hPropertyStore,
  886. IN LPSBinary lpsbCont,
  887. IN LDAP_SEARCH_PARAMS LDAPsp,
  888. OUT LPULONG lpulFoundCount,
  889. OUT LPSBinary * lprgsbEntryIDs );
  890. // Adds a non-wab entry to the wab
  891. HRESULT HrEntryAddToWAB( LPADRBOOK lpIAB,
  892. HWND hWndParent,
  893. ULONG cbInputEID,
  894. LPENTRYID lpInputEID,
  895. ULONG * lpcbOutputEID,
  896. LPENTRYID * lppOutputEID);
  897. // Deciphers a vCard File and then shows one off details on it
  898. HRESULT HrShowOneOffDetailsOnVCard( LPADRBOOK lpIAB,
  899. HWND hWnd,
  900. LPTSTR szvCardFile);
  901. // Checks if the current locale needs Ruby Support
  902. BOOL bIsRubyLocale();
  903. void FreeRecipList(LPRECIPIENT_INFO * lppList);
  904. void SetSBinary(LPSBinary lpsb, ULONG cb, LPBYTE lpb);
  905. HRESULT HrProcessLDAPUrl(LPADRBOOK lpIAB, HWND hWnd,
  906. ULONG ulFlags, LPTSTR szLDAPUrl,
  907. LPMAILUSER * lppMailUser);
  908. HRESULT VCardRetrieve(LPADRBOOK lpIAB,
  909. HWND hWndParent,
  910. ULONG ulFlags,
  911. LPTSTR lpszFileName,
  912. LPSTR lpszBuf,
  913. LPMAILUSER * lppMailUser);
  914. HRESULT VCardCreate( LPADRBOOK lpIAB,
  915. HWND hWndParent,
  916. ULONG ulFlags,
  917. LPTSTR lpszFileName,
  918. LPMAILUSER lpMailUser);
  919. //void ShellUtil_RunClientRegCommand(HWND hwnd, LPCTSTR pszClient);
  920. HRESULT HrShellExecInternetCall(LPADRBOOK lpIAB, HWND hWndLV);
  921. // Open a vCard and add it to the wab based on file name
  922. HRESULT OpenAndAddVCard(LPBWI lpbwi, LPTSTR szVCardFile);
  923. // removes illegal chars from potential file names
  924. void TrimIllegalFileChars(LPTSTR sz);
  925. // DistList prop sheets
  926. //
  927. INT_PTR CreateDLPropertySheet( HWND hwndOwner,
  928. LPDL_INFO lpPropArrayInfo);
  929. // Copies truncated version of Src to Dest
  930. int CopyTruncate(LPTSTR szDest, LPTSTR szSrc, int nMaxLen);
  931. // Adds an item's parent's eid to the item
  932. HRESULT AddFolderParentEIDToItem(LPIAB lpIAB,
  933. ULONG cbFolderEntryID,
  934. LPENTRYID lpFolderEntryID,
  935. LPMAPIPROP lpMU, ULONG cbEID, LPENTRYID lpEID);
  936. // Adds an item's eid to its parent
  937. HRESULT AddItemEIDToFolderParent( LPIAB lpIAB,
  938. ULONG cbFolderEntryId,
  939. LPENTRYID lpFolderEntryId,
  940. ULONG cbEID, LPENTRYID lpEID);
  941. // Adds the specified entry to the specified WAB Profile Folder
  942. HRESULT AddEntryToFolder(LPADRBOOK lpIAB,
  943. LPMAPIPROP lpMailUser,
  944. ULONG cbFolderEntryId,
  945. LPENTRYID lpFolderEntryId,
  946. DWORD cbEID,
  947. LPENTRYID lpEID);
  948. // imports another WAB file
  949. HRESULT HrImportWABFile(HWND hWnd, LPADRBOOK lpIAB, ULONG ulFlags, LPTSTR lpszFileName);
  950. LPRECIPIENT_INFO GetItemFromLV(HWND hWndLV, int iItem);
  951. // determines what the UI icon for the entry should be..
  952. int GetWABIconImage(LPRECIPIENT_INFO lpItem);
  953. //
  954. // Functions related to using Outlook store
  955. BOOL SetRegistryUseOutlook(BOOL bUseOutlook);
  956. BOOL bUseOutlookStore();
  957. BOOL bCheckForOutlookWABDll(LPTSTR lpszDllPath, DWORD cchDllPath);
  958. // Functions used in managing rt-click extensions
  959. void FreeActionItemList(LPIAB lpIAB);
  960. HRESULT HrUpdateActionItemList(LPIAB lpIAB);
  961. LRESULT ProcessActionCommands(LPIAB lpIAB, HWND hWndLV,
  962. HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
  963. void AddExtendedMenuItems(LPADRBOOK lpIAB, HWND hWndLV, HMENU hMenuAction, BOOL bUpdateStatus, BOOL bAddSendMailItems);
  964. void AddExtendedSendMailToItems(LPADRBOOK lpIAB, HWND hWndLV, HMENU hMenuAction, BOOL bAddItems);
  965. void GetContextMenuExtCommandString(LPIAB lpIAB, int uCmd, LPTSTR sz, ULONG cbsz);
  966. // Stuff to do with GetMe / SetMe
  967. HRESULT HrGetMeObject(LPADRBOOK lpIAB, ULONG ulFlags, DWORD * lpdwAction, SBinary * lpsbEID, ULONG_PTR ulParam);
  968. HRESULT HrSetMeObject(LPADRBOOK lpIAB, ULONG ulFlags, SBinary sbEID, ULONG_PTR ulParam);
  969. // Stuff to do with the print and abort import dialog
  970. void CreateShowAbortDialog(HWND hWndParent, int idsTitle, int idsIcon, int ProgMax, int ProgCurrent);
  971. void CloseAbortDlg();
  972. BOOL CALLBACK FAbortProc(HDC hdcPrn, INT nCode);
  973. void SetPrintDialogMsg(int idsMsg, int idsFormat, LPTSTR lpszMsg);
  974. INT_PTR CALLBACK FAbortDlgProc(HWND hwnd, UINT msg,WPARAM wp, LPARAM lp);
  975. BOOL bTimeToAbort();
  976. HRESULT HrSaveHotmailSyncInfoOnDeletion(LPADRBOOK lpAdrBook, LPSBinary lpEID);
  977. HRESULT HrAssociateOneOffGroupMembersWithContacts(LPADRBOOK lpAdrBook,
  978. LPSBinary lpsbGroupEID,
  979. LPDISTLIST lpDistList);
  980. // Stuff used in adding extension property pages to the WAB Prop Sheets
  981. //
  982. typedef HRESULT (_ADDPROPPAGES_) (LPFNADDPROPSHEETPAGE lpfnAddPage, LPARAM lParam, int * lpnPage);
  983. typedef _ADDPROPPAGES_ FAR *LPFNADDPAGES;
  984. BOOL CALLBACK AddPropSheetPageProc( HPROPSHEETPAGE hpage, LPARAM lParam );
  985. void FreePropExtList(LPEXTDLLINFO lpList);
  986. HRESULT GetExtDisplayInfo(LPIAB lpIAB, LPPROP_ARRAY_INFO lpPropArrayInfo, BOOL fReadOnly, BOOL bMailUser);
  987. BOOL ChangedExtDisplayInfo(LPPROP_ARRAY_INFO lpPropArrayInfo, BOOL bChanged);
  988. void FreeExtDisplayInfo(LPPROP_ARRAY_INFO lpPropArrayInfo);
  989. #ifdef COLSEL_MENU
  990. BOOL ColSel_PropTagToString( ULONG ulPropTag, LPTSTR lpszString, ULONG cchSize);
  991. #endif // COLSEL_MENU
  992. BOOL IsWindowOnScreen(LPRECT lprc); // determines if window is onscreen
  993. BOOL IsHTTPMailEnabled(LPIAB lpIAB);
  994. /*********************************************************************/
  995. #ifdef WIN16 // Need WINAPI for 16 bits
  996. typedef BOOL WINAPI (_INITCOMMONCONTROLSEX_)(LPINITCOMMONCONTROLSEX lpiccex);
  997. typedef _INITCOMMONCONTROLSEX_ FAR *LP_INITCOMMONCONTROLSEX;
  998. typedef HPROPSHEETPAGE WINAPI (_CREATEPROPERTYSHEETPAGE_)(PROPSHEETPAGE * lppsp);
  999. typedef _CREATEPROPERTYSHEETPAGE_ FAR * LP_CREATEPROPERTYSHEETPAGE;
  1000. typedef BOOL WINAPI (_IMAGELIST_DRAW_)(HIMAGELIST himl, int i, HDC hdcDst,int x, int y, UINT fStyle);
  1001. typedef _IMAGELIST_DRAW_ FAR * LPIMAGELIST_DRAW;
  1002. typedef BOOL WINAPI (_IMAGELIST_DESTROY_)(HIMAGELIST himl);
  1003. typedef _IMAGELIST_DESTROY_ FAR * LPIMAGELIST_DESTROY;
  1004. typedef HIMAGELIST WINAPI (_IMAGELIST_LOADIMAGE_)(HINSTANCE hi, LPTSTR lpbmp, int cx, int cGrow, COLORREF crMask, UINT uType, UINT uFlags);
  1005. typedef _IMAGELIST_LOADIMAGE_ FAR *LPIMAGELIST_LOADIMAGE;
  1006. typedef COLORREF WINAPI (_IMAGELIST_SETBKCOLOR_)(HIMAGELIST himl, COLORREF clrBk);
  1007. typedef _IMAGELIST_SETBKCOLOR_ FAR *LPIMAGELIST_SETBKCOLOR;
  1008. typedef BOOL WINAPI (_TRACKMOUSEEVENT_)(LPTRACKMOUSEEVENT lpEventTrack);
  1009. typedef _TRACKMOUSEEVENT_ FAR *LP_TRACKMOUSEEVENT;
  1010. typedef int WINAPI (_PROPERTYSHEET_)(LPCPROPSHEETHEADER lppsph);
  1011. typedef _PROPERTYSHEET_ FAR *LPPROPERTYSHEET;
  1012. #else // WIN16
  1013. typedef BOOL (_INITCOMMONCONTROLSEX_)(LPINITCOMMONCONTROLSEX lpiccex);
  1014. typedef _INITCOMMONCONTROLSEX_ FAR *LP_INITCOMMONCONTROLSEX;
  1015. /*
  1016. typedef HPROPSHEETPAGE (_CREATEPROPERTYSHEETPAGE_)(PROPSHEETPAGE * lppsp);
  1017. typedef _CREATEPROPERTYSHEETPAGE_ FAR * LP_CREATEPROPERTYSHEETPAGE;
  1018. */
  1019. typedef HPROPSHEETPAGE (_CREATEPROPERTYSHEETPAGE_A_)(LPCPROPSHEETPAGEA lppsp);
  1020. typedef HPROPSHEETPAGE (_CREATEPROPERTYSHEETPAGE_W_)(LPCPROPSHEETPAGEW lppsp);
  1021. typedef _CREATEPROPERTYSHEETPAGE_A_ FAR * LP_CREATEPROPERTYSHEETPAGE_A;
  1022. typedef _CREATEPROPERTYSHEETPAGE_W_ FAR * LP_CREATEPROPERTYSHEETPAGE_W;
  1023. typedef BOOL (_IMAGELIST_DRAW_)(HIMAGELIST himl, int i, HDC hdcDst,int x, int y, UINT fStyle);
  1024. typedef _IMAGELIST_DRAW_ FAR * LPIMAGELIST_DRAW;
  1025. typedef BOOL (_IMAGELIST_DESTROY_)(HIMAGELIST himl);
  1026. typedef _IMAGELIST_DESTROY_ FAR * LPIMAGELIST_DESTROY;
  1027. /*
  1028. typedef HIMAGELIST (_IMAGELIST_LOADIMAGE_)(HINSTANCE hi, LPCSTR lpbmp, int cx, int cGrow, COLORREF crMask, UINT uType, UINT uFlags);
  1029. typedef _IMAGELIST_LOADIMAGE_ FAR *LPIMAGELIST_LOADIMAGE;
  1030. */
  1031. typedef HIMAGELIST (_IMAGELIST_LOADIMAGE_A_)(HINSTANCE hi, LPCSTR lpbmp, int cx, int cGrow, COLORREF crMask, UINT uType, UINT uFlags);
  1032. typedef HIMAGELIST (_IMAGELIST_LOADIMAGE_W_)(HINSTANCE hi, LPCWSTR lpbmp,int cx, int cGrow, COLORREF crMask, UINT uType, UINT uFlags);
  1033. typedef _IMAGELIST_LOADIMAGE_A_ FAR *LPIMAGELIST_LOADIMAGE_A;
  1034. typedef _IMAGELIST_LOADIMAGE_W_ FAR *LPIMAGELIST_LOADIMAGE_W;
  1035. typedef COLORREF (_IMAGELIST_SETBKCOLOR_)(HIMAGELIST himl, COLORREF clrBk);
  1036. typedef _IMAGELIST_SETBKCOLOR_ FAR *LPIMAGELIST_SETBKCOLOR;
  1037. typedef BOOL (_TRACKMOUSEEVENT_)(LPTRACKMOUSEEVENT lpEventTrack);
  1038. typedef _TRACKMOUSEEVENT_ FAR *LP_TRACKMOUSEEVENT;
  1039. /*
  1040. typedef int (_PROPERTYSHEET_)(LPCPROPSHEETHEADER lppsph);
  1041. typedef _PROPERTYSHEET_ FAR *LPPROPERTYSHEET;
  1042. */
  1043. typedef INT_PTR (_PROPERTYSHEET_A_)(LPCPROPSHEETHEADERA lppsphA);
  1044. typedef INT_PTR (_PROPERTYSHEET_W_)(LPCPROPSHEETHEADERW lppsphW);
  1045. typedef _PROPERTYSHEET_A_ FAR *LPPROPERTYSHEET_A;
  1046. typedef _PROPERTYSHEET_W_ FAR *LPPROPERTYSHEET_W;
  1047. #endif
  1048. BOOL InitCommonControlLib(void);
  1049. ULONG DeinitCommCtrlClientLib(void);
  1050. BOOL __fastcall IsSpace(LPTSTR lpChar);
  1051. /*********************************************************************/
  1052. // The following messages are used for shutting down the WAB when the user changes to modify the locale
  1053. // so that the new set of WAB resources can be brought in ..
  1054. // These are used in conjunction with MLLoadLibrary
  1055. #define PUI_OFFICE_COMMAND (WM_USER + 0x0901)
  1056. #define PLUGUI_CMD_SHUTDOWN 0 // wParam value
  1057. #define PLUGUI_CMD_QUERY 1 // wParam value
  1058. #define OFFICE_VERSION_9 9 // standardized value to return for Office 9 apps
  1059. typedef struct _PLUGUI_INFO
  1060. {
  1061. unsigned uMajorVersion : 8; // Used to indicate App;s major version number
  1062. unsigned uOleServer : 1; // BOOL, TRUE if this is an OLE process
  1063. unsigned uUnused : 23; // not used
  1064. } PLUGUI_INFO;
  1065. typedef union _PLUGUI_QUERY
  1066. {
  1067. UINT uQueryVal;
  1068. PLUGUI_INFO PlugUIInfo;
  1069. } PLUGUI_QUERY;
  1070. // End of Pluggable UI section
  1071. #endif