HdrBldMain.pas 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. unit HdrBldMain;
  2. interface
  3. uses
  4. Windows, Messages, SysUtils, Controls, Forms, Themes, UxTheme;
  5. function FunctionHeaderBuilder(OwnerAppHandle: HWND; sLine: PChar): PChar; stdcall;
  6. implementation
  7. uses
  8. FctHdrBld;
  9. function FunctionHeaderBuilder(OwnerAppHandle: HWND; sLine: PChar): PChar; stdcall;
  10. begin
  11. // leave those important lines here...
  12. // There is a bug with the themes and forms placed in dll
  13. // The dll don't have the time to free the theme handle and the when it does it,
  14. // the hoset application (LuaEdit) already did it so... Runtime Error 216
  15. ThemeServices.ApplyThemeChange;
  16. InitThemeLibrary;
  17. // Create the form first
  18. Application.Handle := OwnerAppHandle;
  19. frmFctHdrBld := TfrmFctHdrBld.Create(nil);
  20. if sLine <> '' then
  21. frmFctHdrBld.ParseLine(StrPas(sLine));
  22. if frmFctHdrBld.ShowModal = mrOk then
  23. begin
  24. Result := PChar(frmFctHdrBld.GetHeader);
  25. end
  26. else
  27. Result := '';
  28. FreeAndNil(frmFctHdrBld);
  29. // leave those important lines here...
  30. // There is a bug with the themes and forms placed in dll
  31. // The dll don't have the time to free the theme handle and the when it does it,
  32. // the hoset application (LuaEdit) already did it so... Runtime Error 216
  33. ThemeServices.ApplyThemeChange;
  34. FreeThemeLibrary;
  35. end;
  36. end.