Source code of Windows XP (NT5)
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.

135 lines
6.0 KiB

  1. /*
  2. * EDLINKS.H
  3. *
  4. * Internal definitions, structures, and function prototypes for the
  5. * OLE 2.0 UI Edit Links dialog.
  6. *
  7. * Copyright (c)1992 Microsoft Corporation, All Right Reserved
  8. */
  9. #ifndef _LINKS_H_
  10. #define _LINKS_H_
  11. //INTERNAL INFORMATION STARTS HERE
  12. #define OLEUI_SZMAX 255
  13. #define LINKTYPELEN 9
  14. #define szNULL TEXT("\0")
  15. typedef UINT (CALLBACK* COMMDLGHOOKPROC)(HWND, UINT, WPARAM, LPARAM);
  16. //Internally used structure
  17. typedef struct tagLINKINFO
  18. {
  19. DWORD dwLink; // app specific identifier of a link
  20. LPTSTR lpszDisplayName; // file based part of name
  21. LPTSTR lpszItemName; // object part of name
  22. LPTSTR lpszShortFileName; // filename without path
  23. LPTSTR lpszShortLinkType; // Short link type - progID
  24. LPTSTR lpszFullLinkType; // Full link type - user friendly name
  25. LPTSTR lpszAMX; // Is the link auto (A) man (M) or dead (X)
  26. ULONG clenFileName; // count of file part of mon.
  27. BOOL fSourceAvailable; // bound or not - on boot assume yes??
  28. BOOL fIsAuto; // 1 =automatic, 0=manual update
  29. BOOL fIsMarked; // 1 = marked, 0 = not
  30. BOOL fDontFree; // Don't free this data since it's being reused
  31. BOOL fIsSelected; // item selected or to be selected
  32. } LINKINFO, FAR* LPLINKINFO;
  33. /*
  34. * What we store extra in this structure besides the original caller's
  35. * pointer are those fields that we need to modify during the life of
  36. * the dialog but that we don't want to change in the original structure
  37. * until the user presses OK.
  38. */
  39. typedef struct tagEDITLINKS
  40. {
  41. //Keep this item first as the Standard* functions depend on it here.
  42. LPOLEUIEDITLINKS lpOEL; //Original structure passed.
  43. BOOL fClose; // Does the button read cancel (0) or
  44. // close (1)?
  45. int *rgIndex; // Array to hold indexes of selected items
  46. int cSelItems; // Number of selected items
  47. BOOL fItemsExist; // TRUE, items in lbox, FALSE, none
  48. UINT nChgSrcHelpID; // ID for Help callback from ChangeSrc dlg
  49. TCHAR szClose[50]; // Text for Close button
  50. // (when Cancel button gets renamed)
  51. } EDITLINKS, *PEDITLINKS, FAR *LPEDITLINKS;
  52. // Data to and from the ChangeSource dialog hook
  53. typedef struct tagOLEUICHANGESOURCEHOOKDATA
  54. {
  55. //These IN fields are standard across all OLEUI dialog functions.
  56. DWORD cbStruct; //Structure Size
  57. DWORD dwFlags; //IN-OUT: Flags
  58. HWND hWndOwner; //Owning window
  59. LPCTSTR lpszCaption; //Dialog caption bar contents
  60. LPFNOLEUIHOOK lpfnHook; //Hook callback
  61. LPARAM lCustData; //Custom data to pass to hook
  62. HINSTANCE hInstance; //Instance for customized template name
  63. LPCTSTR lpszTemplate; //Customized template name
  64. HRSRC hResource; //Customized template handle
  65. //Specifics for OLEUIINSERTOBJECT. All are IN-OUT unless otherwise spec.
  66. LPLINKINFO lpLI; // IN: ptr to LinkInfo entry
  67. LPEDITLINKS lpEL; // IN: ptr to EditLinks dialog struct
  68. BOOL fValidLink; // OUT: was link source validated
  69. LPTSTR lpszFrom; // OUT: string containing prefix of
  70. // source changed from
  71. LPTSTR lpszTo; // OUT: string containing prefix of
  72. // source changed to
  73. } OLEUICHANGESOURCEHOOKDATA, *POLEUICHANGESOURCEHOOKDATA,
  74. FAR *LPOLEUICHANGESOURCEHOOKDATA;
  75. // Data to and from the ChangeSource dialog hook
  76. typedef struct tagCHANGESOURCEHOOKDATA
  77. {
  78. LPOLEUICHANGESOURCEHOOKDATA lpOCshData; //Original structure passed.
  79. LPOPENFILENAME lpOfn;
  80. BOOL fValidLink;
  81. int nFileLength;
  82. int nEditLength;
  83. TCHAR szFileName[OLEUI_CCHPATHMAX];
  84. TCHAR szItemName[OLEUI_CCHPATHMAX];
  85. BOOL bFileNameStored;
  86. BOOL bItemNameStored;
  87. TCHAR szEdit[OLEUI_CCHPATHMAX];
  88. LPTSTR lpszFrom; // string containing prefix of source
  89. // changed from
  90. LPTSTR lpszTo; // string containing prefix of source
  91. // source changed to
  92. } CHANGESOURCEHOOKDATA, *PCHANGESOURCEHOOKDATA, FAR *LPCHANGESOURCEHOOKDATA;
  93. //Internal function prototypes
  94. //LINKS.C
  95. BOOL CALLBACK EXPORT EditLinksDialogProc(HWND, UINT, WPARAM, LPARAM);
  96. BOOL FEditLinksInit(HWND, WPARAM, LPARAM);
  97. BOOL Container_ChangeSource(HWND, LPEDITLINKS);
  98. HRESULT Container_AutomaticManual(HWND, BOOL, LPEDITLINKS);
  99. HRESULT CancelLink(HWND, LPEDITLINKS);
  100. HRESULT Container_UpdateNow(HWND, LPEDITLINKS);
  101. HRESULT Container_OpenSource(HWND, LPEDITLINKS);
  102. int AddLinkLBItem(HWND hListBox, LPOLEUILINKCONTAINER lpOleUILinkCntr, LPLINKINFO lpLI, BOOL fGetSelected);
  103. VOID BreakString(LPLINKINFO);
  104. int GetSelectedItems(HWND, int FAR* FAR*);
  105. BOOL WINAPI ChangeSource(HWND hWndOwner,
  106. LPTSTR lpszFile,
  107. UINT cchFile,
  108. UINT iFilterString,
  109. COMMDLGHOOKPROC lpfnBrowseHook,
  110. LPOLEUICHANGESOURCEHOOKDATA lpLbhData);
  111. UINT CALLBACK EXPORT ChangeSourceHook(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
  112. VOID InitControls(HWND hDlg, LPEDITLINKS lpEL);
  113. VOID UpdateLinkLBItem(HWND hListBox, int nIndex, LPEDITLINKS lpEL, BOOL bSelect);
  114. VOID DiffPrefix(LPCTSTR lpsz1, LPCTSTR lpsz2, TCHAR FAR* FAR* lplpszPrefix1, TCHAR FAR* FAR* lplpszPrefix2);
  115. int PopupMessage(HWND hwndParent, UINT idTitle, UINT idMessage, UINT fuStyle);
  116. VOID ChangeAllLinks(HWND hLIstBox, LPOLEUILINKCONTAINER lpOleUILinkCntr, LPTSTR lpszFrom, LPTSTR lpszTo);
  117. int LoadLinkLB(HWND hListBox, LPOLEUILINKCONTAINER lpOleUILinkCntr);
  118. VOID RefreshLinkLB(HWND hListBox, LPOLEUILINKCONTAINER lpOleUILinkCntr);
  119. #endif // __LINKS_H__
  120.