An external program window breaks the order of the windows
- Eugene Lutsenko
- Posts: 1649
- Joined: Sat Feb 04, 2012 2:23 am
- Location: Russia, Southern federal district, city of Krasnodar
- Contact:
An external program window breaks the order of the windows
The progress bar of the external program brings the current window to the background. How to make the current window does not disappear in the background, and remained on the screen?
Re: An external program window breaks the order of the windo
if you have a Top-Window (XbpDialog) you can useEugene Lutsenko wrote:The progress bar of the external program brings the current window to the background. How to make the current window does not disappear in the background, and remained on the screen?
Code: Select all
oDialog:alwaysOnTop- := .T.

---
what about run external App minimized

if Progressbar use ITaskbarList Interface , like DXE_Progressbar(), you get Progress Animation in Taskbar Icon
while Runshell() have no Option like SW_MINIMIZE i use this
Code: Select all
DLLFUNCTION ShellExecute( nHWND, cOperation, cFile, cParms, cDirectory, nOpenMode );
ALIAS ShellExecuteA USING OSAPI FROM SHELL32.DLL
* #define SW_HIDE 0
* #define SW_NORMAL 1
* #define SW_SHOWMINIMIZED 2
* #define SW_SHOWMAXIMIZED 3
* #define SW_MAXIMIZE 3
* #define SW_SHOWNOACTIVATE 4
* #define SW_SHOW 5
* #define SW_MINIMIZE 6
* #define SW_SHOWMINNOACTIVE 7
* #define SW_SHOWNA 8
* #define SW_RESTORE 9
* #define SW_SHOWDEFAULT 10
lSuccess := ShellExecuteA( APPDESKTOP() :GetHWND(), ;
"open", ;
cPath + cFile, ; // full path
cParameter, ;
CURDIR(), ; // where to run EXE
nSW ) // here SW_* Constante
DO CASE
CASE lSuccess > 32
Retvar := .T.
greetings by OHR
Jimmy
Jimmy
Re: An external program window breaks the order of the windo
I have a similar problem.Eugene Lutsenko wrote:The progress bar of the external program brings the current window to the background. How to make the current window does not disappear in the background, and remained on the screen?
We have a process that calls a browser on the users PC using ShellExecuteA as Jimmy showed.
At this point we wait for a response to be returned from the browser. We receive the response correctly but the browser has taken the focus from our application and I would like to restore focus back to our application.
I seem to remember seeing something about bringing an application back to the foreground but I am having trouble locating it at the moment.
Regan Cawkwell
Real Business Applications Ltd
http://www.rbauk.com
Real Business Applications Ltd
http://www.rbauk.com
Re: An external program window breaks the order of the windo
And as is usual, I found the answer soon after posting the previous email:
SetForegroundWindow()
SetForegroundWindow()
Regan Cawkwell
Real Business Applications Ltd
http://www.rbauk.com
Real Business Applications Ltd
http://www.rbauk.com
- Eugene Lutsenko
- Posts: 1649
- Joined: Sat Feb 04, 2012 2:23 am
- Location: Russia, Southern federal district, city of Krasnodar
- Contact:
Re: An external program window breaks the order of the windo
So far (temporarily) I have solved this problem so that just removed the progress bar of the external program. But actually, he's needed. I'll try to keep my window in the foreground with SetForegroundWindow (). Thank you!
Re: An external program window breaks the order of the windo
Hi
I recommend using trunprocess , it has many options
attached prg, use ot4xb
I recommend using trunprocess , it has many options
attached prg, use ot4xb
Re: An external program window breaks the order of the windo
Hi
I recommend using trunprocess , it has many options
attached prg, use ot4xb
example
local oProcess := TRunProcess():New()
oProcess:cAppName := NIL
oProcess:cParams := NIL
oProcess:cCmdLine := "java -jar FocusWsdian.jar " + alltrim(LcP2)
oProcess:lUseShowWindow := .T.
oProcess:wShowWindow := oProcess:swHide
if oProcess:Start()
while !oProcess:Wait( 500 ) // Wait 0,25 seconds
enddo
oProcess:Release()
endif
return .T.
Best Regard
Héctor
I recommend using trunprocess , it has many options
attached prg, use ot4xb
example
local oProcess := TRunProcess():New()
oProcess:cAppName := NIL
oProcess:cParams := NIL
oProcess:cCmdLine := "java -jar FocusWsdian.jar " + alltrim(LcP2)
oProcess:lUseShowWindow := .T.
oProcess:wShowWindow := oProcess:swHide
if oProcess:Start()
while !oProcess:Wait( 500 ) // Wait 0,25 seconds
enddo
oProcess:Release()
endif
return .T.
Best Regard
Héctor
- Attachments
-
- TRunProcess.rar
- (2.85 KiB) Downloaded 1018 times
- Eugene Lutsenko
- Posts: 1649
- Joined: Sat Feb 04, 2012 2:23 am
- Location: Russia, Southern federal district, city of Krasnodar
- Contact:
Re: An external program window breaks the order of the windo
I must admit that I do not understand how to apply SetForegroundWindow() to the first plan window does not go to the background when you run an external program. I looked at the application of this feature in Express, but did not understand how I can use it for this purpose. Could someone please give a simple working example that could be compiled
Re: An external program window breaks the order of the windo
you need more than 1 API CallEugene Lutsenko wrote:I must admit that I do not understand how to apply SetForegroundWindow() to the first plan window does not go to the background when you run an external program.
Code: Select all
PROCEDURE BringToFront(oDialog)
LOCAL cTitle := oDialog:Title
LOCAL hWndDlg := DllCall( "User32.dll", DLL_STDCALL, "FindWindowA", 0, cTitle )
IF !( hWndDlg == 0 )
DllCall( "User32.dll", DLL_STDCALL, "SetForegroundWindow", hWndDlg )
DllCall( "User32.dll", DLL_STDCALL, "BringWindowToTop", hWndDlg )
DllCall( "User32.dll", DLL_STDCALL, "ShowWindow", hWndDlg, 1 )
DllCall( "User32.dll", DLL_STDCALL, "UpdateWindow", hWndDlg )
ENDIF
RETURN
greetings by OHR
Jimmy
Jimmy
- Eugene Lutsenko
- Posts: 1649
- Joined: Sat Feb 04, 2012 2:23 am
- Location: Russia, Southern federal district, city of Krasnodar
- Contact:
Re: An external program window breaks the order of the windo
Jimmy! Can you compile my system on your computer? Would you like to install the Eidos system on your computer and try to do it? I can communicate with you via Skype and TeamViewer. I could show you the system. You interested?