Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
Windos
win32.3rdparty
win32.directx.audio
win32.directx.ddk
win32.directx.graphics
win32.directx.input
win32.directx.managed
win32.directx.misc
win32.directx.networking
win32.directx.sdk
win32.directx.video
win32.dirx.grap.shaders
win32.gdi
win32.international
win32.kernel
win32.messaging
win32.mmedia
win32.networks
win32.ole
win32.rtc
win32.tapi
win32.tapi.beta
win32.tools
win32.ui
win32.wince
win32.wmi
windows.mediacenter
winfx.aero
winfx.announcements
winfx.avalon
winfx.collaboration
winfx.fundamentals
winfx.general
winfx.indigo
winfx.sdk
winfx.winfs
  
 
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

Re: .NET DateTimePicker and WM_NOTIFY   
"Dean Earley"  wrote in message 
news:ORZc2hp1IHA.4848@TK2MSFTNGP05.phx.gbl...
>
> Try wm_reflect I think.

No such thing. MFC does reflection but the Windows API does not reflect.
date: Thu, 26 Jun 2008 01:40:34 -0700   author:   Sam Hobbs _change_social_to_socal

Re: .NET DateTimePicker and WM_NOTIFY   
Sam Hobbs wrote:
> "Dean Earley"  wrote in message 
> news:ORZc2hp1IHA.4848@TK2MSFTNGP05.phx.gbl...
>> Try wm_reflect I think.
> 
> No such thing. MFC does reflection but the Windows API does not reflect. 

I can't remember the full details, but when I subclassed the common 
controls themselves (rather than the parent), I was picking up WM_NOTIFY 
| 0x2000.
I don't know what message this really is, but the original source I sued 
referred to it as WM_REFLECT.

As far as I'm aware, MFC doesn't come into any of this code as it is the 
Windows Common Controls being used in VB6.

-- 
Dean Earley (dean.earley@icode.co.uk)
i-Catcher Development Team

iCode Systems
date: Thu, 26 Jun 2008 12:39:20 +0100   author:   Dean Earley

Re: .NET DateTimePicker and WM_NOTIFY   
That makes sense, thanks a lot!
date: Mon, 30 Jun 2008 19:12:19 -0700 (PDT)   author:   andspal

Re: .NET DateTimePicker and WM_NOTIFY   
"Dean Earley"  wrote in message 
news:ONckHF41IHA.552@TK2MSFTNGP06.phx.gbl...
> Sam Hobbs wrote:
>> "Dean Earley"  wrote in message 
>> news:ORZc2hp1IHA.4848@TK2MSFTNGP05.phx.gbl...
>>> Try wm_reflect I think.
>>
>> No such thing. MFC does reflection but the Windows API does not reflect.
>
> I can't remember the full details, but when I subclassed the common 
> controls themselves (rather than the parent), I was picking up WM_NOTIFY | 
> 0x2000.
> I don't know what message this really is, but the original source I sued 
> referred to it as WM_REFLECT.
>
> As far as I'm aware, MFC doesn't come into any of this code as it is the 
> Windows Common Controls being used in VB6.

I cannot find any documentation of WM_REFLECT as a message. That symbolic 
name is used as a base value that is added to other message ids, but I do 
not see WM_REFLECT documented as a message.

I searched the Windows SDK headers for WM_REFLECT and found nothing in 
there. It is not a Windows API message.

I did find a lot of .Net code using "WM_REFLECT + WM_NOTIFY" and stuff such 
as that. I am not familiar with .Net but I assume that it is using the value 
WM_REFLECT internally. This newsgroup however is the Windows API UI 
newsgroups and for the purposes of that subject, there is no such thing as a 
WM_REFLECT messge.

Or have you found documenttion indicating otherwise?
date: Mon, 30 Jun 2008 17:57:22 -0700   author:   Sam Hobbs _change_social_to_socal

Re: .NET DateTimePicker and WM_NOTIFY   
After making a search online regarding Dean's comment about the
WM_REFLECT, I found this site explaining the origins of WM_REFLECT:

http://www.eggheadcafe.com/forumarchives/vclanguage/Aug2005/post23538255.asp

It is a combination of OCM_BASE and WM_USER

Then, WM_NOTIFY is added to that sum, and if I catch the Messages to
the DateTimePicker with that number, I am able to receive the proper
-754 and -753 NMHDR codes.
date: Thu, 3 Jul 2008 11:47:00 -0700 (PDT)   author:   andspal

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us