Marco Web Center |
Home: Code Repository: Mastering Delphi 5Project NOTITLE
Project StructureNOTITLE.DPRprogram NoTitle; uses Forms, NoTitleF in 'NoTitleF.pas' {Form1}; {$R *.RES} begin Application.CreateForm(TForm1, Form1); Application.Run; end. NOTITLEF.PASunit NoTitleF; interface uses SysUtils, Windows, Messages, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls; type TForm1 = class(TForm) Label1: TLabel; Button1: TButton; Label2: TLabel; procedure Button1Click(Sender: TObject); private { Private declarations } public procedure CreateParams (var Params: TCreateParams); override; procedure HitTest (var Msg: TWmNcHitTest); message wm_NcHitTest; end; var Form1: TForm1; implementation {$R *.DFM} procedure TForm1.CreateParams (var Params: TCreateParams); begin inherited CreateParams (Params); Params.Style := (Params.Style or ws_Popup) and not ws_Caption; end; procedure TForm1.HitTest(var Msg: TWmNcHitTest); begin inherited; if (Msg.Result = htClient) and (Msg.YPos < Label1.Height + Top + GetSystemMetrics (sm_cyFrame)) then Msg.Result := htCaption; end; procedure TForm1.Button1Click(Sender: TObject); begin Close; end; end. NOTITLEF.DFMobject Form1: TForm1 Left = 200 Top = 108 Width = 378 Height = 239 Caption = 'Form1' Color = clBtnFace Constraints.MinHeight = 100 Constraints.MinWidth = 200 Font.Charset = DEFAULT_CHARSET Font.Color = clWindowText Font.Height = -11 Font.Name = 'MS Sans Serif' Font.Style = [] OldCreateOrder = True PixelsPerInch = 96 TextHeight = 13 object Label1: TLabel Left = 0 Top = 0 Width = 370 Height = 21 Align = alTop Alignment = taCenter AutoSize = False Caption = 'NoTitle' Color = clNavy Font.Charset = DEFAULT_CHARSET Font.Color = clYellow Font.Height = -13 Font.Name = 'MS Sans Serif' Font.Style = [fsBold] ParentColor = False ParentFont = False end object Label2: TLabel Left = 24 Top = 48 Width = 140 Height = 13 Caption = 'Drag title bar to move window' end object Button1: TButton Left = 353 Top = 2 Width = 17 Height = 17 Anchors = [akTop, akRight] Caption = 'X' Font.Charset = DEFAULT_CHARSET Font.Color = clWindowText Font.Height = -11 Font.Name = 'MS Sans Serif' Font.Style = [fsBold] ParentFont = False TabOrder = 0 TabStop = False OnClick = Button1Click end end
|
||
© Copyright Marco Cantù, 1995-2020, All rights reserved |