ЧГ
Чарльз ГринDec. 16, 2018, 3:04 a.m.

Как сменить превью окна в Qt программе на windows?

Qt, c++, WinApi

Добрый день, есть приложение, с нестандартным интерфейсом. Как можно поменять превью приложения в панели задач на свою картинку? Как например в аimp, там наводишь мышь на иконку в таск баре и показывается какой-то значок, никак не само приложение, хотелось бы в своём проекте подобное реализовать. Спасибо

We recommend hosting TIMEWEB
We recommend hosting TIMEWEB
Stable hosting, on which the social network EVILEG is located. For projects on Django we recommend VDS hosting.

Do you like it? Share on social networks!

2
Evgenii Legotckoi
  • Dec. 16, 2018, 6:38 a.m.
  • The answer was marked as a solution.

Добрый день!

Скорее всего нужно будет использовать winextras компоненты.

Вот несколько статей на эту тему:

Они не имеют прямого отношения к тому, что вам нужно, но там есть пример того, как использовать QtWinExtras классы.

Возможно, что-то можно будет сделать с помощью класса QWinTaskbarButton

А вообще, из того, что там что-то можно сделать, максимум будет в одном из этих классов

Если там нет необходимого, то тогда придётся смотреть в сторону использования WinAPI напрямую.

    R
    • Dec. 16, 2018, 9:41 a.m.

    перевірено все працює

    http://doc.qt.io/qt-5/appicon.html

    Setting the Application Icon on Windows

    First, create an ICO format bitmap file that contains the icon image. This can be done with e.g. Microsoft Visual C++: Select File|New, then select the File tab in the dialog that appears, and choose Icon. (Note that you do not need to load your application into Visual C++; here we are only using the icon editor.)

    Alternatively, an .ico file can be created from a set of images using ImageMagick's convert tool:

    magick.exe convert icon-16.png icon-32.png icon-256.png icon.ico

    Store the ICO file in your application's source code directory, for example, with the name myappico.ico.

    Then, assuming you are using qmake to generate your makefiles, you only need to add a single line to your .pro project file:

    RC_ICONS = myappico.ico

    Finally, regenerate your makefile and your application. The .exe file will now be represented by your icon in Explorer.

    However, if you already have an .rc file, for example, with the name myapp.rc, which you want to reuse, the following two steps will be required. First, put a single line of text to the myapp.rc file:

    IDI_ICON1 ICON DISCARDABLE "myappico.ico"

    Then, add this line to your myapp.pro file:

    RC_FILE = myapp.rc

    If you do not use qmake, the necessary steps are: first, create an .rc file and run the rc or windres program on the .rc file, then link your application with the resulting .res file.

      Comments

      Only authorized users can post comments.
      Please, Log in or Sign up
      AD

      C ++ - Test 004. Pointers, Arrays and Loops

      • Result:50points,
      • Rating points-4
      m

      C ++ - Test 004. Pointers, Arrays and Loops

      • Result:80points,
      • Rating points4
      m

      C ++ - Test 004. Pointers, Arrays and Loops

      • Result:20points,
      • Rating points-10
      Last comments
      i
      innorwallNov. 15, 2024, 5:44 a.m.
      Qt/C++ - Lesson 039. How to paint stroke in QSqlTableModel by value in the column? Many OPKs would advise users to start using the test strips around day 9 of your cycle, considering day 1 to be the first day of full menstrual flow buy priligy australia
      i
      innorwallNov. 15, 2024, 2:27 a.m.
      Release of C++/Qt and QML application deployment utility CQtDeployer v1.4.0 (Binary Box) optionally substituted alkoxy, optionally substituted alkenyloxy, optionally substituted alkynyloxy, optionally substituted aryloxy, OCH, OC H, OC H, OC H, OC H, OC H, OC H, O C CH, OCH CH OH, O…
      i
      innorwallNov. 14, 2024, 9:26 p.m.
      Qt/C++ - Lesson 031. QCustomPlot – The build of charts with time buy generic priligy We can just chat, and we will not lose too much time anyway
      i
      innorwallNov. 14, 2024, 7:03 p.m.
      Qt/C++ - Lesson 060. Configuring the appearance of the application in runtime I didnt have an issue work colors priligy dapoxetine 60mg revia cost uk August 3, 2022 Reply
      i
      innorwallNov. 14, 2024, 12:07 p.m.
      Circuit switching and packet data transmission networks Angioedema 1 priligy dapoxetine
      Now discuss on the forum
      t
      tonypeachey1Nov. 15, 2024, 6:04 a.m.
      google domain [url=https://google.com/]domain[/url] domain [http://www.example.com link title]
      i
      innorwallNov. 15, 2024, 5:50 a.m.
      добавить qlineseries в функции priligy for sale Gently flush using an ear syringe
      i
      innorwallNov. 11, 2024, 10:55 a.m.
      Всё ещё разбираюсь с кешем. priligy walgreens levitra dulcolax carbs The third ring was found to be made up of ultra relativistic electrons, which are also present in both the outer and inner rings
      9
      9AnonimOct. 25, 2024, 9:10 a.m.
      Машина тьюринга // Начальное состояние 0 0, ,<,1 // Переход в состояние 1 при пустом символе 0,0,>,0 // Остаемся в состоянии 0, двигаясь вправо при встрече 0 0,1,>…

      Follow us in social networks