i tried getting the automation object of the embedded browser but no
success, i not able to figure out the issue, could some give inputs on
this please ?
(There is an function defined in IE.au3 (autoitv3 UDF) to get the IE
object from the IE handle, i tried re writting the same function in
ruby)
Code tried ..
# Start winamp player
.......
require 'Win32API'
SMTO_ABORTIFHUNG = 0x0002
Win32API.new("ole32", "CoInitialize", ['P'] , 'I').call(0)
reg_msg = Win32API.new("user32", "RegisterWindowMessage", ['P'] ,
'I').call("WM_HTML_GETOBJECT")
puts reg_msg
# "Main Window" is title of winamp player
# "Internet Explorer_Server1" is a IE control embedded in the player
hnd = @@autoit.ControlGetHandle("Main Window", "", "Internet
Explorer_Server1")
puts hnd
result=" "*16
aInt = [0xA7, 0x31, 0x0, 0xA0, 0xC9, 0x8, 0x26, 0x37].pack 'I*'
a = [0x626FC520, 0xA41E, 0x11CF, aInt].pack 'IIIP'
sendMessagetimeout = Win32API.new("user32", "SendMessageTimeout",
['L','I','I','I','I','I','P'] , 'L')
sendMessagetimeout.call(hnd.hex, reg_msg, 0, 0, SMTO_ABORTIFHUNG,
1000, result)
puts result.unpack("L")
idisp=0
oIE = Win32API.new("oleacc", "ObjectFromLresult", ['P', 'P','I','P'] ,
'L')
oIE.call(result, a, 0, idisp)
# returning zero
puts idisp.unpack("L")
Thanks in advance !