Tools.h 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. //---------------------------------------------------------------------------
  2. #ifndef ToolsH
  3. #define ToolsH
  4. #include <comctrls.hpp>
  5. #include <WinInterface.h>
  6. #include <HelpIntfs.hpp>
  7. #include <stdio.h>
  8. #include <SessionData.h>
  9. #include <Vcl.Graphics.hpp>
  10. //---------------------------------------------------------------------------
  11. void __fastcall CenterFormOn(TForm * Form, TControl * CenterOn);
  12. bool __fastcall ExecuteShellAndWait(const UnicodeString Path, const UnicodeString Params);
  13. bool __fastcall ExecuteShellAndWait(const UnicodeString Command);
  14. bool __fastcall UseAlternativeFunction();
  15. bool __fastcall OpenInNewWindow();
  16. void __fastcall ExecuteNewInstance(const UnicodeString & Param);
  17. IShellLink * __fastcall CreateDesktopShortCut(const UnicodeString &Name,
  18. const UnicodeString &File, const UnicodeString & Params, const UnicodeString & Description,
  19. int SpecialFolder = -1, int IconIndex = 0, bool Return = false);
  20. IShellLink * __fastcall CreateDesktopSessionShortCut(
  21. const UnicodeString & SessionName, UnicodeString Name,
  22. const UnicodeString & AdditionalParams,
  23. int SpecialFolder = -1, int IconIndex = SITE_ICON, bool Return = false);
  24. UnicodeString __fastcall GetListViewStr(TListView * ListView);
  25. void __fastcall LoadListViewStr(TListView * ListView, UnicodeString LayoutStr);
  26. void __fastcall RestoreForm(UnicodeString Data, TForm * Form);
  27. UnicodeString __fastcall StoreForm(TCustomForm * Form);
  28. void __fastcall RestoreFormSize(UnicodeString Data, TForm * Form);
  29. UnicodeString __fastcall StoreFormSize(TForm * Form);
  30. TFontStyles __fastcall IntToFontStyles(int value);
  31. int __fastcall FontStylesToInt(const TFontStyles value);
  32. bool __fastcall SameFont(TFont * Font1, TFont * Font2);
  33. TColor __fastcall GetWindowTextColor(TColor Color);
  34. TColor __fastcall GetWindowColor(TColor Color);
  35. TColor __fastcall GetNonZeroColor(TColor Color);
  36. void __fastcall ValidateMaskEdit(TComboBox * Edit);
  37. void __fastcall ValidateMaskEdit(TEdit * Edit);
  38. void __fastcall ValidateMaskEdit(TMemo * Edit, bool Directory);
  39. void __fastcall OpenBrowser(UnicodeString URL);
  40. bool __fastcall IsFormatInClipboard(unsigned int Format);
  41. bool __fastcall TextFromClipboard(UnicodeString & Text, bool Trim);
  42. bool __fastcall NonEmptyTextFromClipboard(UnicodeString & Text);
  43. HANDLE __fastcall OpenTextFromClipboard(const wchar_t *& Text);
  44. void __fastcall CloseTextFromClipboard(HANDLE Handle);
  45. void __fastcall ExitActiveControl(TForm * Form);
  46. UnicodeString __fastcall ReadResource(const UnicodeString ResName);
  47. bool __fastcall DumpResourceToFile(const UnicodeString ResName,
  48. const UnicodeString FileName);
  49. void __fastcall BrowseForExecutable(TEdit * Control, UnicodeString Title,
  50. UnicodeString Filter, bool FileNameCommand, bool Escape);
  51. void __fastcall BrowseForExecutable(TComboBox * Control, UnicodeString Title,
  52. UnicodeString Filter, bool FileNameCommand, bool Escape);
  53. bool __fastcall FontDialog(TFont * Font);
  54. bool __fastcall SaveDialog(UnicodeString Title, UnicodeString Filter,
  55. UnicodeString DefaultExt, UnicodeString & FileName);
  56. bool __fastcall AutodetectProxy(UnicodeString & HostName, int & PortNumber);
  57. bool __fastcall IsWin64();
  58. void __fastcall CopyToClipboard(UnicodeString Text);
  59. void __fastcall CopyToClipboard(TStrings * Strings);
  60. void __fastcall ShutDownWindows();
  61. void __fastcall SuspendWindows();
  62. void __fastcall EditSelectBaseName(HWND Edit);
  63. void __fastcall VerifyAndConvertKey(UnicodeString & FileName);
  64. void __fastcall VerifyKey(UnicodeString FileName);
  65. void __fastcall VerifyKeyIncludingVersion(UnicodeString FileName, TSshProt SshProt);
  66. void __fastcall VerifyCertificate(const UnicodeString & FileName);
  67. TStrings * __fastcall GetUnwrappedMemoLines(TMemo * Memo);
  68. bool __fastcall DetectSystemExternalEditor(
  69. bool AllowDefaultEditor,
  70. UnicodeString & Executable, UnicodeString & ExecutableDescription,
  71. UnicodeString & UsageState, bool & TryNextTime);
  72. //---------------------------------------------------------------------------
  73. #define IUNKNOWN \
  74. virtual HRESULT __stdcall QueryInterface(const GUID& IID, void **Obj) \
  75. { \
  76. return TInterfacedObject::QueryInterface(IID, (void *)Obj); \
  77. } \
  78. \
  79. virtual ULONG __stdcall AddRef() \
  80. { \
  81. return TInterfacedObject::_AddRef(); \
  82. } \
  83. \
  84. virtual ULONG __stdcall Release() \
  85. { \
  86. return TInterfacedObject::_Release(); \
  87. }
  88. //---------------------------------------------------------------------------
  89. void __fastcall InitializeCustomHelp(ICustomHelpViewer * HelpViewer);
  90. void __fastcall FinalizeCustomHelp();
  91. //---------------------------------------------------------------------------
  92. #endif