Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How to set focus on different application?
Forum Updated to NodeBB v4.3 + New Features

How to set focus on different application?

Scheduled Pinned Locked Moved Solved General and Desktop
4 Posts 2 Posters 524 Views 1 Watching
  • 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.
  • S Offline
    S Offline
    Shankar B
    wrote on last edited by
    #1

    Hi i have a button on my gui. When ever am clicking button, i need to set focus to already playing VLC media player.
    So am unable to figure it out. how to set focus to different application by button click.

    1 Reply Last reply
    0
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi
      You cannot do that with Qt as far as I know. You must use your platforms API
      to find the window and set focus to it.
      Do note that Windows 10 might not allow you to do so if VLC players is not in foreground.

      Can I ask what you try to do ? / what task is.

      1 Reply Last reply
      4
      • S Offline
        S Offline
        Shankar B
        wrote on last edited by
        #3

        Hi mrji, Actually i want to handle VLC media player(start,stop,pause) through Qt application.
        When i click start button in Qt application it should replicate in VLC player. same as for stop and pause.
        Both VLC and Qt application will running at same. When i click start button in QT application, i need to set focus to VLC player and start playing music.

        mrjjM 1 Reply Last reply
        0
        • S Shankar B

          Hi mrji, Actually i want to handle VLC media player(start,stop,pause) through Qt application.
          When i click start button in Qt application it should replicate in VLC player. same as for stop and pause.
          Both VLC and Qt application will running at same. When i click start button in QT application, i need to set focus to VLC player and start playing music.

          mrjjM Offline
          mrjjM Offline
          mrjj
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @Shankar-B

          Hi
          You will have to use Windows API for that. We cannot just all setFoucs in other app with pure Qt.

          However, there might be a better way

          https://forum.videolan.org/viewtopic.php?t=6065

          I would go and find out if that
          rc interface
          is still available

          1 Reply Last reply
          2

          • Login

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