Using Shell32.dll in CreateProcessA

RobertLanger

New Member
Hi All,

I have been using the ShellExecute and createProcess from GLobal Shared.
The intention is press a button and launch a web page.
I initially used ShellExecuteA which worked, the command is.
http://someserver.somesite.com:1234/index.htm

IE happily launched and the webpage nominated was displayed. Life is good!
However, this web page updates another database, which in turn updates the database to which I am connected to. (Don't really want to go there??)

The requirement is to effectively make the 4GL window and browser modal?.

So when the the browser is closed, refresh the 4GL window which originally launched the browser, and if possible, do not allow actions on the source program (4GL window) while the browser is active?

I have tried to use the createProcess and windows.i etc, but the browser did not launch and returned just 0 as the return value.

Being new to windows API I am somewhat confused.

If anybody has any help on this, it would be much appreciated.
Regards
Robert
 

nai

New Member
Execute a program and wait until it is finished…

You can not use CreateProcess to create modal windows, but you can use the process handle it returned to know if the process you created is still running by passing this process handle as an input parameter for this procedure:
Code:
PROCEDURE [color=red]WaitForSingleObject[/color] EXTERNAL "KERNEL32.DLL":U:	 
  DEFINE INPUT  PARAMETER WFSO_hObject   AS LONG.
  DEFINE INPUT  PARAMETER WFSO_dwMilliseconds AS LONG.
  DEFINE RETURN PARAMETER WFMO_retval AS LONG.
END PROCEDURE.
Go to this page for an article called Execute a program and wait until it is finished…” :
http://www.global-shared.com/cgi-bin/twiki/bin/view/Win32/ExecWait

For more information about WaitForSingleObject, go to :
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dllproc/base/waitforsingleobject.asp

I hope it will help you...
 
Top