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
How can I use Windows Message and what are they? 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
17-Aug-03
Category
Win API
Language
Delphi 3.x
Views
132
User Rating
No Votes
# Votes
0
Replies
0
Publisher:
DSP, Administrator
Reference URL:
DKB
			Author: Master Tavi 

How can I use Windows Message and what are they?

Answer:

Hey there manny people are asking what are Windows Messages let's say the Windows 
Messages are the heart of every Windows.Your application interactionates with other 
Windows using messages. 

You can send or recive messages from the Windows operating systems. 

Here is how to send 

1   var
2     yopos: Hwnd;
3   {...}
4   yopos := FindWindow(nil, 'program Manager');
5   ShowWindow(yopos, SW_HIDE);
6   {...}
7   
8   //you can use instead SW_SHOW,SW_MINIMIZE,SW_RESTORE etc; 
9   
10  //here is how to close a window 
11  
12  SendMessage(Application.Handle, WM_CLOSE, 0, 0);
13  
14  //There are many examples to give but... 
15  
16  //The most popular Windows Messages are: 
17  
18  WM_ACTIVATE: result := 'WM_ACTIVATE             ';
19  WM_ACTIVATEAPP: result := 'WM_ACTIVATEAPP          ';
20  WM_ASKCBFORMATNAME: result := 'WM_ASKCBFORMATNAME      ';
21  WM_CANCELMODE: result := 'WM_CANCELMODE           ';
22  WM_CHANGECBCHAIN: result := 'WM_CHANGECBCHAIN        ';
23  WM_CHAR: result := 'WM_CHAR                 ';
24  WM_CHARTOITEM: result := 'WM_CHARTOITEM           ';
25  WM_CHILDACTIVATE: result := 'WM_CHILDACTIVATE        ';
26  WM_CLEAR: result := 'WM_CLEAR                ';
27  WM_CLOSE: result := 'WM_CLOSE                ';
28  WM_COMMAND: result := 'WM_COMMAND              ';
29  WM_COMMNOTIFY: result := 'WM_COMMNOTIFY           ';
30  WM_COMPACTING: result := 'WM_COMPACTING           ';
31  WM_COMPAREITEM: result := 'WM_COMPAREITEM          ';
32  WM_COPY: result := 'WM_COPY                 ';
33  WM_CREATE: result := 'WM_CREATE               ';
34  WM_CTLCOLOR: result := 'WM_CTLCOLOR             ';
35  WM_CUT: result := 'WM_CUT                  ';
36  WM_DDE_ACK: result := 'WM_DDE_ACK              ';
37  WM_DDE_ADVISE: result := 'WM_DDE_ADVISE           ';
38  WM_DDE_DATA: result := 'WM_DDE_DATA             ';
39  WM_DDE_EXECUTE: result := 'WM_DDE_EXECUTE          ';
40  WM_DDE_INITIATE: result := 'WM_DDE_INITIATE         ';
41  WM_DDE_POKE: result := 'WM_DDE_POKE             ';
42  WM_DDE_REQUEST: result := 'WM_DDE_REQUEST          ';
43  WM_DDE_TERMINATE: result := 'WM_DDE_TERMINATE        ';
44  WM_DDE_UNADVISE: result := 'WM_DDE_UNADVISE         ';
45  WM_DEADCHAR: result := 'WM_DEADCHAR             ';
46  WM_DELETEITEM: result := 'WM_DELETEITEM           ';
47  WM_DESTROY: result := 'WM_DESTROY              ';
48  WM_DESTROYCLIPBOARD: result := 'WM_DESTROYCLIPBOARD     ';
49  WM_DEVMODECHANGE: result := 'WM_DEVMODECHANGE        ';
50  WM_DRAWCLIPBOARD: result := 'WM_DRAWCLIPBOARD        ';
51  WM_DRAWITEM: result := 'WM_DRAWITEM             ';
52  WM_DROPFILES: result := 'WM_DROPFILES            ';
53  WM_ENABLE: result := 'WM_ENABLE               ';
54  WM_ENDSESSION: result := 'WM_ENDSESSION           ';
55  WM_ENTERIDLE: result := 'WM_ENTERIDLE            ';
56  WM_ERASEBKGND: result := 'WM_ERASEBKGND           ';
57  WM_FONTCHANGE: result := 'WM_FONTCHANGE           ';
58  WM_GETDLGCODE: result := 'WM_GETDLGCODE           ';
59  WM_GETFONT: result := 'WM_GETFONT              ';
60  WM_GETMINMAXINFO: result := 'WM_GETMINMAXINFO        ';
61  WM_GETTEXT: result := 'WM_GETTEXT              ';
62  WM_GETTEXTLENGTH: result := 'WM_GETTEXTLENGTH        ';
63  WM_HSCROLL: result := 'WM_HSCROLL              ';
64  WM_HSCROLLCLIPBOARD: result := 'WM_HSCROLLCLIPBOARD     ';
65  WM_ICONERASEBKGND: result := 'WM_ICONERASEBKGND       ';
66  WM_INITDIALOG: result := 'WM_INITDIALOG           ';
67  WM_INITMENU: result := 'WM_INITMENU             ';
68  WM_INITMENUPOPUP: result := 'WM_INITMENUPOPUP        ';
69  WM_KEYDOWN: result := 'WM_KEYDOWN              ';
70  WM_KEYUP: result := 'WM_KEYUP                ';
71  WM_KILLFOCUS: result := 'WM_KILLFOCUS            ';
72  WM_LBUTTONDBLCLK: result := 'WM_LBUTTONDBLCLK        ';
73  WM_LBUTTONDOWN: result := 'WM_LBUTTONDOWN          ';
74  WM_LBUTTONUP: result := 'WM_LBUTTONUP            ';
75  WM_MBUTTONDBLCLK: result := 'WM_MBUTTONDBLCLK        ';
76  WM_MBUTTONDOWN: result := 'WM_MBUTTONDOWN          ';
77  WM_MBUTTONUP: result := 'WM_MBUTTONUP            ';
78  WM_MDIACTIVATE: result := 'WM_MDIACTIVATE          ';
79  WM_MDICASCADE: result := 'WM_MDICASCADE           ';
80  WM_MDICREATE: result := 'WM_MDICREATE            ';
81  WM_MDIDESTROY: result := 'WM_MDIDESTROY           ';
82  WM_MDIGETACTIVE: result := 'WM_MDIGETACTIVE         ';
83  WM_MDIICONARRANGE: result := 'WM_MDIICONARRANGE       ';
84  WM_MDIMAXIMIZE: result := 'WM_MDIMAXIMIZE          ';
85  WM_MDINEXT: result := 'WM_MDINEXT              ';
86  WM_MDIRESTORE: result := 'WM_MDIRESTORE           ';
87  WM_MDISETMENU: result := 'WM_MDISETMENU           ';
88  WM_MDITILE: result := 'WM_MDITILE              ';
89  WM_MEASUREITEM: result := 'WM_MEASUREITEM          ';
90  WM_MENUCHAR: result := 'WM_MENUCHAR             ';
91  WM_MENUSELECT: result := 'WM_MENUSELECT           ';
92  WM_MOUSEACTIVATE: result := 'WM_MOUSEACTIVATE        ';
93  WM_MOUSEMOVE: result := 'WM_MOUSEMOVE            ';
94  WM_MOVE: result := 'WM_MOVE                 ';
95  WM_NCACTIVATE: result := 'WM_NCACTIVATE           ';
96  WM_NCCALCSIZE: result := 'WM_NCCALCSIZE           ';
97  WM_NCCREATE: result := 'WM_NCCREATE             ';
98  WM_NCDESTROY: result := 'WM_NCDESTROY            ';
99  WM_NCHITTEST: result := 'WM_NCHITTEST            ';
100 WM_NCLBUTTONDBLCLK: result := 'WM_NCLBUTTONDBLCLK      ';
101 WM_NCLBUTTONDOWN: result := 'WM_NCLBUTTONDOWN        ';
102 WM_NCLBUTTONUP: result := 'WM_NCLBUTTONUP          ';
103 WM_NCMBUTTONDBLCLK: result := 'WM_NCMBUTTONDBLCLK      ';
104 WM_NCMBUTTONDOWN: result := 'WM_NCMBUTTONDOWN        ';
105 WM_NCMBUTTONUP: result := 'WM_NCMBUTTONUP          ';
106 WM_NCMOUSEMOVE: result := 'WM_NCMOUSEMOVE          ';
107 WM_NCPAINT: result := 'WM_NCPAINT              ';
108 WM_NCRBUTTONDBLCLK: result := 'WM_NCRBUTTONDBLCLK      ';
109 WM_NCRBUTTONDOWN: result := 'WM_NCRBUTTONDOWN        ';
110 WM_NCRBUTTONUP: result := 'WM_NCRBUTTONUP          ';
111 WM_NEXTDLGCTL: result := 'WM_NEXTDLGCTL           ';
112 WM_PAINT: result := 'WM_PAINT                ';
113 WM_PAINTCLIPBOARD: result := 'WM_PAINTCLIPBOARD       ';
114 WM_PALETTECHANGED: result := 'WM_PALETTECHANGED       ';
115 WM_PALETTEISCHANGING: result := 'WM_PALETTEISCHANGING    ';
116 WM_PARENTNOTIFY: result := 'WM_PARENTNOTIFY         ';
117 WM_PASTE: result := 'WM_PASTE                ';
118 WM_POWER: result := 'WM_POWER                ';
119 WM_QUERYDRAGICON: result := 'WM_QUERYDRAGICON        ';
120 WM_QUERYENDSESSION: result := 'WM_QUERYENDSESSION      ';
121 WM_QUERYNEWPALETTE: result := 'WM_QUERYNEWPALETTE      ';
122 WM_QUERYOPEN: result := 'WM_QUERYOPEN            ';
123 WM_QUEUESYNC: result := 'WM_QUEUESYNC            ';
124 WM_QUIT: result := 'WM_QUIT                 ';
125 WM_RBUTTONDBLCLK: result := 'WM_RBUTTONDBLCLK        ';
126 WM_RBUTTONDOWN: result := 'WM_RBUTTONDOWN          ';
127 WM_RBUTTONUP: result := 'WM_RBUTTONUP            ';
128 WM_RENDERALLFORMATS: result := 'WM_RENDERALLFORMATS     ';
129 WM_RENDERFORMAT: result := 'WM_RENDERFORMAT         ';
130 WM_SETCURSOR: result := 'WM_SETCURSOR            ';
131 WM_SETFOCUS: result := 'WM_SETFOCUS             ';
132 WM_SETFONT: result := 'WM_SETFONT              ';
133 WM_SETREDRAW: result := 'WM_SETREDRAW            ';
134 WM_SETTEXT: result := 'WM_SETTEXT              ';
135 WM_SHOWWINDOW: result := 'WM_SHOWWINDOW           ';
136 WM_SIZE: result := 'WM_SIZE                 ';
137 WM_SIZECLIPBOARD: result := 'WM_SIZECLIPBOARD        ';
138 WM_SPOOLERSTATUS: result := 'WM_SPOOLERSTATUS        ';
139 WM_SYSCHAR: result := 'WM_SYSCHAR              ';
140 WM_SYSCOLORCHANGE: result := 'WM_SYSCOLORCHANGE       ';
141 WM_SYSCOMMAND: result := 'WM_SYSCOMMAND           ';
142 WM_SYSDEADCHAR: result := 'WM_SYSDEADCHAR          ';
143 WM_SYSKEYDOWN: result := 'WM_SYSKEYDOWN           ';
144 WM_SYSKEYUP: result := 'WM_SYSKEYUP             ';
145 WM_SYSTEMERROR: result := 'WM_SYSTEMERROR          ';
146 WM_TIMECHANGE: result := 'WM_TIMECHANGE           ';
147 WM_TIMER: result := 'WM_TIMER                ';
148 WM_UNDO: result := 'WM_UNDO                 ';
149 WM_USER: result := 'WM_USER                 ';
150 WM_VKEYTOITEM: result := 'WM_VKEYTOITEM           ';
151 WM_VSCROLL: result := 'WM_VSCROLL              ';
152 WM_VSCROLLCLIPBOARD: result := 'WM_VSCROLLCLIPBOARD     ';
153 WM_WINDOWPOSCHANGED: result := 'WM_WINDOWPOSCHANGED     ';
154 WM_WINDOWPOSCHANGING: result := 'WM_WINDOWPOSCHANGING    ';
155 WM_WININICHANGE: result := 'WM_WININICHANGE         ';

You can use these messages using this example: 

156 private
157 
158 procedure lik(var Msg: TWMNCHITTEST); message WM_NCHITTEST;
159 public
160 
161 procedure TForm1.lik(var Msg: TWMNCHITTEST);
162 begin
163   inherited;
164   if tx = true then
165   begin
166     if Msg.Result = Windows.HTMINBUTTON then
167       Application.Minimize
168     else if Msg.Result = Windows.HTCLOSE then
169       Close;
170   end;
171 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