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. [SOLVED] System tray icon
QtWS25 Last Chance

[SOLVED] System tray icon

Scheduled Pinned Locked Moved General and Desktop
10 Posts 3 Posters 3.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.
  • ? Offline
    ? Offline
    A Former User
    wrote on last edited by
    #1

    Hello... I woulld like to know if I can force system tray icon to be changed... I am using program developed by Qt, but I don't like its system tray icon... So I am wondering if there is any way using Qt or Microsoft Visual Studio to change tray icon...

    Something like "this":http://www.gdgsoft.com/gconvert/

    Thanks in advance

    1 Reply Last reply
    0
    • p3c0P Offline
      p3c0P Offline
      p3c0
      Moderators
      wrote on last edited by
      #2

      Hi,

      Are you using "QSystemTrayIcon":http://qt-project.org/doc/qt-5/QSystemTrayIcon.html in your application ?

      157

      1 Reply Last reply
      0
      • ? Offline
        ? Offline
        A Former User
        wrote on last edited by
        #3

        Hi... You did not understand my post... Application is not mine, but I know its developed by Qt... I am just user and I don't have access to source code... I want to force icon change to the application that is already running...

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Hi,

          Unless the icon is loaded from your hard drive or the original author offers some way of customizing it, you can't

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • ? Offline
            ? Offline
            A Former User
            wrote on last edited by
            #5

            Aha... Thank you

            EDIT: What about force minimizing and maximizing Qt app (I am just user) from system tray? I know that is possible to do, maybe you know how?

            Application already has built in minimize... However, I am running multiple applications 35 and have them minimized in system tray... Problem is that I never know which one is correct, so I have to open all of them... So I want to create my own app that will control these applications... I want to minimize and maximize ones that I want to use at the moment... Their names and which one is correct I could probably find with processes...

            Similar to "this":http://social.msdn.microsoft.com/Forums/vstudio/en-US/9bde4870-1599-4958-9ab4-902fa98ba53a/how-do-i-maximizeminimize-applications-programmatically-in-c?forum=csharpgeneral but with Qt, if possible...

            1 Reply Last reply
            0
            • ? Offline
              ? Offline
              A Former User
              wrote on last edited by
              #6

              Code below works with Notepad and minimize it fine... It also works with Qt application that is currently running with debugger and is executing that code below... However, it does not work with Qt app which I want to minimize...

              @
              void Test1::test()
              {
              HWND hwnd = FindWindow(NULL, L"appName");
              if (hwnd != 0)
              {
              ShowWindow(hwnd, SW_MINIMIZE);
              ui.label->setText("Window was found!");
              }
              else
              {
              ui.label->setText("Window was not found.");
              }
              }@

              Both applications below are built with Qt... For some reason I can minimize / maximize first one, but I can't do the same with second one... I just can't figure out where is the problem...

              This one works...
              !http://i.imgur.com/GEf6O9L.png(W)!

              This one does not work...
              !http://i.imgur.com/zbyjZ69.png(DW)!

              1 Reply Last reply
              0
              • SGaistS Offline
                SGaistS Offline
                SGaist
                Lifetime Qt Champion
                wrote on last edited by
                #7

                Just use the showMaximized and showMinimized slots

                Interested in AI ? www.idiap.ch
                Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                1 Reply Last reply
                0
                • ? Offline
                  ? Offline
                  A Former User
                  wrote on last edited by
                  #8

                  How can I do that? I guess you did not understand what I wrote... I am trying to minimize / maximize application which is built with Qt, but its not mine and I don't have its source code...

                  1 Reply Last reply
                  0
                  • SGaistS Offline
                    SGaistS Offline
                    SGaist
                    Lifetime Qt Champion
                    wrote on last edited by
                    #9

                    You might not be looking for the right name maybe use FindWindow with GetWindowText. However it's outside of this forum scope, you should rather ask on the MSDN forums

                    Interested in AI ? www.idiap.ch
                    Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                    1 Reply Last reply
                    0
                    • ? Offline
                      ? Offline
                      A Former User
                      wrote on last edited by
                      #10

                      Hey thanks for your answer... I already asked on MSDN forum and received answer there...

                      EDIT: Not closing yet

                      On MSDN forum they have told me to deal with "this":http://qt-project.org/doc/qt-4.8/qwidget.html#winId ... Since it's Qt thing I am leaving thread opened... I went through documentation but I could not find how do I get WinID of some external application?

                      bq. According to your description, do you mean that you have a windows application which is built with QT and you want to use the code above to find it and minimize or maximize it? If my understanding is right, how do you get the HWND for Qt application? As far as I know, in Qt it is WID but in C++ it is HWND.bq.

                      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