IntertnetExplorer.Application - On Top

jennid

Member
Hi All-I am opening Internet Explorer from a Progress program (10.2B0709) using the following method:

CREATE "InternetExplorer.Application" oExplorer.
oExplorer:Visible = True.
oExplorer:Navigate("www.testsite.com").

Is there a way I can get the IE Window to be on top of other windows when it opens? It's opening behind the Progress one.

Thanks.
 

Osborne

Active Member
Two things you could try - AppActivate and SetActiveWindow - but depending on the Windows version it could still be the same problem.

Option 1:
Code:
DEFINE VARIABLE oShell AS COM-HANDLE NO-UNDO.
DEFINE VARIABLE oExplorer AS COM-HANDLE NO-UNDO.

CREATE "WScript.Shell" oShell.
CREATE "InternetExplorer.Application" oExplorer.
oExplorer:Navigate("www.testsite.com").
oExplorer:Visible = True.
oShell:AppActivate(oExplorer).

RELEASE OBJECT oShell.
RELEASE OBJECT oExplorer.
Option 2:
Code:
DEFINE VARIABLE intResult AS INTEGER NO-UNDO.
DEFINE VARIABLE oExplorer AS COM-HANDLE NO-UNDO.

CREATE "InternetExplorer.Application" oExplorer.
oExplorer:Navigate("www.testsite.com").
oExplorer:Visible = True.

RUN SetActiveWindow(oExplorer:HWND, OUTPUT intResult).

RELEASE OBJECT oExplorer.

PROCEDURE SetActiveWindow EXTERNAL "USER32.DLL":
   DEFINE INPUT  PARAMETER intHwnd AS LONG.
   DEFINE RETURN PARAMETER intResult AS LONG.
END PROCEDURE.
 
Top