delphi中左右翻转窗体(修改EXStyle)

时间:2023-03-08 16:51:14

unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs;

type
  TForm1 = class(TForm)
  private
    { Private declarations }
  public
   procedure Createparams(Var Params:TCreateParams);override;
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}
procedure TForm1.Createparams(var Params:TCreateParams);
//在该事件中翻转窗体
var
  wndParnet:HWND;  //保存桌面句柄
begin
  Inherited CreateParams(Params);
  With Params do
  begin
   EXStyle:=ExStyle or WS_EX_TOPMOST OR WS_EX_ACCEPTFILES or WS_DLGFRAME;
   wndParnet:=GetDesktopWindow; //取得桌面句柄
  end;
end;

end.

http://blog.****.net/diligentcatrich/article/details/7008764