Tools.h 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. //---------------------------------------------------------------------------
  2. #ifndef ToolsH
  3. #define ToolsH
  4. #include <comctrls.hpp>
  5. #include <WinInterface.h>
  6. #include <HelpIntfs.hpp>
  7. #include <WinHelpViewer.hpp>
  8. //---------------------------------------------------------------------------
  9. void __fastcall CenterFormOn(TForm * Form, TControl * CenterOn);
  10. bool __fastcall ExecuteShellAndWait(const AnsiString Path, const AnsiString Params);
  11. bool __fastcall ExecuteShellAndWait(const AnsiString Command);
  12. void __fastcall CreateDesktopShortCut(const AnsiString &Name,
  13. const AnsiString &File, const AnsiString & Params, const AnsiString & Description,
  14. int SpecialFolder = -1);
  15. AnsiString __fastcall GetListViewStr(TListView * ListView);
  16. void __fastcall LoadListViewStr(TListView * ListView, AnsiString LayoutStr);
  17. void __fastcall RestoreForm(AnsiString Data, TForm * Form);
  18. AnsiString __fastcall StoreForm(TCustomForm * Form);
  19. void __fastcall RestoreFormSize(AnsiString Data, TForm * Form);
  20. AnsiString __fastcall StoreFormSize(TForm * Form);
  21. TFontStyles __fastcall IntToFontStyles(int value);
  22. int __fastcall FontStylesToInt(const TFontStyles value);
  23. void __fastcall ValidateMaskEdit(TComboBox * Edit);
  24. void __fastcall ValidateMaskEdit(TEdit * Edit);
  25. void __fastcall OpenBrowser(AnsiString URL);
  26. bool __fastcall IsFormatInClipboard(unsigned int Format);
  27. bool __fastcall TextFromClipboard(AnsiString & Text);
  28. HANDLE __fastcall OpenTextFromClipboard(const char *& Text);
  29. void __fastcall CloseTextFromClipboard(HANDLE Handle);
  30. void __fastcall ExitActiveControl(TForm * Form);
  31. AnsiString __fastcall ReadResource(const AnsiString ResName);
  32. bool __fastcall DumpResourceToFile(const AnsiString ResName,
  33. const AnsiString FileName);
  34. TOpenDialog * __fastcall CreateOpenDialog(TComponent * AOwner);
  35. void __fastcall BrowseForExecutable(TEdit * Control, AnsiString Title,
  36. AnsiString Filter, bool FileNameCommand, bool Escape);
  37. void __fastcall BrowseForExecutable(TComboBox * Control, AnsiString Title,
  38. AnsiString Filter, bool FileNameCommand, bool Escape);
  39. bool __fastcall FontDialog(TFont * Font);
  40. bool __fastcall SaveDialog(AnsiString Title, AnsiString Filter,
  41. AnsiString DefaultExt, AnsiString & FileName);
  42. bool __fastcall AutodetectProxyUrl(AnsiString & Proxy);
  43. bool __fastcall IsWin64();
  44. void __fastcall CopyToClipboard(AnsiString Text);
  45. void __fastcall CopyToClipboard(TStrings * Strings);
  46. void __fastcall ShutDownWindows();
  47. //---------------------------------------------------------------------------
  48. #define IUNKNOWN \
  49. virtual HRESULT __stdcall QueryInterface(const GUID& IID, void **Obj) \
  50. { \
  51. return TInterfacedObject::QueryInterface(IID, (void *)Obj); \
  52. } \
  53. \
  54. virtual ULONG __stdcall AddRef() \
  55. { \
  56. return TInterfacedObject::_AddRef(); \
  57. } \
  58. \
  59. virtual ULONG __stdcall Release() \
  60. { \
  61. return TInterfacedObject::_Release(); \
  62. }
  63. //---------------------------------------------------------------------------
  64. void __fastcall InitializeCustomHelp(ICustomHelpViewer * HelpViewer);
  65. void __fastcall FinalizeCustomHelp();
  66. //---------------------------------------------------------------------------
  67. #endif