|
|
|
date: Tue, 24 Jun 2008 19:45:09 -0700 (PDT),
group: microsoft.public.win32.programmer.ui
back
.NET DateTimePicker and WM_NOTIFY
I'm a bit new to the Windows API, and I'm looking for help with how to
use it.
When looking through the source code of the .NET Framework
DateTimePicker control, I found it creates an instance of the
DateTimePicker common control using Windows API functions. When I try
to trap the WM_NOTIFY message by overriding the WndProc method of the
DateTimePicker, I can check the NMHDR in the LParam for Codes.
However, the NMHDR codes do not correspond to the proper Codes in
CommCtrl.h. For instance:
Up/Down: -949/-950
Moving between dates: -749,
Finally selecting a date: -746.
Tooltips: -521/-522.
However, if I use the NativeWindow to subclass the Panel containing my
DateTimePicker, I am able to trap the right codes in the WndProc of
the NativeWindow. Still, I do not receive any WM_NOTIFY messages if I
subclass the Form containing the Panel, or the DateTimePicker itself.
So I have two questions:
1: Why does the .NET framework have different NMHDR codes for the
DateTimePicker, and where do I find a list of what they correspond to?
2. Why do I need to subclass the Panel containing the DateTimePicker
instead of the DateTimePicker itself or the Form containing both of
them?
date: Tue, 24 Jun 2008 19:45:09 -0700 (PDT)
author: andspal
Re: .NET DateTimePicker and WM_NOTIFY
Are the codes different for Unicode and non-Unicode?
"andspal" wrote in message
news:064a4c95-6707-44a8-ad7e-57436358e32e@r66g2000hsg.googlegroups.com...
> I'm a bit new to the Windows API, and I'm looking for help with how to
> use it.
>
> When looking through the source code of the .NET Framework
> DateTimePicker control, I found it creates an instance of the
> DateTimePicker common control using Windows API functions. When I try
> to trap the WM_NOTIFY message by overriding the WndProc method of the
> DateTimePicker, I can check the NMHDR in the LParam for Codes.
> However, the NMHDR codes do not correspond to the proper Codes in
> CommCtrl.h. For instance:
> Up/Down: -949/-950
> Moving between dates: -749,
> Finally selecting a date: -746.
> Tooltips: -521/-522.
>
> However, if I use the NativeWindow to subclass the Panel containing my
> DateTimePicker, I am able to trap the right codes in the WndProc of
> the NativeWindow. Still, I do not receive any WM_NOTIFY messages if I
> subclass the Form containing the Panel, or the DateTimePicker itself.
>
> So I have two questions:
>
> 1: Why does the .NET framework have different NMHDR codes for the
> DateTimePicker, and where do I find a list of what they correspond to?
>
> 2. Why do I need to subclass the Panel containing the DateTimePicker
> instead of the DateTimePicker itself or the Form containing both of
> them?
>
date: Tue, 24 Jun 2008 23:03:55 -0700
author: Sam Hobbs _change_social_to_socal
Re: .NET DateTimePicker and WM_NOTIFY
andspal wrote:
> I'm a bit new to the Windows API, and I'm looking for help with how to
> use it.
>
> When looking through the source code of the .NET Framework
> DateTimePicker control, I found it creates an instance of the
> DateTimePicker common control using Windows API functions. When I try
> to trap the WM_NOTIFY message by overriding the WndProc method of the
> DateTimePicker, I can check the NMHDR in the LParam for Codes.
> However, the NMHDR codes do not correspond to the proper Codes in
> CommCtrl.h. For instance:
> Up/Down: -949/-950
> Moving between dates: -749,
> Finally selecting a date: -746.
> Tooltips: -521/-522.
>
> However, if I use the NativeWindow to subclass the Panel containing my
> DateTimePicker, I am able to trap the right codes in the WndProc of
> the NativeWindow. Still, I do not receive any WM_NOTIFY messages if I
> subclass the Form containing the Panel, or the DateTimePicker itself.
>
> So I have two questions:
>
> 1: Why does the .NET framework have different NMHDR codes for the
> DateTimePicker, and where do I find a list of what they correspond to?
>
> 2. Why do I need to subclass the Panel containing the DateTimePicker
> instead of the DateTimePicker itself or the Form containing both of
> them?
Aren't wm_notify messages sent to the parent, so you are receiving the
dropdown monthviews notifications.
Try wm_reflect I think.
--
Dean Earley (dean.earley@icode.co.uk)
i-Catcher Development Team
iCode Systems
date: Wed, 25 Jun 2008 08:52:46 +0100
author: Dean Earley
|
|