Consultor Eletrônico



Kbase P113794: The Progress application window is placed in the foreground after running the ShellExecute API funct
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   18/09/2009
Status: Verified

SYMPTOM(s):

The Progress application window is placed in the foreground after running the ShellExecute API function

The ShellExecute API was executed from a frame that overlaps another frame in the Progress window

Works fine if the ShellExecute API is executed from the underlying frame

Only occurs when opening a Microsoft Office document

FACT(s) (Environment):

Progress 9.1E
OpenEdge 10.1A
Windows

CAUSE:

This is not caused by the Progress application. Windows is changing the z-order of the windows because of the overlapping frames.

FIX:

Use the FindExecutable API function in combination with the ShellExecute API function, for example:
DEFINE VARIABLE cExeFile AS CHARACTER NO-UNDO.
cExeFile = FILL(' ', 255).

RUN FindExecutableA ( cFileName,
"",
input-output cExeFile,
output hInstance ).

RUN ShellExecuteA ( 0,
"open",
cExeFile,
cFileName,
"",
5,
output hInstance ).

PROCEDURE ShellExecuteA external "shell32.dll" :
define input parameter hwnd as long.
define input parameter lpOperation as character.
define input parameter lpFile as character.
define input parameter lpParameters as character.
define input parameter lpDirectory as character.
define input parameter nShowCmd as long.
define return parameter hInstance as long.
END PROCEDURE.

PROCEDURE FindExecutableA external "shell32.dll" :
define input parameter lpFile as character.
define input parameter lpDirectory as character.
define input-output parameter lpResult as character.
define return parameter hInstance as long.
END PROCEDURE.