//没有msdn吗?贴给你好了;
WM_NOTIFY
The WM_NOTIFY message is sent by a common control to its parent window when an event has occurred or the control requires some information. WM_NOTIFY 
    idCtrl = (int) wParam; 
    pnmh = (LPNMHDR) lParam; Parameters
idCtrl 
Identifier of the common control sending the message. This identifier is not guaranteed to be unique. An application should use the hwndFrom or idFrom member of the NMHDR structure (passed as the lParam parameter) to identify the control. 
pnmh 
Pointer to an NMHDR structure that contains the notification code and additional information. For some notification messages, this parameter points to a larger structure that has the NMHDR structure as its first member. 
Return Values
The return value is ignored except for notification messages that specify otherwise. 

解决方案 »

  1.   

    CN_Notify is one of the Control Notification Messages.CN_Notify message is sent to a Windows common control in response to a WM_Notify
    message. Windows send the WM_Notify message to the owner of a common control to
    inform it of an event in the control. The NmHdr field points to a TNmHdr recourd,
    which contains the notification code. Delphi handles the events that gave rise
    to the common control notifications, so the default response to the CN_Notify
    message is to do nothing, and there is little reason to handle this message your
    self.The message type is TWMNotify.TWMNotify = packed record
      Msg: Cardinal;
      IDCtrl: Longint;
      NMHdr: PNMHdr;
      Result: Longint;
    end;PNMHdr = ^TNMHdr;
    $EXTERNALSYM tagNMHDR}
    tagNMHDR = packed record
      hwndFrom: HWND;
      idFrom: UINT;
      code: Integer;     { NM_ code }
    end;
    TNMHdr = tagNMHDR;
      

  2.   

    CN_Notify is one of the Control Notification Messages.CN_Notify message is sent to a Windows common control in response to a WM_Notify
    message. Windows send the WM_Notify message to the owner of a common control to
    inform it of an event in the control. The NmHdr field points to a TNmHdr recourd,
    which contains the notification code. Delphi handles the events that gave rise
    to the common control notifications, so the default response to the CN_Notify
    message is to do nothing, and there is little reason to handle this message your
    self.The message type is TWMNotify.TWMNotify = packed record
      Msg: Cardinal;
      IDCtrl: Longint;
      NMHdr: PNMHdr;
      Result: Longint;
    end;PNMHdr = ^TNMHdr;
    $EXTERNALSYM tagNMHDR}
    tagNMHDR = packed record
      hwndFrom: HWND;
      idFrom: UINT;
      code: Integer;     { NM_ code }
    end;
    TNMHdr = tagNMHDR;
      

  3.   

    4.F 关于WM_NOTIFY的使用方法闻怡洋  
    01-9-11 下午 02:27:55WM_NOTIF在WIN32中得到大量的应用,同时也是随着CommControl的出现WM_NOTIFY成为了CommControl的基本消息。可以这样说CommControl的所有的新增特性都通过WM_NOTIFY来表达。同时WM_NOTIFY也为CommControl的操作带来了一致性。 
     
    WM_NOTIFY消息中的参数如下:  
    idCtrl = (int) wParam;  
    pnmh = (LPNMHDR) lParam; 其中lParam为一个 
     
    typedef struct tagNMHDR  

    HWND hwndFrom; 
    UINT idFrom;  
    UINT code;  
    } NMHDR; 结构指针 
    从消息的参数我们已经可以分辩出消息的来源,但是这些信息还不足以分辩出消息的具体含义。所以我们需要更多的数据来得到更多的信息。MS的做法是对每种不同用途的通知消息都定义另一种结构来表示,同时这中结构里包含了struct tagNMHDR,所以你只要进行一下类型转换就可以得到数据指针。例如对于LVN_COLUMNCLICK消息(用于在ListCtrl的列表头有鼠标点击是进行通知),结构为; 
    typedef struct tagNMLISTVIEW{ 
    NMHDR hdr; 
    int iItem; 
    int iSubItem; 
    UINT uNewState; 
    UINT uOldState; 
    UINT uChanged; 
    POINT ptAction; 
    LPARAM lParam; 
    } NMLISTVIEW, FAR *LPNMLISTVIEW; 
     
    在这个结构的最开始也就包含了struct tagNMHDR,所以在不损失数据和产生错误的情况下向处理消息的进程提供了更多的信息。  
     
    此外通过WM_NOTIFY我们可以一种完全一样的方式进行消息映射,如同在前几章中所见到的一样。  
    使用如下形式:ON_NOTIFY( wNotifyCode, id, memberFxn )。  
    处理函数也有统一的原型:afx_msg void memberFxn( NMHDR * pNotifyStruct, LRESULT * result );  
    在MFC消息映射的内部将根据定义消息映射时所使用的wNotifyCode和WM_NOTIFY中参数中pnmh->code(pnmh = (LPNMHDR) lParam)进行匹配,然后调用相应的处理函数。  
     
    还有一点是利用WM_NOTIFY/ON_NOTIFY_REFLECT可以在窗口内部处理一些消息,从而建立可重用的控件。大家可以参考Build Reusable MFC Control Classes。目前我也准备在空闲时翻译这篇文章。 
     
      

  4.   

    分析与理解通知消息-WM_NOTIFY
    2000-12-22· 郑力群·yesky--------------------------------------------------------------------------------7  1 2 3  下一页8  前言  近来,有几个网友发妹儿问了我一些关于WM_NOTIFY通知消息的使用问题,为此,我写了这篇文章,将我对WM_NOTIFY消息的理解阐述如下,希望能对各位有所帮助。  引入WM_NOTIFY消息的原因  1、问题的提出:  在Windows3.x中,不存在WM_NOTIFY消息,控制子窗口的通知消息同菜单的命令消息及加速键消息一样,均使用WM_COMMAND来发送,此时,根据WM_COMMAND消息传递的做法,可知道含有如下的传递结构:wParam high-order : Notify Code :(如TTN_NEEDTEXT)
    wParam low-order : ControlID
    lParam : ControlHandle  使用上述结构进行消息的传递时,如果一个通知消息有一些附加的消息需要发送时(如传递LVN_COLUMNCLICK时可能需要附加传送如点击的是那一列等信息),因为WM_COMMAND仅能传递如上的参数,故无法做到。  2、解决的方案  --Windows 3.x中的解决方案,为这些有附加消息传送要求的通知消息,为它们各自定义了许多特殊的消息。  以WM_DRAWITEM为例:  lParam参数成为指向DRAWITEMSTRUCT结构的指针,DRAWITEMSTRUCT结构如下:typedef struct tagDRAWITEMSTRUCT {
    UINT CtlType; 
    UINT CtlID; 
    UINT itemID; 
    UINT itemAction; 
    UINT itemState; 
    HWND hwndItem; 
    HDC hDC; 
    RECT rcItem; 
    ULONG_PTR itemData; 
    } DRAWITEMSTRUCT;  这样,就实现了附加参数的传递,类似的做法在Windows3.x中随处可见。
      

  5.   

    WM_NOTIFY           = $004E;
    当某个控件的某个事件已经发生或这个控件需要得到一些信息时,发送此消息给它的父窗口
      

  6.   

    分析与理解通知消息-WM_NOTIFY
    2000-12-22· 郑力群·yesky--------------------------------------------------------------------------------7上一页  1 2 3  下一页8
      --Windows32中的解决方案,Windows3.x的解决方案各自为政,没有统一性,为了解决这个问题,Window32中引入了一个新的消息,即WM_NOTIFY消息来解决这个问题,它将所有的这些消息采用一个统一的架构进行处理,为了与以前的处理方式兼容,上述那些特殊的消息仍然存在,它们在实质上也是相同的。  WM_NOTIFY为何能完成如此的重任?  原因:它扩展了消息的lParam参数,使它成为指向一个相对统一的结构的指针,从而使用这个结构来传递复杂的信息。  1、无需附加的信息时:  此结构为一个NMHDR结构:NMHDR
    {
    HWnd hWndFrom ; //相当于原WM_COMMAND传递方式的lParam
    UINT idFrom ; //相当于原WM_COMMAND传递方式的wParam(low-order)
    UINT code ; //相当于原WM_COMMAND传递方式的Notify Code(wParam"s high-order)
    }  2、需要附加的信息时:  此结构为一个大的结构,它的首成员必须为一个NMHDR结构的对象,它的其他成员放置此消息的附加信息。
      以LVN_KEYDOWN为例:typedef struct tagLVKEYDOWN {
    NMHDR hdr;
    WORD wVKey;
    UINT flags;
    } NMLVKEYDOWN, FAR *LPNMLVKEYDOWN;
      

  7.   

    分析与理解通知消息-WM_NOTIFY
    2000-12-22· 郑力群·yesky--------------------------------------------------------------------------------7上一页  1 2 3  下一页8
      --Windows32中的解决方案,Windows3.x的解决方案各自为政,没有统一性,为了解决这个问题,Window32中引入了一个新的消息,即WM_NOTIFY消息来解决这个问题,它将所有的这些消息采用一个统一的架构进行处理,为了与以前的处理方式兼容,上述那些特殊的消息仍然存在,它们在实质上也是相同的。  WM_NOTIFY为何能完成如此的重任?  原因:它扩展了消息的lParam参数,使它成为指向一个相对统一的结构的指针,从而使用这个结构来传递复杂的信息。  1、无需附加的信息时:  此结构为一个NMHDR结构:NMHDR
    {
    HWnd hWndFrom ; //相当于原WM_COMMAND传递方式的lParam
    UINT idFrom ; //相当于原WM_COMMAND传递方式的wParam(low-order)
    UINT code ; //相当于原WM_COMMAND传递方式的Notify Code(wParam"s high-order)
    }  2、需要附加的信息时:  此结构为一个大的结构,它的首成员必须为一个NMHDR结构的对象,它的其他成员放置此消息的附加信息。
      以LVN_KEYDOWN为例:typedef struct tagLVKEYDOWN {
    NMHDR hdr;
    WORD wVKey;
    UINT flags;
    } NMLVKEYDOWN, FAR *LPNMLVKEYDOWN;
      

  8.   


      WM_NOTIFY消息的处理(以LVN_KEYDOWN 为例)void C*ListCtrl::OnKeydown(NMHDR* pNMHDR, LRESULT* pResult) 
    {
    LV_KEYDOWN* pLVKeyDow = (LV_KEYDOWN*)pNMHDR;
    ....
    ....
    }  分析  1、大结构的首个成员为NMHDR,这样,使用指向NMHDR的指针来传递结构地址,不论在仅使用NMHDR结构,还是在使用大结构的情况下都适合。  2、因为此消息实际传递的即是对应的结构(NMHDR或以NMHDR作首成员的大结构)所以,如上进行强制转换,当然不会有问题。  结语  使用上述WM_NOTIFY框架处理的消息很多,它们的处理架构与一般的消息处理类似,因此,本文没有对它的具体使用进行阐述,有着方面需求的读者,请自行参阅MSDN相关内容。  另外,WM_NOTIFY消息和“消息反射”的关系十分紧密,我会尽快将我对“消息反射”的理解与分析,写出来与大家共享,再次感谢大家对本文的关注。-----------------------------------------------------------------
    不贴了,你到http://www.google.com/search?q=wm_notify&ie=GB2312&hl=zh-CN&btnG=Google%CB%D1%CB%F7&lr=lang_zh-CN
    自己看吧
      

  9.   

    感谢各位踊跃参与!!!
    ==========================
    以上这些我都早看过了!
    我想要的是所有跟WM_NOTIFY相关的 那些 结构定义及使用说明!
      

  10.   

    你说的是这个吧 
    Sends a message to the system to add, modify, or delete an icon from the taskbar status area.WINSHELLAPI BOOL WINAPI Shell_NotifyIcon(    DWORD dwMessage, // message identifier
        PNOTIFYICONDATA pnid // pointer to structure
       );
     ParametersdwMessageIdentifier of the message to send. This parameter can be one of these values:NIM_ADD Adds an icon to the status area.
    NIM_DELETE Deletes an icon from the status area.
    NIM_MODIFY Modifies an icon in the status area. 
     pnidPointer to a NOTIFYICONDATA structure. The content of the structure depends on the value of dwMessage.  Return ValuesIf the function succeeds, the return value is nonzero.
    If the function fails, the return value is zero.其中NOTIFYICONDATA的结构类型是
    typedef struct _NOTIFYICONDATA { // nid  
        DWORD cbSize; 
        HWND hWnd; 
        UINT uID; 
        UINT uFlags; 
        UINT uCallbackMessage; 
        HICON hIcon; 
        char szTip[64]; 
    } NOTIFYICONDATA, *PNOTIFYICONDATA; 
     MemberscbSizeSize of the NOTIFYICONDATA structure.hWndHandle of the window that receives notification messages associated with an icon in the taskbar status area. uIDApplication-defined identifier of the taskbar icon.uFlagsArray of flags that indicate which of the other members contain valid data. This member can be a combination of these values:NIF_ICON The hIcon member is valid. 
    NIF_MESSAGE The uCallbackMessage member is valid.
    NIF_TIP The szTip member is valid.
     uCallbackMessageApplication-defined message identifier. The system uses the specified identifier for notification messages that it sends to the window identified by hWnd whenever a mouse event occurs in the bounding rectangle of the icon. hIconHandle of the icon to add, modify, or delete. szTipTooltip text to display for the icon.
      

  11.   

    谢谢netlib(河外孤星)
    我想要的是[所有]跟WM_NOTIFY相关的 那些 结构定义及使用说明!
      

  12.   

    我其实就想要 commctrls 里的那一堆 结构的详细说明!
    再次谢谢各位兄弟!!!
      

  13.   

    那还是你自己慢慢看吧,vcl源码。
      

  14.   

    那还是你自己慢慢看吧,vcl源码。
      

  15.   

    那还是你自己慢慢看吧,vcl源码。