WinInterface.h 20 KB

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