Hide the window caption
If you want to prevent the user to move a window you have to hide the caption. This is done by changing the window attributes in the FormCreate event. Its also possible to set the property BorderStyle to ‘bsNone’, but than the window has no frame at all.
procedure TForm1.FormCreate(Sender: TObject);
begin
SetWindowLong(Handle, GWL_STYLE, GetWindowLong(Handle,GWL_STYLE) AND
NOT WS_CAPTION);
ClientHeight := Height;
Refresh;
end;
This code is disableing the flag WS_CAPTION in the window attributes.
The SetWindowLong function changes an attribute of the specified window. The function also sets a 32-bit (long) value at the specified offset into the extra window memory of a window.
LONG SetWindowLong(
HWND hWnd,   // handle of window
int nIndex,   // offset of value to set
LONG dwNewLong    // new value
);
Use this to close all open Internet Explorer windows. ...
Hide the titlebar. Procedure TForm1.HideTitlebar; var ...
Feature overview: - Office 2007 checkbox & ra...
Get the current directory. procedure TForm1.Button...
If you need to get windows temporary folder for your applica...
Thursday 15 Feb 2007 | Delphi Tutorial | Forms