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 22 Apr 2022, 13:34 last edited by
    #1

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

    J A 2 Replies Last reply 22 Apr 2022, 13:43
    0
    • Q Qt embedded developer
      22 Apr 2022, 13:34

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

      J Offline
      J Offline
      JonB
      wrote on 22 Apr 2022, 13:43 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 22 Apr 2022, 13:59
      1
      • J JonB
        22 Apr 2022, 13:43

        @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 22 Apr 2022, 13:59 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.

        J 1 Reply Last reply 22 Apr 2022, 14:08
        0
        • Q Qt embedded developer
          22 Apr 2022, 13:34

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

          A Offline
          A Offline
          artwaw
          wrote on 22 Apr 2022, 13:59 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

          J 1 Reply Last reply 22 Apr 2022, 14:27
          1
          • Q Qt embedded developer
            22 Apr 2022, 13:59

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

            J Offline
            J Offline
            JonB
            wrote on 22 Apr 2022, 14:08 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.

            A 1 Reply Last reply 22 Apr 2022, 14:16
            0
            • J JonB
              22 Apr 2022, 14:08

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

              A Offline
              A Offline
              artwaw
              wrote on 22 Apr 2022, 14:16 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
              • A artwaw
                22 Apr 2022, 13:59

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

                J Offline
                J Offline
                JonB
                wrote on 22 Apr 2022, 14:27 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.

                A 1 Reply Last reply 22 Apr 2022, 15:00
                1
                • J JonB
                  22 Apr 2022, 14:27

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

                  A Offline
                  A Offline
                  artwaw
                  wrote on 22 Apr 2022, 15:00 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
                  • A Offline
                    A Offline
                    artwaw
                    wrote on 22 Apr 2022, 15:04 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

                    1/9

                    22 Apr 2022, 13:34

                    • Login

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