Page 1 of 1
Get ProcessId of a Form
Posted: Fri Feb 13, 2009 1:57 pm
by atom
Hiya
I want to get the process Id of the owner of a dialog:
e.g.
Dim objForm As ranorex.Form = "/form[@Class='#32770']"
How can I get the ProcessId from the Form object ?
Posted: Fri Feb 13, 2009 2:54 pm
by Support Team
Just cast your form object to "Ranorex.NativeWindow" and then access the ProcessId property.
(you will need a Ranorex.Win32Plugin.dll reference for this)
-or-
use objForm.Element.GetAttributeValue("processid")
Michael
Ranorex Team
Posted: Fri Feb 13, 2009 2:58 pm
by atom
Ok thanks
GetAttributeValue ... has no documentation about what the attibute name can be, what are the possible values ?
Cheers
Posted: Fri Feb 13, 2009 3:21 pm
by Support Team
That depends on the element. You can use all attributes visible in the spy "overview" tab.
Hoever, we recommend using the adapters. A list of all available adapters (e.g. Form, NativeWindow) is available in the API doc, Ranorex namespace
Michael
Ranorex Team
Posted: Fri Feb 13, 2009 3:36 pm
by atom
Ok thanks for info