Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. General talk
  3. Brainstorm
  4. How to bring one background application in front and front application in back?
QtWS25 Last Chance

How to bring one background application in front and front application in back?

Scheduled Pinned Locked Moved Unsolved Brainstorm
9 Posts 3 Posters 1.0k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Q Offline
    Q Offline
    Qt embedded developer
    wrote on last edited by
    #1

    I want to know how to do it ? which concept used for it and how it works?

    JonBJ artwawA 2 Replies Last reply
    0
    • Q Qt embedded developer

      I want to know how to do it ? which concept used for it and how it works?

      JonBJ Offline
      JonBJ Offline
      JonB
      wrote on last edited by
      #2

      @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.

      Q 1 Reply Last reply
      1
      • JonBJ JonB

        @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.

        Q Offline
        Q Offline
        Qt embedded developer
        wrote on last edited by Qt embedded developer
        #3

        @JonB @artwaw if i implement POS ( point of sale ) application using qt then it will accept the bank card okay. so at that time bank application i need to invoke so this type of functionality how we can achieve.

        JonBJ 1 Reply Last reply
        0
        • Q Qt embedded developer

          I want to know how to do it ? which concept used for it and how it works?

          artwawA Offline
          artwawA Offline
          artwaw
          wrote on last edited by artwaw
          #4

          @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.

          For more information please re-read.

          Kind Regards,
          Artur

          JonBJ 1 Reply Last reply
          1
          • Q Qt embedded developer

            @JonB @artwaw if i implement POS ( point of sale ) application using qt then it will accept the bank card okay. so at that time bank application i need to invoke so this type of functionality how we can achieve.

            JonBJ Offline
            JonBJ Offline
            JonB
            wrote on last edited by
            #5

            @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.

            artwawA 1 Reply Last reply
            0
            • JonBJ JonB

              @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.

              artwawA Offline
              artwawA Offline
              artwaw
              wrote on last edited by
              #6

              @JonB According to the documentation what OP asks is not doable. I edited my response to show full quote.
              What OP can do (again, according to docs) is to notify that the program changed state.

              For more information please re-read.

              Kind Regards,
              Artur

              1 Reply Last reply
              1
              • artwawA artwaw

                @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.

                JonBJ Offline
                JonBJ Offline
                JonB
                wrote on last edited by
                #7

                @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.

                artwawA 1 Reply Last reply
                1
                • JonBJ JonB

                  @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.

                  artwawA Offline
                  artwawA Offline
                  artwaw
                  wrote on last edited by
                  #8

                  @JonB Agreed. That is why I suggested Windows API, if anything.

                  It was way easier in Windows 95, where one could just substitute for explorer.exe in win.ini and indicated application was sole owner of the desktop. ;)

                  For more information please re-read.

                  Kind Regards,
                  Artur

                  1 Reply Last reply
                  0
                  • artwawA Offline
                    artwawA Offline
                    artwaw
                    wrote on last edited by
                    #9

                    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.

                    For more information please re-read.

                    Kind Regards,
                    Artur

                    1 Reply Last reply
                    0

                    • Login

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • Users
                    • Groups
                    • Search
                    • Get Qt Extensions
                    • Unsolved