我指的是全部用win32 API而不是MFC写的application
我不知道消息部分该怎么写,一时也找不到资料

解决方案 »

  1.   

    消息处理callback函数中的后面两个参数(WPARAM wParam, LPARAM lParam )分别怎么用?
    INT_PTR CALLBACK MainDlgProc( HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam )
      

  2.   

    LRESULT CALLBACK ScrollProc( HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam) ;
    UING msg == WM_VSCROLL  
    nScrollCode = (int) LOWORD(wParam); // scroll bar value 
    nPos = (short int) HIWORD(wParam);  // scroll box position 
    hwndScrollBar = (HWND) lParam;      // handle to scroll bar nScrollCode 
    Value of the low-order word of wParam. Specifies a scroll bar value that indicates the user's scrolling request. This parameter can be one of the following values: Value Meaning 
    SB_BOTTOM Scrolls to the lower right. 
    SB_ENDSCROLL Ends scroll. 
    SB_LINEDOWN Scrolls one line down. 
    SB_LINEUP Scrolls one line up. 
    SB_PAGEDOWN Scrolls one page down. 
    SB_PAGEUP Scrolls one page up. 
    SB_THUMBPOSITION The user has dragged the scroll box (thumb) and released the mouse button. The nPos parameter indicates the position of the scroll box at the end of the drag operation. 
    SB_THUMBTRACK The user is dragging the scroll box. This message is sent repeatedly until the user releases the mouse button. The nPos parameter indicates the position that the scroll box has been dragged to. 
    SB_TOP Scrolls to the upper left. nPos 
    Value of the high-order word of wParam. Specifies the current position of the scroll box if the nScrollCode parameter is SB_THUMBPOSITION or SB_THUMBTRACK; otherwise, nPos is not used. hwndScrollBar 
    Value of lParam. If the message is sent by a scroll bar, then hwndScrollBar is the handle to the scroll bar control. If the message is not sent by a scroll bar, hwndScrollBar is NULL. 
      

  3.   

    谢谢,不过我问是SliderBar不是ScrollBar :)
      

  4.   

    没错,sdk下没有sliderbar,是用scrollbar来完成相同任务的。
      

  5.   

    "请教win32前辈: 如何对Slider(进度条)编程?"
    --------------------------------------------
    SliderBar是滑动条,进度条是ProgressBar,你问的是哪个呢?
    如果是SliderBar的话,那我就没错,如果是ProgressBar,那你当我没说过...