Hi all...can somebody help please? Thank you in advance, Kristian


OracleFormWindow("Item Master").OracleButton("Suppliers").GetROProperty ("color") 'This line of code is just an example of what I need

I'm trying to get the colour of an Oracle Button on an Oracle Form Window. The QTP Object Spy only see's the following properties (see below) however the button colour can be either Red, Green, Blue or Grey. I'm unable to access the property the colour value is stored into.

I have tried using external functions (example below) to get the pixel colour etc but its not stable enough.

Sub GetObjColour(Obj)

Dim hDC, hWnd
Dim iX, iY

Extern.Declare MicLong, "GetPixel", "gdi32", "",MicLong, MicLong, MicLong
Extern.Declare MicLong, "GetDC", "user32","", MicLong
Extern.Declare micLong,"ReleaseDC","user32","",micLong,micLong

hDC = Extern.GetDC(Obj.GetROProperty("hwnd"))
iX = Obj.GetROProperty ("abs_x")
iY = Obj.GetROProperty ("abs_y")

Print Obj.ToString & " - " & Extern.GetPixel (hDC, iX,iY)

Extern.ReleaseDC hWnd, hDC

End Sub

Properties seen in the QTP Object Spy
"Class Name:=OracleButton",
"class description:=push button",
"class path:=oracle\.forms\.ui\.VButton;oracle\.ewt\.butt on\.PushButton;oracle\.ewt\.lwAWT\.AbstractButton; oracle\.ewt\.lwAWT\.AbstractPainterComponent;oracl e\.ewt\.lwAWT\.LWComponent;java\.awt\.Container;ja va\.awt\.Component;java\.lang\.Object;",
"developer name:=VButton74",
"label:="I am a label on the button",
"tooltip:=This is a tool tip\.",