| || |
User John Crunk (email@example.com) posted:
Hi all long time no see.
I have a question that I thought that you all might be able to help me
with. I am trying to get the Object Type of a object, but I need to do it
without commands like SQAGetProperty or other commands specific to any
Testing tool. Does anyone here know how to do that. I am hoping for some
API that simply ask the object what kind of thing it is and it replies
with "Button" or something like that.
If you know the answer to this, please reply to firstname.lastname@example.org and
let me know.
Re: Object Type
User Miller, Curt (Curt.Miller@premcor.com.nospam) posted:
This is a tough one. If you were using Visual Basic, you could use
a function valled "TypeName()", which does just what you need. This is not
available in SQABasic. The only function I could find in SQABasic that
comes close is "TypeOf()", but this can only be used as part of an If
statement. For example, you couldn't do something like: MsgBox
...and that's all I got (sorry). Be sure to let the group know if
you find an answer to this!
Re: Object Type
User rjpowers (email@example.com) posted:
The GetClassName function retrieves the name of the class to which the
specified window belongs.
HWND hWnd, // handle to window
LPTSTR lpClassName, // class name
int nMaxCount // size of class name buffer
[in] Handle to the window and, indirectly, the class to which the window
[out] Pointer to the buffer that is to receive the class name string.
[in] Specifies the length, in TCHARs, of the buffer pointed to by the
lpClassName parameter. The class name string is truncated if it is longer
than the buffer.
If the function succeeds, the return value is the number of TCHARs copied to
the specified buffer.
If the function fails, the return value is zero. To get extended error
information, call GetLastError.
Windows NT/2000 or later: Requires Windows NT 3.1 or later.
Windows 95/98/Me: Requires Windows 95 or later.
Header: Declared in Winuser.h; include Windows.h.
Library: Use User32.lib.
Unicode: Implemented as Unicode and ANSI versions on Windows NT/2000.