hwnd是枚举出的句柄
info是一个CString对象
msctls_progress32类是一个网络视频播放器中的进度条,该播放器使用的是wmp控件
char chrHwnd[8];
::GetClassName(hwnd,cname,50);
info=cname;
if(info=="msctls_progress32"){
UINT uint=::SendMessage(hwnd,PBM_GETPOS,0,0);
::itoa(uint,chrHwnd,10);
AfxMessageBox(chrHwnd); 
AfxMessageBox总显示0???

解决方案 »

  1.   

    AfxMessageBox总显示0
    是什么意思?
      

  2.   

    UINT uint=::SendMessage(hwnd,PBM_GETPOS,0,0);
    uint是0!但进度条的当前pos已不是0了
      

  3.   

    CString str;
    str.Format("uint = %d",uint);
    AfxMessageBox(str);看看uint 的值是多少?
      

  4.   

    重新申诉我的问题
    任务:   获得一个网络媒体播放机的进度条的当前位置(比如Windows Media Player)
    解决办法:
    通过枚举::EnumChildWindows
      获得播放机的句柄(成功)
      得到一个类msctls_progress32(可能是进度条的类名)
      获得该类名所对应的句柄(成功,枚举出所有的句柄中只有一个为msctls_progress32类)
    向该句柄发送消息
      UINT uint=::SendMessage(hwnd,PBM_GETPOS,0,0);
    问题:uint的值总为0!!!!
      

  5.   

    可以用SPY++确证一下进度条的句柄。
      

  6.   

    看来问题在进度条的句柄上,我以Windows Media Player试了一下,
    并没有找到msctls_progress32类,而在我真正用到的那个播放机中是由这个类的(?可这个播放机也是使用的WMP控件呀!)那么还有其他方法得到进度条的句柄吗?
      

  7.   

    Window Functions
    The following functions are used to create and manage windows.   
     
    AdjustWindowRect  
    AdjustWindowRectEx  
    AnimateWindow  
    ArrangeIconicWindows  
    BeginDeferWindowPos  
    BringWindowToTop  
    CascadeWindows  
    ChildWindowFromPoint  
    ChildWindowFromPointEx  
    CloseWindow  
    CreateWindow  
    CreateWindowEx  
    DeferWindowPos  
    DestroyWindow  
    EnableWindow  
    EndDeferWindowPos  
    EnumChildProc  
    EnumChildWindows  
    EnumThreadWindows  
    EnumThreadWndProc  
    EnumWindows  
    EnumWindowsProc  
    FindWindow  
    FindWindowEx  
    GetClientRect  
    GetDesktopWindow  
    GetForegroundWindow  
    GetLastActivePopup  
    GetNextWindow  
    GetParent  
    GetTopWindow  
    GetWindow  
    GetWindowPlacement  
    GetWindowRect  
    GetWindowText  
    GetWindowTextLength  
    GetWindowThreadProcessId  
    IsChild  
    IsIconic  
    IsWindow  
    IsWindowUnicode  
    IsWindowVisible  
    IsZoomed  
    MoveWindow  
    OpenIcon  
    SetForegroundWindow  
    SetParent  
    SetWindowLong  
    SetWindowPlacement  
    SetWindowPos  
    SetWindowText  
    ShowOwnedPopups  
    ShowWindow  
    ShowWindowAsync  
    TileWindows  
    WindowFromPoint  
    WinMain  
    Obsolete Functions
      
     
    AnyPopup  
    EnumTaskWindows  
    GetSysModalWindow  
    GetWindowTask  
    SetSysModalWindow  
     
    找找。
      

  8.   

    老大,你把win API大全给我搬来,我受得了吗?