Gadzilla
15 years agoContributor
Problem with calling function from user32.dll
Hi,
I am trying to create script which will check whether some process have hung window. I have found "IsHungAppWindow" Win32Api function (http://msdn.microsoft.com/en-us/library/ms633526(VS.85).aspx) that is suitable for my purposes, but I have problems with its calling from my script.
Attempt to call this function via Win32API TestComplete's program object leads to error: "Object doesn't support this property or method".
var oWnd = Sys.WaitProcess("MyProccess").WaitWindow("MyWindow");
if(oWnd.Exists)
{
var bIsHungWnd = Win32API.IsHungAppWindow(oWnd.Handle); // Here I got error message.
...
}
Also I have found information that "IsHungAppWindow" function defined in "user32.dll". So I am trying to call this function via DLL TestComplete's program object in the following way:
var oWnd = Sys.WaitProcess("MyProccess").WaitWindow("MyWindow");
if(oWnd.Exists)
{
var Def_Environment = DLL.DefineEnvironment(true);
var Def_DLL = Def_Environment.DefineDLL("USER32");
Def_DLL.DefineProc("IsAppWndHung", vt_i4, vt_bool);
Def_DLL.DefineAlias("IsHungAppWindow", "IsAppWndHung");
var Lib = Def_Environment.Load("C:\\Windows\\System32\\USER32.dll");
var bIsHungWnd = Lib.IsHungAppWindow(oWnd.Handle); // Here I got error "Object doesn't support this property or method"
...
}
Could someone help me to solve the problem with using "IsHungAppWindow" Win32 api function, or please just point me to the wrong place in my script.
Thanks in advance,
John.
I am trying to create script which will check whether some process have hung window. I have found "IsHungAppWindow" Win32Api function (http://msdn.microsoft.com/en-us/library/ms633526(VS.85).aspx) that is suitable for my purposes, but I have problems with its calling from my script.
Attempt to call this function via Win32API TestComplete's program object leads to error: "Object doesn't support this property or method".
var oWnd = Sys.WaitProcess("MyProccess").WaitWindow("MyWindow");
if(oWnd.Exists)
{
var bIsHungWnd = Win32API.IsHungAppWindow(oWnd.Handle); // Here I got error message.
...
}
Also I have found information that "IsHungAppWindow" function defined in "user32.dll". So I am trying to call this function via DLL TestComplete's program object in the following way:
var oWnd = Sys.WaitProcess("MyProccess").WaitWindow("MyWindow");
if(oWnd.Exists)
{
var Def_Environment = DLL.DefineEnvironment(true);
var Def_DLL = Def_Environment.DefineDLL("USER32");
Def_DLL.DefineProc("IsAppWndHung", vt_i4, vt_bool);
Def_DLL.DefineAlias("IsHungAppWindow", "IsAppWndHung");
var Lib = Def_Environment.Load("C:\\Windows\\System32\\USER32.dll");
var bIsHungWnd = Lib.IsHungAppWindow(oWnd.Handle); // Here I got error "Object doesn't support this property or method"
...
}
Could someone help me to solve the problem with using "IsHungAppWindow" Win32 api function, or please just point me to the wrong place in my script.
Thanks in advance,
John.