<div dir="ltr">2013/10/5 silvioprog <span dir="ltr"><<a href="mailto:silvioprog@gmail.com" target="_blank">silvioprog@gmail.com</a>></span><br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div dir="ltr"><div>uses</div><div> unit2;</div><div><br></div><div>procedure TForm1.Button1Click(Sender: TObject);</div><div>begin</div><div> Form2 := TForm2.Create(Self);</div><div> Form2.ShowModal;</div><div> Form2.Free;</div>
<div>end;</div><div class="gmail_extra"><div><br></div><div>---</div><div><br></div><div><div>uses</div><div> Windows;</div><div><br></div><div>procedure TForm2.FormShow(Sender: TObject);</div><div>begin</div><div> SetWindowLong(Handle, GWL_STYLE,</div>
<div> GetWindowLong(Handle, GWL_STYLE) and (not WS_CAPTION));</div><div> SetWindowPos(Handle, HWND_TOPMOST, 0, 0, 0, 0,</div><div> SWP_DRAWFRAME or SWP_NOMOVE or SWP_NOSIZE);</div><div>end;</div></div></div></div>
</blockquote><div><br></div><div>In mainform:</div><div><br></div><div><div>unit Unit1;</div><div><br></div><div>{$mode objfpc}{$H+}</div><div><br></div><div>interface</div><div><br></div><div>uses</div><div> Windows, Forms;</div>
<div><br></div><div>type</div><div><br></div><div> { TForm1 }</div><div><br></div><div> TForm1 = class(TForm)</div><div> procedure FormShow(Sender: TObject);</div><div> private</div><div> procedure WMNCHitTest(var Msg: TMessage); message WM_NCHITTEST;</div>
<div> end;</div><div><br></div><div>var</div><div> Form1: TForm1;</div><div><br></div><div>implementation</div><div><br></div><div>{$R *.lfm}</div><div><br></div><div>procedure TForm1.FormShow(Sender: TObject);</div><div>
begin</div><div> SetWindowLong(Handle, GWL_STYLE, WS_OVERLAPPEDWINDOW and (not WS_CAPTION));</div><div> SetWindowPos(Handle, HWND_TOPMOST, 0, 0, 0, 0, SWP_DRAWFRAME or</div><div> SWP_NOMOVE or SWP_NOSIZE);</div><div>
end;</div><div><br></div><div>procedure TForm1.WMNCHitTest(var Msg: TMessage);</div><div>begin</div><div> inherited;</div><div> case Msg.Result of</div><div> HTTOP: Msg.Result := HTCLIENT;</div><div> HTTOPLEFT: Msg.Result := HTCLIENT;</div>
<div> HTTOPRIGHT: Msg.Result := HTCLIENT;</div><div> HTBOTTOM: Msg.Result := HTCLIENT;</div><div> HTBOTTOMLEFT: Msg.Result := HTCLIENT;</div><div> HTBOTTOMRIGHT: Msg.Result := HTCLIENT;</div><div> HTLEFT: Msg.Result := HTCLIENT;</div>
<div> HTRIGHT: Msg.Result := HTCLIENT;</div><div> end;</div><div>end;</div><div><br></div><div>end.</div></div><div><br></div></div>-- <br>Silvio Clécio<br>My public projects - <a href="http://github.com/silvioprog" target="_blank">github.com/silvioprog</a>
</div></div>