spin控件的UDN_DELTAPOS消息//上面代码什么作用

spin控件的UDN_DELTAPOS消息//下面代码什么作用?

C/C++ code

对于有返回值的消息,要用函数SetWindowLong(hwnd,DWL_MSGRESULT,value);其中value用来设置消息返回值。


C/C++ code

LPNMHDR          lpnmh;
LPNMUPDOWN     lpnmud;

……

case WM_NOTIFY:
    lpnmh = (LPNMHDR)lParam;
    switch(lpnmh->code)
    {
     case UDN_DELTAPOS: 
          lpnmud = (LPNMUPDOWN)lParam;
          if(lpnmud->iPos+lpnmud->iDelta>= 20 )//这句是什么意思?
           {   
              SetWindowLong(hwnd,DWL_MSGRESULT,TRUE);
              return TRUE;
           }
          else
              return FALSE;
     }
     break;

……




------解决方案--------------------
UDN_DELTAPOS


Sent by the operating system to the parent window of an up-down control when the position of the control is about to change. This happens when the user requests a change in the value by pressing the control's up or down arrow. The UDN_DELTAPOS message is sent in the form of a WM_NOTIFY message. 

UDN_DELTAPOS 
lpnmud = (LPNMUPDOWN) lParam;

=======================
判断其位置信息吧?