home *** CD-ROM | disk | FTP | other *** search
/ Delphi Magazine Collection 2001 / Delphi Magazine Collection 20001 (2001).iso / DISKS / Issue64 / Clinic / FixCodeParams.pas next >
Encoding:
Pascal/Delphi Source File  |  2000-10-18  |  1.2 KB  |  44 lines

  1. unit FixCodeParams;
  2.  
  3. //This unit fixes the problem of the Code Parameters window not appearing
  4. // 1) Add this unit to a new package (File | New... | Package)
  5. // 2) Install the package (press the package editor's Install button).
  6. //    The problem will now be fixed.
  7. // 3) Uninstall the package (Component | Install Packages...,
  8. //    select the package from the list and press Remove)
  9.  
  10. interface
  11.  
  12. procedure Register;
  13.  
  14. implementation
  15.  
  16. uses
  17.   Windows, Controls, SysUtils, Forms;
  18.  
  19. procedure Register;
  20. var
  21.   I: Integer;
  22.   R: TRect;
  23.   CodeParams: TCustomControl;
  24. begin
  25.   for I := 0 to Application.ComponentCount - 1 do
  26.   begin
  27.     if (CompareText(Application.Components[I].Name, 'CodeParamWindow') = 0) and
  28.        (CompareText(Application.Components[I].ClassName, 'TTokenWindow') = 0) then
  29.     begin
  30.       CodeParams := Application.Components[I] as TCustomControl;
  31.       GetWindowRect(CodeParams.Handle, R);
  32.       SetWindowPos(CodeParams.Handle, HWND_TOP,
  33.         R.Left, R.Top, R.Right - R.Left, R.Bottom - R.Top,
  34.         SWP_NOACTIVATE);
  35.       SetWindowPos(CodeParams.Handle, HWND_TOPMOST,
  36.         R.Left, R.Top, R.Right - R.Left, R.Bottom - R.Top,
  37.         SWP_NOACTIVATE);
  38.       Break
  39.     end
  40.   end;
  41. end;
  42.  
  43. end.
  44.