How to bring one background application in front and front application in back?
-
I want to know how to do it ? which concept used for it and how it works?
-
@Qt-embedded-developer
If you do mean two separate applications, I'm not sure that's a Qt thing. And I believe that Windows 10 at least puts restrictions on what applications are allowed to do, in the way of up-fronting other applications. -
-
@Qt-embedded-developer I thought about using QWidget::activateWindow() and QWidget::raise() but:
On Windows, if you are calling this when the application is not currently the active one then it will not make it the active window. It will change the color of the taskbar entry to indicate that the window has changed in some way. This is because Microsoft does not allow an application to interrupt what the user is currently doing in another application.
So either there has to be something in Windows API that you can use (I don't know) or you simply can't.
-
@Qt-embedded-developer
I believe in Windows that one application cannot up-front another application (don't know about down-backing it). I think it's to stop someone writing an app that fiddles with what other applications get up-fronted, because that could be annoying for the user. So I'm not sure your Qt app can up-front the bank's app, even if it wants to. I would suggest Googling for something along these lines to see what Windows does nor does not allow. -
@artwaw said in How to bring one background application in front and front application in back?:
This is because Microsoft does not allow an application to interrupt what the user is currently doing in another application.
Indeed. And although you/your quote only talks about an application not being to activate/up-front itself, doesn't that apply to other applications too? If an application could up-front a different application, wouldn't that also "allow an application to interrupt what the user is currently doing in another application."? Or, just maybe, an app could up-front a different app if and only if the first app is itself already up-front? Who knows. Which is why I suggested the OP might want to do some Googling on this topic.
-
Actually, my last remark reminded me that Windows has kiosk mode! https://docs.microsoft.com/en-us/windows/configuration/kiosk-single-app
@Qt-embedded-developer - with this approach you don't need to worry, assuming your POS is a sole function of the host.