Unit ufrmsyspubmessage;
Interface
Uses
Windows, Forms, Messages, Classes, Extctrls, Controls, Stdctrls;
Type
Tfrmsyspubmessage = Class (Tform)
Image1:timage;
Lblmessage:tlabel;
Procedure Formcreate (Sender:tobject);
Protected
Iconid:pchar;
Public
Procedure WndProc (var msg:tmessage); Override
Procedure ShowMessage (amsg:string);
End
Implementation
{$R *. DFM}
{Tfrmmessageform}
Procedure Tfrmsyspubmessage.showmessage (amsg:string);
Var
Tempwidth:integer;
Begin
lblMessage.Caption: = amsg;
Application.processmessages;
Adjust form width
Tempwidth: = lblmessage.width + Lblmessage.left + image1.left;
If Tempwidth < 310 then
Tempwidth: = 310;
Width: = Tempwidth;
If not Visible then
Show;
Application.processmessages;
Formstyle: = Fsstayontop;
End
Procedure Tfrmsyspubmessage.formcreate (Sender:tobject);
Begin
inherited;
iconID: = Idi_asterisk;
Image1.Picture.Icon.Handle: = LoadIcon (0, iconID);
Keep this form at the top so that other forms will not block it
SetWindowPos (Handle, hwnd_topmost, 0, 0, 0, 0, swp_nomove Or swp_nosize);
End
Procedure Tfrmsyspubmessage.wndproc (var msg:tmessage);
Begin
Shielded Alt+f4
If Msg.wparam <> Sc_close Then
inherited;
End
End.
Delphi form missing at the top of the code