Tools.h 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  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. void __fastcall ValidateMaskEdit(TComboBox * Edit);
  34. void __fastcall ValidateMaskEdit(TEdit * Edit);
  35. void __fastcall ValidateMaskEdit(TMemo * Edit, bool Directory);
  36. void __fastcall OpenBrowser(UnicodeString URL);
  37. bool __fastcall IsFormatInClipboard(unsigned int Format);
  38. bool __fastcall TextFromClipboard(UnicodeString & Text, bool Trim);
  39. HANDLE __fastcall OpenTextFromClipboard(const wchar_t *& Text);
  40. void __fastcall CloseTextFromClipboard(HANDLE Handle);
  41. void __fastcall ExitActiveControl(TForm * Form);
  42. UnicodeString __fastcall ReadResource(const UnicodeString ResName);
  43. bool __fastcall DumpResourceToFile(const UnicodeString ResName,
  44. const UnicodeString FileName);
  45. void __fastcall BrowseForExecutable(TEdit * Control, UnicodeString Title,
  46. UnicodeString Filter, bool FileNameCommand, bool Escape);
  47. void __fastcall BrowseForExecutable(TComboBox * Control, UnicodeString Title,
  48. UnicodeString Filter, bool FileNameCommand, bool Escape);
  49. bool __fastcall FontDialog(TFont * Font);
  50. bool __fastcall SaveDialog(UnicodeString Title, UnicodeString Filter,
  51. UnicodeString DefaultExt, UnicodeString & FileName);
  52. bool __fastcall AutodetectProxyUrl(UnicodeString & Proxy);
  53. bool __fastcall IsWin64();
  54. void __fastcall CopyToClipboard(UnicodeString Text);
  55. void __fastcall CopyToClipboard(TStrings * Strings);
  56. void __fastcall ShutDownWindows();
  57. void __fastcall SuspendWindows();
  58. void __fastcall EditSelectBaseName(HWND Edit);
  59. void __fastcall VerifyKey(UnicodeString FileName);
  60. void __fastcall VerifyKeyIncludingVersion(UnicodeString FileName, TSshProt SshProt);
  61. TStrings * __fastcall GetUnwrappedMemoLines(TMemo * Memo);
  62. bool __fastcall DetectSystemExternalEditor(
  63. bool AllowDefaultEditor,
  64. UnicodeString & Executable, UnicodeString & ExecutableDescription,
  65. UnicodeString & UsageState, bool & TryNextTime);
  66. //---------------------------------------------------------------------------
  67. #define IUNKNOWN \
  68. virtual HRESULT __stdcall QueryInterface(const GUID& IID, void **Obj) \
  69. { \
  70. return TInterfacedObject::QueryInterface(IID, (void *)Obj); \
  71. } \
  72. \
  73. virtual ULONG __stdcall AddRef() \
  74. { \
  75. return TInterfacedObject::_AddRef(); \
  76. } \
  77. \
  78. virtual ULONG __stdcall Release() \
  79. { \
  80. return TInterfacedObject::_Release(); \
  81. }
  82. //---------------------------------------------------------------------------
  83. void __fastcall InitializeCustomHelp(ICustomHelpViewer * HelpViewer);
  84. void __fastcall FinalizeCustomHelp();
  85. //---------------------------------------------------------------------------
  86. #endif