unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, OleCtrls, SHDocVw;
type
TForm1 = class(TForm)
WebBrowser1: TWebBrowser;
Button1: TButton;
Button2: TButton;
Button3: TButton;
Button4: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private-Deklarationen }
[b][color=#ff0000] procedure WMMoving(var msg : TMessage); message WM_MOVING; [/color][/b]
public
{ Public-Deklarationen }
end;
var
Form1: TForm1;
[color=#0019ff] //LÖSCHEN!!!!!!!!!!!!
TfrmMAIN = class(TForm)
//...
procedure WMMoving(var msg : TMessage); message WM_MOVING;
//...
end;
//LÖSCHEN!!!!!!!!!!!![/color]
implementation
{$R *.dfm}
procedure [color=#ff0000][b]TForm1[/b][/color].WMMoving(var msg : TMessage);
var
rtDragRect : TRect;
begin
rtDragRect := TRect(Pointer(msg.lParam)^);
if (rtDragRect.Top < 0) then begin
rtDragRect.Top := 0;
rtDragRect.Bottom := rtDragRect.Top+self.Height;
end;
if (rtDragRect.Left < 0) then begin
rtDragRect.Left := 0;
rtDragRect.Right := rtDragRect.Left+self.Width;
end;
if (rtDragRect.Bottom > (Screen.Height-1)) then begin
rtDragRect.Bottom := Screen.Height;
rtDragRect.Top := rtDragRect.Bottom-self.Height;
end;
if (rtDragRect.Right > (Screen.Width-1)) then begin
rtDragRect.Right := Screen.Width;
rtDragRect.Left := rtDragRect.Right-self.Width;
end;
TRect(Pointer(msg.lParam)^) := rtDragRect;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
WebBrowser1.Navigate('http://delphipraxis.net');
end;
end.