Articles   Members Online:
-Article/Tip Search
-News Group Search over 21 Million news group articles.
-Delphi/Pascal
-CBuilder/C++
-C#Builder/C#
-JBuilder/Java
-Kylix
Member Area
-Home
-Account Center
-Top 10 NEW!!
-Submit Article/Tip
-Forums Upgraded!!
-My Articles
-Edit Information
-Login/Logout
-Become a Member
-Why sign up!
-Newsletter
-Chat Online!
-Indexes NEW!!
Employment
-Build your resume
-Find a job
-Post a job
-Resume Search
Contacts
-Contacts
-Feedbacks
-Link to us
-Privacy/Disclaimer
Embarcadero
Visit Embarcadero
Embarcadero Community
JEDI
Links
Minimze and close the application by simple rolling your mouse over the applicat Turn on/off line numbers in source code. Switch to Orginial background IDE or DSP color Comment or reply to this aritlce/tip for discussion. Bookmark this article to my favorite article(s). Print this article
19-Aug-03
Category
Win API
Language
Delphi 3.x
Views
111
User Rating
No Votes
# Votes
0
Replies
0
Publisher:
DSP, Administrator
Reference URL:
DKB
			 Author: Master Tavi

How can I minimize Close the application by rolling my mouse over the system 
controls

Answer:

1   unit Unit1;
2   
3   interface
4   
5   uses
6     Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
7     StdCtrls;
8   
9   type
10    TForm1 = class(TForm)
11      Button1: TButton;
12      procedure Button1Click(Sender: TObject);
13      procedure FormCreate(Sender: TObject);
14    private
15      procedure lik(var Msg: TWMNCHITTEST); message WM_NCHITTEST;
16    public
17      { Public declarations }
18    end;
19  
20  var
21    Form1: TForm1;
22    tx: Boolean;
23  implementation
24  
25  {$R *.DFM}
26  
27  procedure TForm1.lik(var Msg: TWMNCHITTEST);
28  begin
29    inherited; //respond to other commands
30    if tx = true then //check if it's enabled
31    begin
32      if Msg.Result = Windows.HTMINBUTTON then
33        Application.Minimize
34      else if Msg.Result = Windows.HTCLOSE then
35        Close; //make widows to do it
36    end;
37  end;
38  
39  procedure TForm1.Button1Click(Sender: TObject);
40  begin
41    tx := True; //This enables the function
42  end;
43  
44  procedure TForm1.FormCreate(Sender: TObject);
45  begin
46    tx := False; //This disables it
47  end;
48  
49  end.


			
Vote: How useful do you find this Article/Tip?
Bad Excellent
1 2 3 4 5 6 7 8 9 10

 

Advertisement
Share this page
Advertisement
Download from Google

Copyright © Mendozi Enterprises LLC