QTP如何模拟鼠标滚轮滚动。
比如向上滚 或 向下滚。 ConstGWL_WNDPROC=(-4)ConstWM_COMMAND=&H111
ConstWM_MBUTTONDOWN=&H207
ConstWM_MBUTTONUP=&H208
ConstWM_MOUSEWHEEL=&H20A
dim OldwinprocAsLong
DeclareFunctionSetWindowLongLib"user32"Alias"SetWindowLongA"(ByValhWndAsLong,_
ByValnIndexAsLong,ByValdwNewLongAsLong)AsLong
DeclareFunctionCallWindowProcLib"user32"Alias"CallWindowProcA"(ByVallpPrevWndFuncAsLong,_
ByValhWndAsLong,ByValMsgAsLong,ByValwParamAsLong,ByVallParamAsLong)AsLong
DeclareFunctionGetWindowLongLib"user32"Alias"GetWindowLongA"(ByValhWndAsLong,_
ByValnIndexAsLong)AsLong
FunctionFlexScroll(ByValhWndAsLong,ByValwMsgAsLong,ByValwParamAsLong,ByVallParamAsLong)AsLong
'支持滚轮的滚动Yu2004-5-1015:33
SelectCasewMsg
CaseWM_MOUSEWHEEL
SelectCasewParam
Case-7864320 '向下滚
SendKeys"{PGDN}"
Case7864320 '向上滚
SendKeys"{PGUP}"
EndSelect
EndSelect
FlexScroll=CallWindowProc(Oldwinproc,hWnd,wMsg,wParam,lParam)
EndFunction
以上代码为支持鼠标滚动的代码(没有经过调试)
看不懂~~~~~~~~~~~~~~~~~~~~~ 这好像是VB 还要转成VBS
页:
[1]