1、我在函数声中这样定义的
Function long FindWindowExA ( long hWnd, long hWndChild, string lpszClass, string lpszWindow) library "User32.dll" alias for "FindWindowExA;Ansi"
2、在调用时候,这样定义的函数
函数名of_gettoolbarhandle
返回值 :long
函数参数:aw_frame,参数类型:qindow
函数体:
long ll_NULL, ll_hwndToolBar
string ls_ClassName, ls_WindowName
Environment lEnv
IF IsValid( aw_Frame ) AND (GetEnvironment(lEnv) = 1) THEN
CHOOSE CASE lEnv.PBMajorRevision
CASE 6
ls_ClassName = "FNFIXEDBAR60"
case 8
ls_ClassName = "FNFIXEDBAR80"
case 7
ls_ClassName = "FNFIXEDBAR70"
case 9
ls_ClassName = "FNFIXEDBAR90"
case 10
ls_ClassName = "FNFIXEDBAR100"
END CHOOSE
SetNull(ls_WindowName)
SetNull(ll_NULL)
ll_hwndToolBar =FindWindowExW( Handle(aw_Frame), ll_NULL, ls_ClassName, ls_WindowName )
messagebox('ll_hwndToolBar',ll_hwndToolBar)
END IF
RETURN ll_hwndToolBar
3、调用of_gettoolbarhandle,在MDI窗体的OPEN中调用的 ,
ll_hwndToolBar = of_GetToolBarHandle( w_main)
4、问题:ll_hwndToolBar的返回值不对,总是0。请
大家帮忙看看。
------解决方案--------------------
用以下代码试试
ls_ClassName = "FNFIXEDBAR105"
SetNull(ls_WindowName)
SetNull(ll_NULL)
ll_hwndToolBar =FindWindowExW( Handle(aw_Frame), ll_NULL, ls_ClassName, ls_WindowName )
messagebox('ll_hwndToolBar',ll_hwndToolBar)