Appendix B message, control notification, and message image macro
B .1 some common window messages
Description of parameters of the w m command
W m c r e at e sends this message, telling the window to initialize itself to send l p a r a m to C r e at e S t r u c t, which contains
C r e a t e window () parameter; When Initialization is successful
0 should be returned
W m I n I t d I a l o g sends this message, telling the dialog box to initialize itself; send W P a r a m is the control window that receives the initial focus
After w m c r e at E message and in all pair handles, l p a r a m is createdialogparam ()
Optional parameters that are sent after the control is created in the dialog box
W m g e t m I n m a x I n f o sends this message, indicates that the window is about to be re-tuned to the window and the l p a r a m points to a m I n m a x I n f O structure,
The maximum or minimum size that must be maintained for the port. It allows the window to set its minimum and maximum sizes.
W m s I Z e sends this message, telling a window that the size of the sent W P a r A M is a flag to distinguish window
Maximize, minimize, or just reset the size.
L p a r a m tells the size of the new window
W m Pa I n t send this message, telling the window to draw its customer zone W P a r a m is the drawing device Environment
W m d e S t r o y send this message, telling a window to resend all w p a r a m and l p a r a m is not used
Anything on board
W m n C r e at e sends this message, telling a window that is initializing the phase used by non-sending l p a r a m to w m _ c r e at E
Same C r e at e S t r u c t structure in customer Zone
W m n c d e S t r o y sends this message, telling a window that w p a r a m and l p a r a m are not in use in a non-customer Zone
Destroyed
W m n c pa I n t send this message, telling a window to draw its non-sending W P a r A M has a painting area handle, Region
The customer zone is described in Chapter 4th.
W m e r a s e B K g n d send this message, telling a window to erase the background to send W P a r a m specifies the device environment to be erased (
Drawn and filled rectangles)
W m s h o w I n d o W send this message, tell the window to show or hide your own hair if W P a r a m is not 0, the window is displayed
W m e n a B l e sends this message, telling a window to enable or disable sending. If W P a r a m is not 0, the window is enabled.
Yourself
W m I n I t m e n u p o p u p send this message, tell the window its system menu or send W P a r A M has the handle of the menu object, l p a r a m's
The main menu will be opened with the low-level word to indicate the sub-menu position, if l P a r a m's
If the value is not 0, the system menu is displayed.
W m h e l p sends this message, telling a window that the F1 key has been pressed and issued l p a r a m contains a pointer of an h e l p I n f O structure,
Structure contains the help needed to process context
Information
W m o u s e m o v e when the mouse moves to its customer zone, it is sent to a hair w p a r a m to indicate whether there is a keyboard s h I f t -c t r l-a l t
When the window key is pressed, l p a r a m indicates
New cursor position
W m l B u t to n d o W n when the left mouse button is pressed in the customer area, the sent and sent are the same as W M O U S E M O V E
To this window
W m l B u t to n u p. When the left mouse button is released in the customer area of the window, it is the same as W M O U S E M O V E
Sent to this window
(Continued)
Description of parameters of the w m command
W m l B u t to n d B L C L K when the left mouse button is double-clicked in the customer area, the sent mail is the same as w m o u s e m o v e, but note that,
To this window, There is no window in the c s _ d B L C l k s window class style.
Do not accept messages in this window
W m r B u t to n d o W n hair is the same as w m l B u t to n d B L C L K, but this is the same as w m o u s e m o v e, but here is
W m r B u t to n u p is right-click and right-click
W m r B u t to n d B L C L K
W m k e y d o W n when a key is pressed, it is sent to the owner key w p a r a m contains virtual key Code , L P a r a m package
Disk focus window-except that the l t key is pressed and the c t r l sends additional key data
When the key is not pressed
W m k e y u p when a key is released, it is sent to the same with w m k e y d o W n
Disk focus window-except that the l t key is pressed, the C T R L
When the key is not pressed
W m c h a r is sent in w m k e y d o W n message is translated into a press w p a r a m contains this character, l p a r a m and w m _ k e y-
When the key character is sent to the window, d o W n is the same
B .2 control notification instance
B .2.1 wm_xxx control notification
Notifications sent by the Control Window
Send w m when a control key or any sub-window is created, destroyed, or clicked
R e n t n o t I f y window style sub-window _ pa r e n t n o t I f y notification to tell parent window
Buttons, combos, and ListBox are used to access w m _ c t l c o l r, w m _ d r Aw I T E M, W M _ m e a s u r e I t e m,
W m _ d e l e t e I t e m, w m _ c h a RTO I t e m, w m _ v k e y to I t e m and
W m c o m pa r e I t E M notifications are sent to the parent window to tell where to draw controls
Scroll bar notification is w m h s c r o l, w m v s c r o l
B .2.2 wm_command control notification
Notifications sent by the Control Window
Static notification includes: s t n c l I c k e d, s t n d B l c l k, s t n e n a B l e, s t n d I s a B L E
Button notifications include: B n c l I c k e d, B n PA I n t, B n d I s a B l e, B n p u s h e d, B n u n p u s h e d,
B n d B l c l k, B n s e t f o c u s, B n k I l f o c u s
Editable notifications include: e n _ s e t f o c u s, e n _ k I l f o C U S, e n _ c h a N G E, E N _ u p d At e,
E n e r s Pa c e, e n m a X t e x T, e n h s c r o l, e n v s c r o l
Notification for The ListBox includes: l B n s e l c h a n g e, l B n d B l c l k, l B n s e l c a n c e l, L B N S e t f o c u s,
L B n k I l f o c u s
The notification for a combo box includes: c B n s e l c h a n g e, c B n d B l c l k, c B n s e t f o c u s, c B n k I l f o c u s,
C B n _ e d I t c h a n g e, c B n _ e d I t u p D at E, c B N _ D R o p D O W n, c B N _ c l o s e u p,
C B n s e l e n d o k, C B N S E L E N D C A N C E L
324 Part 5 Appendix
Download
B .2.3 wm_notify control notification
Notifications sent by the Control Window
Animation, progress indicator slider indicator only available: n m o u to f m e m o ry
The fine-tuning button only provides: n m o u to f m e m o ry and u d n d e lta p o s. For notifications of u d n d e LTA p o s,
N m h d r is the header pointing to n m u P d o W n Structure
The tab only provides: n m _ o u to f m e m o ry, t C n _ k e y d o W n, t C n _ s e l c h a n g e,
T c n _ s e l c h a n g I n g. When the notification is t C n _ k e y d o W n, n m h d r is pointing
N m t c k e y d o W n structure Header
The Tree View control only provides: t v n _ s e l c h a n g I n g, t v n _ s e l c h a n g e d, t v n _ g e t d I s p I n f o,
T v n _ s e t d I s p I n f o, t v n _ I t e m e x pa n d I n g, t v n _ I t e m e x pa n d e d,
T v n _ B e g I n d r a G, t v n _ B e g I n r d r a g, t v n _ d e l e t e I t e m,
T v n B e g I n l a B e l e d I t, t v n e n d l a B e l e d I t
Only general notification messages are provided: n m _ o u to f m e m o ry, n m _ c l I c k, n m _ d B L C L K,
N m _ r e t u r n, n M _ r c l I c k, n m _ r d B L C L K, N M _ s e t f o C u s,
N m k I l f o C U S, N M C U S to M D R aw, N M H O V E R
Based on the sent notifications only, the n m h d r structure can be one of the following structures: n m T v d I s p I n f o,
N m t v k e y d o W n, n m t v c u s to m d r aw
The list control only provides: LV n I t e m c h a n g I n g, LV n I t e m c h a n g e d, LV n I n s e rt I t e m,
Lv n _ d e l e t e I t e m, lv n _ d e l e t e a L I t E M S, LV N _ C O L u m n c l I C K,
Lv n _ B e g I n d r a G, lv n _ B e g I n r a G, lv n _ o d c a c h e h I n t,
Lv n _ I t e m a c t I vat e, lv n _ o d s tat e c h a n g e d, lv n _ o d f I n d I t e m,
Lv n _ B e g I n l a B e l e d I t, lv n _ e n d l a B e l e d I t, LV N _ g e t d I s p I n f o,
Lv n s e t d I s p I n f o, LV n k e y d o W n, LV n m a r q u e B e g I n
Only the notification messages listed above are provided.
Based on the sent notifications only, the n m h d r structure can be one of the following structures: n m LV d I s p I n f o,
N m lv k e y d o W n
B .2.4 control window with wm_command and wm_y y Control notifications
Notifications sent by the Control Window
Notifications for the multi-Info edit series w m n o t I f y Control: e n m s g f I lt e r, e n r e q u e S t r e s I Z E, E N S E L C H a N G E,
E n _ d r o p f I L E S, e n _ p r o t e c t e d, e n _ c o r e c t e x T, e n _ s to P n o u n d o,
E n _ I m e c h a n g e, e n _ s AV e c l I p B o a r d, e n _ o l e o p fa I L e d,
E n o B j e c t p o s I t I o n s, e n l I n k, e n d r a G D R o p d o n e
B .3 window message image macro
Appendix B message, control notification, and message image macro 325
Download
Macro
O n _ m e s a g e (w m _ x, H a n d l e r)
For example:
O n _ m e s a g e (w m _ c r e at E, m y
H A n d l e r)
O n m e s a g e (w m Pa I n t, m y h a n
D l e r)
O n w m x
For example:
O n w m c r e at E ()
O n w m D e S t r o y ()
Description
Any window message can be processed.
W m _ x is the value of any window message,
H A n d l e r can be any name
Each standard window message can belong to it.
Its own macro, it has no parameters, and its
Name and use its w m x Design
Message Processing function call Parameters
L r e s u lt handler (wpa r a m
W p a r a m, L Param lparam)
Yes
Onxxx (Message specific) (because the parameter is
For specific messages, it is best to add class wi Z A R D
Add these macros to the Message image)
B .4 ing message
B .5 command and notification message
Macro description of message processing function call Parameters
On_command (ID, Handler) This macro makes w m c o m a n d message refers to void handler ()
To the processing function, here I d is the command I d
O n c o m a n d r a n g e (I D, in addition to allowing the message processing function to process a connected void handler (uint ID)
Command I d outside the range of idlast, Handler), which is the same as the above
326 Part 5 Appendix
Download
Macro
W m c t l c o l o r e f l e c t ()
W m d r Aw I T E M r e f l e c t ()
W m e a s u r e I t E M r e f l e c t ()
W m d e l e t e I t E M r e f l e c t ()
W m c h a RTO I t E M r e f l e c t ()
W m v k e y to I t E M r e f l e c t ()
W m c o m pa r e I t E M r e f l e c t ()
W m h s c r o l r e f l e c t ()
W m v s c r o l r e f l e c t ()
W m pa r e n t n o t I f y R E L E c t ()
O n _ c o n t r o l _ r e f l e c t (n C o d e,
H A n d l e r)
O n C o n t r o l r e f l e c t e x (n C o d e,
H A n d l e r)
O n o t I f y R E F L E c t (n C o d e, H a n d l e r)
O n _ n o t I f y _ R E F L E C T _ e x (n C o d e,
H A n d l e r)
Description
These macros allow control windows
Controls of the w m _ x Type
Notice: the notification is sent to the parent window.
Port ing to the control window
This
This macro allows control window processing
W m _ c o m a n d type
Controls are notified by the parent window.
Maps to the control window.
The N c o d e of is the control notification code,
H A n d l e r is the selected
Italian name
Besides the message processing function
Out of a Boolean value, which is in the upper phase
If the Boolean value is t r u e,
The parent window is also allowed to process the cancellation
Information
This macro allows control window processing
W m n o t I f y type controls
Notification, which is reflected in the parent window
In the control window
N C o d e is the notification code, and
H A n d l e r is any
Name
In addition to the processing function
The value is the same as the value above.
If the returned value is t r u e
Allow the parent window to process the message
Message Processing function call Parameters
Hbrush ctlcolor (CDC *, uint)
Void drawitem (lpdraw I t E M S T R U C T)
Void measureitem (lpmeasureitemstruct)
Void deleteitem (lpdeleteitemstruct)
Int charto I t e m (u I n t, Unit)
Int vkeyto I t e m (u I n t, Unit)
Int compareitem (lpcompa r e I t E M S T R U C T)
Void hscroll (uint, uint)
Void vscroll (uint, uint)
Void parentnotify (uint, lpa r a m)
Void handler ()
Bool handler ()
Void handler (nmhdr * pnotifystruct,
L r e s u lt * result)
Bool handler (nmhdr * pnotifystruct,
L r e s u lt * result)
(Continued)
Macro description of message processing function call Parameters
On_command_ex (ID, Handler) should be the same as above, but now the processing function bool handler (uint ID)
Returns a Boolean value. If the value is
Fa l s e, on1_msg () is allowed to continue
Scan the message image to find another message.
Function
On_command_ex_range (ID, except that I D is a range, with the bool handler (uint)
I d l A S T, H a n d l e r) Same
On_control (ncode, ID, Handler) This macro makes the w m _ c o m a n d control pass void handler ()
Message Processing Function
On_control_range (ncode, ID, except that the control I D is allowed to be a range, void handler (uint ID)
Idlast, Handler) is the same as above
On_xxx_xxxx (ID, Handler) Example:
On_bn_doubleclicked (ID, which indicates that each wm_xxx control has its own void handler ()
H A n d l e r); unique macro, which only transmits n C o d e
On_control ()
On_handy (ncode, ID, Handler) This macro enables the w m n o t I f y Control to notify void handler (nmhdr *, lresult *)
Oriented processing functions
On_policy_range (ncode, ID, except that the control I D is allowed to be a range, void handler (uint ID, nmhdr *,
Idlast, Handler) is the same as l r e s u lt *)
On_policy_ex (ncode, ID, Handler) should be the same as above, but here the processing function bool handler (uint ID, nmhdr *,
Returns a Boolean value. If the value is l r e s u lt *)
Fal s e, allow on1_msg () to continue scanning
Trace the message image to find another processing function
On_policy_ex_range (ncode, in addition to allowing I D TO BE A range, with bool handler (uint ID, nmhdr *,
ID, idlast, Handler) with the same surface l r e s u lt *)
Appendix B message, control notification, and message image macro 327
Download
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.