Delphi form missing at the top of the code

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.