how can I get the browser's position?

Add-in Express™ Support Service
That's what is more important than anything else

how can I get the browser's position?
 
elfwood




Posts: 5
Joined: 2010-03-16
how can I get the browser's location and browser's body location and width height?

like this..


Point pt = this.IEApp.location;

or

Point pt = this.parent.location;

or

this.webbrowserControl.location
this.webbrowserControl.width, height..
Posted 16 Mar, 2010 11:58:49 Top
Andrei Smolin


Add-in Express team


Posts: 18821
Joined: 2006-05-11
Hello,

You can try using GetWindowRect (its a Win32 API function). It requires an hwnd in its parameter. Try using ADXIEModule.MainWindowHandle or ADXIEModule.ParentWindowHandle.

Hope this helps.


Andrei Smolin
Add-in Express Team Leader
Posted 17 Mar, 2010 13:14:36 Top
elfwood




Posts: 5
Joined: 2010-03-16
Thank you so Much Andrei.

I understant about 'GetWindRect function' this time to you.

but still now I can't find the one that ie explorer' browser window(HtmlDocument) rect.

please teach me one more time.


thank you.
Posted 19 Mar, 2010 02:59:42 Top
Andrei Smolin


Add-in Express team


Posts: 18821
Joined: 2006-05-11
Hello Yohn,

Please find how to declare that Win32 API function at http://www.pinvoke.net/default.aspx/user32/getwindowrect.html. The declaration of Rect is here: http://www.pinvoke.net/default.aspx/Structures/rect.html.


Andrei Smolin
Add-in Express Team Leader
Posted 19 Mar, 2010 07:10:46 Top
elfwood




Posts: 5
Joined: 2010-03-16
I understand declare and use getwindowrect.

I got the mainwindow rect and parentwindowHandle rect.

but I want rect is this. (see the image)

what object has this handle?

http://pms.bebob.net/file/fv.php?path=/project_files/2010/03/20/00/1269012540.65&name=location.jpg
Posted 19 Mar, 2010 10:35:41 Top
Andrei Smolin


Add-in Express team


Posts: 18821
Joined: 2006-05-11
Hello Yohn,

That rectangle is returned by GetWindowRect(parentwindowHandle, ...).

Pay attention:

The GetWindowRect function retrieves the dimensions of the bounding rectangle of the specified window. The dimensions are given in screen coordinates that are relative to the upper-left corner of the screen.


See http://msdn.microsoft.com/en-us/library/ms633519(VS.85).aspx.


Andrei Smolin
Add-in Express Team Leader
Posted 19 Mar, 2010 11:02:26 Top
Raphael Stuyck




Posts: 2
Joined: 2010-03-17
Hi Elfwood,

I'm facing exactly the same problem
Would you mind posting your code ?

does it works with IE8 ?
Posted 19 Mar, 2010 11:23:02 Top
elfwood




Posts: 5
Joined: 2010-03-16
found
thank you.
Posted 19 Mar, 2010 22:03:30 Top