WinInterface.h 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505
  1. //---------------------------------------------------------------------------
  2. #ifndef WinInterfaceH
  3. #define WinInterfaceH
  4. //---------------------------------------------------------------------------
  5. #include <Classes.hpp>
  6. #include <Buttons.hpp>
  7. #include <Interface.h>
  8. #include <GUIConfiguration.h>
  9. #include <SynchronizeController.h>
  10. #ifdef LOCALINTERFACE
  11. #include <LocalInterface.h>
  12. #endif
  13. #define SITE_ICON 1
  14. #define SITE_FOLDER_ICON 2
  15. #define WORKSPACE_ICON 3
  16. class TStoredSessionList;
  17. class TConfiguration;
  18. class TTerminal;
  19. const int mpNeverAskAgainCheck = 0x01;
  20. const int mpAllowContinueOnError = 0x02;
  21. #define UPLOAD_IF_ANY_SWITCH L"UploadIfAny"
  22. #define UPLOAD_SWITCH L"Upload"
  23. #define JUMPLIST_SWITCH L"JumpList"
  24. #define DESKTOP_SWITCH L"Desktop"
  25. #define SEND_TO_HOOK_SWITCH L"SendToHook"
  26. struct TMessageParams
  27. {
  28. TMessageParams(unsigned int AParams = 0);
  29. TMessageParams(const TQueryParams * AParams);
  30. const TQueryButtonAlias * Aliases;
  31. unsigned int AliasesCount;
  32. unsigned int Params;
  33. unsigned int Timer;
  34. TQueryParamsTimerEvent TimerEvent;
  35. UnicodeString TimerMessage;
  36. unsigned int TimerAnswers;
  37. TQueryType TimerQueryType;
  38. unsigned int Timeout;
  39. unsigned int TimeoutAnswer;
  40. UnicodeString NeverAskAgainTitle;
  41. unsigned int NeverAskAgainAnswer;
  42. bool NeverAskAgainCheckedInitially;
  43. bool AllowHelp;
  44. UnicodeString ImageName;
  45. UnicodeString MoreMessagesUrl;
  46. TSize MoreMessagesSize;
  47. private:
  48. inline void Reset();
  49. };
  50. class TCustomScpExplorerForm;
  51. TCustomScpExplorerForm * __fastcall CreateScpExplorer();
  52. void __fastcall ConfigureInterface();
  53. void __fastcall DoProductLicense();
  54. extern const UnicodeString AppName;
  55. void __fastcall SetOnForeground(bool OnForeground);
  56. void __fastcall FlashOnBackground();
  57. void __fastcall ShowExtendedExceptionEx(TTerminal * Terminal, Exception * E);
  58. void __fastcall FormHelp(TForm * Form);
  59. void __fastcall SearchHelp(const UnicodeString & Message);
  60. void __fastcall MessageWithNoHelp(const UnicodeString & Message);
  61. UnicodeString __fastcall GetToolbarsLayoutStr(TComponent * OwnerComponent);
  62. void __fastcall LoadToolbarsLayoutStr(TComponent * OwnerComponent, UnicodeString LayoutStr);
  63. namespace Tb2item { class TTBCustomItem; }
  64. void __fastcall AddMenuSeparator(Tb2item::TTBCustomItem * Menu);
  65. void __fastcall AddMenuLabel(Tb2item::TTBCustomItem * Menu, const UnicodeString & Label);
  66. // windows\WinHelp.cpp
  67. void __fastcall InitializeWinHelp();
  68. void __fastcall FinalizeWinHelp();
  69. // windows\WinInterface.cpp
  70. unsigned int __fastcall MessageDialog(const UnicodeString Msg, TQueryType Type,
  71. unsigned int Answers, UnicodeString HelpKeyword = HELP_NONE, const TMessageParams * Params = NULL);
  72. unsigned int __fastcall MessageDialog(int Ident, TQueryType Type,
  73. unsigned int Answers, UnicodeString HelpKeyword = HELP_NONE, const TMessageParams * Params = NULL);
  74. unsigned int __fastcall SimpleErrorDialog(const UnicodeString Msg, const UnicodeString MoreMessages = L"");
  75. unsigned int __fastcall MoreMessageDialog(const UnicodeString Message,
  76. TStrings * MoreMessages, TQueryType Type, unsigned int Answers,
  77. UnicodeString HelpKeyword, const TMessageParams * Params = NULL);
  78. unsigned int __fastcall ExceptionMessageDialog(Exception * E, TQueryType Type,
  79. const UnicodeString MessageFormat = L"", unsigned int Answers = qaOK,
  80. UnicodeString HelpKeyword = HELP_NONE, const TMessageParams * Params = NULL);
  81. unsigned int __fastcall FatalExceptionMessageDialog(Exception * E, TQueryType Type,
  82. int SessionReopenTimeout, const UnicodeString MessageFormat = L"", unsigned int Answers = qaOK,
  83. UnicodeString HelpKeyword = HELP_NONE, const TMessageParams * Params = NULL);
  84. // forms\Custom.cpp
  85. TSessionData * __fastcall DoSaveSession(TSessionData * SessionData,
  86. TSessionData * OriginalSession, bool ForceDialog,
  87. TStrings * AdditionalFolders);
  88. void __fastcall SessionNameValidate(const UnicodeString & Text,
  89. const UnicodeString & OriginalName);
  90. bool __fastcall DoSaveWorkspaceDialog(UnicodeString & WorkspaceName,
  91. bool * SavePasswords, bool NotRecommendedSavingPasswords,
  92. bool & CreateShortcut, bool & EnableAutoSave);
  93. class TShortCuts;
  94. bool __fastcall DoShortCutDialog(TShortCut & ShortCut,
  95. const TShortCuts & ShortCuts, UnicodeString HelpKeyword);
  96. // windows\UserInterface.cpp
  97. bool __fastcall DoMasterPasswordDialog();
  98. bool __fastcall DoChangeMasterPasswordDialog(UnicodeString & NewPassword);
  99. // windows\WinMain.cpp
  100. int __fastcall Execute();
  101. void __fastcall GetLoginData(UnicodeString SessionName, TOptions * Options,
  102. TObjectList * DataList, UnicodeString & DownloadFile, bool & Url);
  103. // forms\InputDlg.cpp
  104. struct TInputDialogData
  105. {
  106. TEdit * Edit;
  107. };
  108. typedef void __fastcall (__closure *TInputDialogInitialize)
  109. (TObject * Sender, TInputDialogData * Data);
  110. bool __fastcall InputDialog(const UnicodeString ACaption,
  111. const UnicodeString APrompt, UnicodeString & Value, UnicodeString HelpKeyword = HELP_NONE,
  112. TStrings * History = NULL, bool PathInput = false,
  113. TInputDialogInitialize OnInitialize = NULL);
  114. // forms\About.cpp
  115. struct TRegistration
  116. {
  117. bool Registered;
  118. UnicodeString Subject;
  119. int Licenses;
  120. UnicodeString ProductId;
  121. bool NeverExpires;
  122. TDateTime Expiration;
  123. bool EduLicense;
  124. TNotifyEvent OnRegistrationLink;
  125. };
  126. void __fastcall DoAboutDialog(TConfiguration * Configuration,
  127. bool AllowLicense, TRegistration * Registration);
  128. void __fastcall DoAboutDialog(TConfiguration *Configuration);
  129. // forms\Cleanup.cpp
  130. bool __fastcall DoCleanupDialog(TStoredSessionList *SessionList,
  131. TConfiguration *Configuration);
  132. // forms\Console.cpp
  133. void __fastcall DoConsoleDialog(TTerminal * Terminal,
  134. const UnicodeString Command = L"", const TStrings * Log = NULL);
  135. // forms\Copy.cpp
  136. const coTemp = 0x001;
  137. const coDisableQueue = 0x002;
  138. const coDisableDirectory = 0x008; // not used anymore
  139. const coDoNotShowAgain = 0x020;
  140. const coDisableSaveSettings = 0x040; // not used anymore
  141. const coDoNotUsePresets = 0x080;
  142. const coAllowRemoteTransfer = 0x100;
  143. const coNoQueue = 0x200;
  144. const coNoQueueIndividually = 0x400;
  145. const cooDoNotShowAgain = 0x01;
  146. const cooRemoteTransfer = 0x02;
  147. const cooSaveSettings = 0x04;
  148. bool __fastcall DoCopyDialog(bool ToRemote,
  149. bool Move, TStrings * FileList, UnicodeString & TargetDirectory,
  150. TGUICopyParamType * Params, int Options, int CopyParamAttrs,
  151. int * OutputOptions);
  152. // forms\CreateDirectory.cpp
  153. bool __fastcall DoCreateDirectoryDialog(UnicodeString & Directory,
  154. TRemoteProperties * Properties, bool & SaveSettings);
  155. // forms\ImportSessions.cpp
  156. bool __fastcall DoImportSessionsDialog(TList * Imported);
  157. // forms\License.cpp
  158. enum TLicense { lcNoLicense = -1, lcWinScp, lcExpat };
  159. void __fastcall DoLicenseDialog(TLicense License);
  160. // forms\Login.cpp
  161. // these flags are used in navigation tree of login dialog, change with care
  162. const loLocalDirectory = 0x01;
  163. const loExternalTools = 0x04;
  164. const loColor = 0x80;
  165. const loNone = 0x00;
  166. const loAddSession = (loLocalDirectory | loColor);
  167. const loStartup = (loLocalDirectory | loExternalTools | loColor);
  168. bool __fastcall DoLoginDialog(TStoredSessionList * SessionList,
  169. TList * DataList, int Options);
  170. // forms\SiteAdvanced.cpp
  171. bool __fastcall DoSiteAdvancedDialog(TSessionData * SessionData, int Options);
  172. // forms\OpenDirectory.cpp
  173. enum TOpenDirectoryMode { odBrowse, odAddBookmark };
  174. bool __fastcall DoOpenDirectoryDialog(TOpenDirectoryMode Mode, TOperationSide Side,
  175. UnicodeString & Directory, TStrings * Directories, TTerminal * Terminal,
  176. bool AllowSwitch);
  177. // forms\LocatinoProfiles.cpp
  178. bool __fastcall LocationProfilesDialog(TOpenDirectoryMode Mode,
  179. TOperationSide Side, UnicodeString & LocalDirectory, UnicodeString & RemoteDirectory,
  180. TStrings * LocalDirectories, TStrings * RemoteDirectories, TTerminal * Terminal);
  181. // forms\Preferences.cpp
  182. enum TPreferencesMode { pmDefault, pmEditor, pmCustomCommands,
  183. pmQueue, pmLogging, pmUpdates, pmPresets, pmEditors };
  184. class TCopyParamRuleData;
  185. struct TPreferencesDialogData
  186. {
  187. TCopyParamRuleData * CopyParamRuleData;
  188. };
  189. bool __fastcall DoPreferencesDialog(TPreferencesMode APreferencesMode,
  190. TPreferencesDialogData * DialogData = NULL);
  191. // forms\CustomCommand.cpp
  192. class TCustomCommandList;
  193. class TCustomCommandType;
  194. class TShortCuts;
  195. enum TCustomCommandsMode { ccmAdd, ccmEdit, ccmAdHoc };
  196. const ccoDisableRemote = 0x01;
  197. typedef void __fastcall (__closure *TCustomCommandValidate)
  198. (const TCustomCommandType & Command);
  199. bool __fastcall DoCustomCommandDialog(TCustomCommandType & Command,
  200. const TCustomCommandList * CustomCommandList,
  201. TCustomCommandsMode Mode, int Options, TCustomCommandValidate OnValidate,
  202. const TShortCuts * ShortCuts);
  203. // forms\CopyParamPreset.cpp
  204. class TCopyParamList;
  205. enum TCopyParamPresetMode { cpmAdd, cpmAddCurrent, cpmEdit, cpmDuplicate };
  206. bool __fastcall DoCopyParamPresetDialog(TCopyParamList * CopyParamList,
  207. int & Index, TCopyParamPresetMode Mode, TCopyParamRuleData * CurrentRuleData,
  208. const TCopyParamType & DefaultCopyParams);
  209. // forms\CopyParamCsutom.cpp
  210. bool __fastcall DoCopyParamCustomDialog(TCopyParamType & CopyParam,
  211. int CopyParamAttrs);
  212. // forms\Properties.cpp
  213. class TRemoteProperties;
  214. class TRemoteTokenList;
  215. struct TCalculateSizeStats;
  216. const cpMode = 0x01;
  217. const cpOwner = 0x02;
  218. const cpGroup = 0x04;
  219. typedef void __fastcall (__closure *TCalculateSizeEvent)
  220. (TStrings * FileList, __int64 & Size, TCalculateSizeStats & Stats,
  221. bool & Close);
  222. typedef void __fastcall (__closure *TCalculatedChecksumCallbackEvent)(
  223. const UnicodeString & FileName, const UnicodeString & Alg, const UnicodeString & Hash);
  224. typedef void __fastcall (__closure *TCalculateChecksumEvent)
  225. (const UnicodeString & Alg, TStrings * FileList,
  226. TCalculatedChecksumCallbackEvent OnCalculatedChecksum, bool & Close);
  227. bool __fastcall DoPropertiesDialog(TStrings * FileList,
  228. const UnicodeString Directory, const TRemoteTokenList * GroupList,
  229. const TRemoteTokenList * UserList, TRemoteProperties * Properties,
  230. int AllowedChanges, bool UserGroupByID, TCalculateSizeEvent OnCalculateSize,
  231. TCalculateChecksumEvent OnCalculateChecksum);
  232. bool __fastcall DoRemoteMoveDialog(UnicodeString & Target, UnicodeString & FileMask);
  233. enum TDirectRemoteCopy { drcDisallow, drcAllow, drcConfirmCommandSession };
  234. bool __fastcall DoRemoteCopyDialog(TStrings * Sessions, TStrings * Directories,
  235. TDirectRemoteCopy AllowDirectCopy, void *& Session, UnicodeString & Target, UnicodeString & FileMask,
  236. bool & DirectCopy);
  237. // forms\SelectMask.cpp
  238. #ifdef CustomdirviewHPP
  239. bool __fastcall DoSelectMaskDialog(TCustomDirView * Parent, bool Select,
  240. TFileFilter * Filter, TConfiguration * Configuration);
  241. bool __fastcall DoFilterMaskDialog(TCustomDirView * Parent,
  242. TFileFilter * Filter);
  243. #endif
  244. // forms\EditMask.cpp
  245. bool __fastcall DoEditMaskDialog(TFileMasks & Mask);
  246. const spDelete = 0x01;
  247. const spNoConfirmation = 0x02;
  248. const spExistingOnly = 0x04;
  249. const spPreviewChanges = 0x40; // not used by core
  250. const spTimestamp = 0x100;
  251. const spNotByTime = 0x200;
  252. const spBySize = 0x400;
  253. const spSelectedOnly = 0x800;
  254. const spMirror = 0x1000;
  255. // forms\Synchronize.cpp
  256. const soDoNotUsePresets = 0x01;
  257. const soNoMinimize = 0x02;
  258. const soAllowSelectedOnly = 0x04;
  259. typedef void __fastcall (__closure *TGetSynchronizeOptionsEvent)
  260. (int Params, TSynchronizeOptions & Options);
  261. typedef void __fastcall (__closure *TFeedSynchronizeError)
  262. (const UnicodeString & Message, TStrings * MoreMessages, TQueryType Type,
  263. const UnicodeString & HelpKeyword);
  264. bool __fastcall DoSynchronizeDialog(TSynchronizeParamType & Params,
  265. const TCopyParamType * CopyParams, TSynchronizeStartStopEvent OnStartStop,
  266. bool & SaveSettings, int Options, int CopyParamAttrs,
  267. TGetSynchronizeOptionsEvent OnGetOptions,
  268. TFeedSynchronizeError & OnFeedSynchronizeError,
  269. bool Start);
  270. // forms\FullSynchronize.cpp
  271. struct TUsableCopyParamAttrs;
  272. enum TSynchronizeMode { smRemote, smLocal, smBoth };
  273. const fsoDisableTimestamp = 0x01;
  274. const fsoDoNotUsePresets = 0x02;
  275. const fsoAllowSelectedOnly = 0x04;
  276. bool __fastcall DoFullSynchronizeDialog(TSynchronizeMode & Mode, int & Params,
  277. UnicodeString & LocalDirectory, UnicodeString & RemoteDirectory,
  278. TCopyParamType * CopyParams, bool & SaveSettings, bool & SaveMode,
  279. int Options, const TUsableCopyParamAttrs & CopyParamAttrs);
  280. // forms\SynchronizeChecklist.cpp
  281. class TSynchronizeChecklist;
  282. typedef void __fastcall (__closure *TCustomCommandMenuEvent)
  283. (TObject * Sender, TRect Rect, TStrings * LocalFileList, TStrings * RemoteFileList);
  284. bool __fastcall DoSynchronizeChecklistDialog(TSynchronizeChecklist * Checklist,
  285. TSynchronizeMode Mode, int Params,
  286. const UnicodeString LocalDirectory, const UnicodeString RemoteDirectory,
  287. TCustomCommandMenuEvent OnCustomCommandMenu);
  288. // forms\Editor.cpp
  289. typedef void __fastcall (__closure *TFileClosedEvent)
  290. (TObject * Sender, bool Forced);
  291. TForm * __fastcall ShowEditorForm(const UnicodeString FileName, TCustomForm * ParentForm,
  292. TNotifyEvent OnFileChanged, TNotifyEvent OnFileReload, TFileClosedEvent OnClose,
  293. const UnicodeString Caption, bool StandaloneEditor, TColor Color);
  294. void __fastcall ReconfigureEditorForm(TForm * Form);
  295. void __fastcall EditorFormFileUploadComplete(TForm * Form);
  296. bool __fastcall DoSymlinkDialog(UnicodeString & FileName, UnicodeString & PointTo,
  297. TOperationSide Side, bool & SymbolicLink, bool Edit, bool AllowSymbolic);
  298. // forms\FileSystemInfo.cpp
  299. struct TSpaceAvailable;
  300. struct TFileSystemInfo;
  301. struct TSessionInfo;
  302. typedef void __fastcall (__closure *TGetSpaceAvailable)
  303. (const UnicodeString Path, TSpaceAvailable & ASpaceAvailable, bool & Close);
  304. void __fastcall DoFileSystemInfoDialog(
  305. const TSessionInfo & SessionInfo, const TFileSystemInfo & FileSystemInfo,
  306. UnicodeString SpaceAvailablePath, TGetSpaceAvailable OnGetSpaceAvailable);
  307. // forms\MessageDlg.cpp
  308. void __fastcall AnswerNameAndCaption(
  309. unsigned int Answer, UnicodeString & Name, UnicodeString & Caption);
  310. TForm * __fastcall CreateMoreMessageDialog(const UnicodeString & Msg,
  311. TStrings * MoreMessages, TMsgDlgType DlgType, unsigned int Answers,
  312. const TQueryButtonAlias * Aliases, unsigned int AliasesCount,
  313. unsigned int TimeoutAnswer, TButton ** TimeoutButton,
  314. const UnicodeString & ImageName, const UnicodeString & NeverAskAgainCaption,
  315. const UnicodeString & MoreMessagesUrl, TSize MoreMessagesSize);
  316. // windows\Console.cpp
  317. int __fastcall Console(bool Help);
  318. // forms\EditorPreferences.cpp
  319. enum TEditorPreferencesMode { epmAdd, epmEdit, epmAdHoc };
  320. class TEditorData;
  321. bool __fastcall DoEditorPreferencesDialog(TEditorData * Editor,
  322. bool & Remember, TEditorPreferencesMode Mode, bool MayRemote);
  323. // forms\Find.cpp
  324. typedef void __fastcall (__closure *TFindEvent)
  325. (UnicodeString Directory, const TFileMasks & FileMask,
  326. TFileFoundEvent OnFileFound, TFindingFileEvent OnFindingFile);
  327. bool __fastcall DoFileFindDialog(UnicodeString Directory,
  328. TFindEvent OnFind, UnicodeString & Path);
  329. // forms\GenerateUrl.cpp
  330. void __fastcall DoGenerateUrlDialog(TSessionData * Data, TStrings * Paths);
  331. void __fastcall CopyParamListButton(TButton * Button);
  332. const int cplNone = 0x00;
  333. const int cplCustomize = 0x01;
  334. const int cplCustomizeDefault = 0x02;
  335. const int cplSaveSettings = 0x04;
  336. void __fastcall CopyParamListPopup(TRect R, TPopupMenu * Menu,
  337. const TCopyParamType & Param, UnicodeString Preset, TNotifyEvent OnClick,
  338. int Options, int CopyParamAttrs, bool SaveSettings = false);
  339. bool __fastcall CopyParamListPopupClick(TObject * Sender,
  340. TCopyParamType & Param, UnicodeString & Preset, int CopyParamAttrs,
  341. bool * SaveSettings = NULL);
  342. void __fastcall MenuPopup(TPopupMenu * Menu, TRect Rect, TComponent * PopupComponent);
  343. void __fastcall MenuPopup(TPopupMenu * Menu, TButton * Button);
  344. void __fastcall MenuPopup(TObject * Sender, const TPoint & MousePos, bool & Handled);
  345. void __fastcall MenuButton(TButton * Button);
  346. TRect __fastcall CalculatePopupRect(TButton * Button);
  347. TRect __fastcall CalculatePopupRect(TControl * Control, TPoint MousePos);
  348. typedef void __fastcall (__closure *TColorChangeEvent)
  349. (TColor Color);
  350. TPopupMenu * __fastcall CreateSessionColorPopupMenu(TColor Color,
  351. TColorChangeEvent OnColorChange);
  352. void __fastcall CreateSessionColorMenu(TComponent * AOwner, TColor Color,
  353. TColorChangeEvent OnColorChange);
  354. void __fastcall FixButtonImage(TButton * Button);
  355. void __fastcall CenterButtonImage(TButton * Button);
  356. void __fastcall UncenterButtonImage(TButton * Button);
  357. void __fastcall UpgradeSpeedButton(TSpeedButton * Button);
  358. void __fastcall SetGlobalMinimizeHandler(TCustomForm * Form, TNotifyEvent OnMinimize);
  359. void __fastcall ClearGlobalMinimizeHandler(TNotifyEvent OnMinimize);
  360. void __fastcall CallGlobalMinimizeHandler(TObject * Sender);
  361. bool __fastcall IsApplicationMinimized();
  362. void __fastcall ApplicationMinimize();
  363. void __fastcall ApplicationRestore();
  364. void __fastcall WinInitialize();
  365. void __fastcall WinFinalize();
  366. void __fastcall ShowNotification(TTerminal * Terminal, const UnicodeString & Str,
  367. TQueryType Type);
  368. void __fastcall InitializeShortCutCombo(TComboBox * ComboBox,
  369. const TShortCuts & ShortCuts);
  370. void __fastcall SetShortCutCombo(TComboBox * ComboBox, TShortCut Value);
  371. TShortCut __fastcall GetShortCutCombo(TComboBox * ComboBox);
  372. bool __fastcall IsCustomShortCut(TShortCut ShortCut);
  373. //---------------------------------------------------------------------------
  374. #define HIDDEN_WINDOW_NAME L"WinSCPHiddenWindow2"
  375. //---------------------------------------------------------------------------
  376. struct TCopyDataMessage
  377. {
  378. enum { CommandCanCommandLine, CommandCommandLine };
  379. static const unsigned int Version1 = 1;
  380. unsigned int Version;
  381. unsigned int Command;
  382. union
  383. {
  384. wchar_t CommandLine[10240];
  385. };
  386. };
  387. //---------------------------------------------------------------------------
  388. class TWinInteractiveCustomCommand : public TInteractiveCustomCommand
  389. {
  390. public:
  391. TWinInteractiveCustomCommand(TCustomCommand * ChildCustomCommand,
  392. const UnicodeString CustomCommandName);
  393. protected:
  394. virtual void __fastcall Prompt(const UnicodeString & Prompt,
  395. UnicodeString & Value);
  396. virtual void __fastcall Execute(const UnicodeString & Command,
  397. UnicodeString & Value);
  398. private:
  399. UnicodeString FCustomCommandName;
  400. };
  401. //---------------------------------------------------------------------------
  402. class TTrayIcon
  403. {
  404. public:
  405. __fastcall TTrayIcon(unsigned int Id);
  406. __fastcall ~TTrayIcon();
  407. void __fastcall PopupBalloon(UnicodeString Title, const UnicodeString & Str,
  408. TQueryType QueryType, unsigned int Timeout, TNotifyEvent OnBalloonClick,
  409. TObject * BalloonUserData);
  410. void __fastcall CancelBalloon();
  411. __property bool Visible = { read = FVisible, write = SetVisible };
  412. __property TNotifyEvent OnClick = { read = FOnClick, write = FOnClick };
  413. __property UnicodeString Hint = { read = GetHint, write = SetHint };
  414. protected:
  415. void __fastcall Update();
  416. bool __fastcall Notify(unsigned int Message);
  417. private:
  418. bool FVisible;
  419. NOTIFYICONDATA * FTrayIcon;
  420. TNotifyEvent FOnClick;
  421. TNotifyEvent FOnBalloonClick;
  422. TObject * FBalloonUserData;
  423. UINT FTaskbarCreatedMsg;
  424. void __fastcall WndProc(TMessage & Message);
  425. void __fastcall SetVisible(bool value);
  426. UnicodeString __fastcall GetHint();
  427. void __fastcall SetHint(UnicodeString value);
  428. void __fastcall BalloonCancelled();
  429. };
  430. //---------------------------------------------------------------------------
  431. #endif // WinInterfaceH