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???
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???
解决方案 »
- VC 6.0中怎么给主窗体加入背景图片
- VC中选择指定的文件夹后,如何定位其中的各个文件名
- 送分贴, KeSummer([IN]LPVOID YourLove,[OUT]LPVOID MyLove)请进。
- 请问如何测试程序的运行时间??迫切求答!
- 我的vs2005为什么不能调试一个小程序呢?
- 请问AfxSetResourceHandle (hInstance);有什么用?
- 我在Activex控件中添加了一个方法setText(BSTR text),当在脚本中调用时,参数中含有汉字,汉字部分会变成乱码,怎么解决??
- 关于图片打印求助,搞分数
- 想玩俄罗斯,自己写一个,来讨论啊.用vc
- 如何获取ClistCtrl中某行英某列的位置??
- 我想让程序做为服务启动,用到哪个函数?
- 关于向进度条发送消息的问题?
是什么意思?
uint是0!但进度条的当前pos已不是0了
str.Format("uint = %d",uint);
AfxMessageBox(str);看看uint 的值是多少?
任务: 获得一个网络媒体播放机的进度条的当前位置(比如Windows Media Player)
解决办法:
通过枚举::EnumChildWindows
获得播放机的句柄(成功)
得到一个类msctls_progress32(可能是进度条的类名)
获得该类名所对应的句柄(成功,枚举出所有的句柄中只有一个为msctls_progress32类)
向该句柄发送消息
UINT uint=::SendMessage(hwnd,PBM_GETPOS,0,0);
问题:uint的值总为0!!!!
并没有找到msctls_progress32类,而在我真正用到的那个播放机中是由这个类的(?可这个播放机也是使用的WMP控件呀!)那么还有其他方法得到进度条的句柄吗?
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
找找。