Qt 6.x
The Qt SDK
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
qwindowssystemtrayicon.cpp File Reference
#include <QtCore/qt_windows.h>
#include "qwindowssystemtrayicon.h"
#include "qwindowscontext.h"
#include "qwindowstheme.h"
#include "qwindowsmenu.h"
#include "qwindowsscreen.h"
#include <QtGui/qguiapplication.h>
#include <QtGui/qpixmap.h>
#include <QtCore/qdebug.h>
#include <QtCore/qlist.h>
#include <QtCore/qrect.h>
#include <QtCore/qsettings.h>
#include <qpa/qwindowsysteminterface.h>
#include <commctrl.h>
#include <shellapi.h>
#include <shlobj.h>
#include <windowsx.h>
+ Include dependency graph for qwindowssystemtrayicon.cpp:

Go to the source code of this file.

Classes

struct  QWindowsHwndSystemTrayIconEntry
 

Macros

#define MYWM_NOTIFYICON   (WM_APP+101)
 

Typedefs

using HwndTrayIconEntries = QList< QWindowsHwndSystemTrayIconEntry >
 

Functions

Q_GUI_EXPORT HICON qt_pixmapToWinHICON (const QPixmap &)
 
static void qStringToLimitedWCharArray (QString in, wchar_t *target, int maxLength)
 
static void initNotifyIconData (NOTIFYICONDATA &tnd)
 
static void setIconContents (NOTIFYICONDATA &tnd, const QString &tip, HICON hIcon)
 
static void setIconVisibility (NOTIFYICONDATA &tnd, bool v)
 
static int indexOfHwnd (HWND hwnd)
 
LRESULT QT_WIN_CALLBACK qWindowsTrayIconWndProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
 
static HWND createTrayIconMessageWindow ()
 
QDebug operator<< (QDebug d, const QWindowsSystemTrayIcon *t)
 

Variables

static QT_BEGIN_NAMESPACE const UINT q_uNOTIFYICONID = 0
 
static uint MYWM_TASKBARCREATED = 0
 

Macro Definition Documentation

◆ MYWM_NOTIFYICON

#define MYWM_NOTIFYICON   (WM_APP+101)

Definition at line 30 of file qwindowssystemtrayicon.cpp.

Typedef Documentation

◆ HwndTrayIconEntries

Function Documentation

◆ createTrayIconMessageWindow()

static HWND createTrayIconMessageWindow ( )
inlinestatic

Definition at line 112 of file qwindowssystemtrayicon.cpp.

References className, QWindowsContext::classNamePrefix(), QWindowsContext::instance(), QStringLiteral, and qWindowsTrayIconWndProc().

+ Here is the call graph for this function:

◆ indexOfHwnd()

static int indexOfHwnd ( HWND  hwnd)
static

Definition at line 77 of file qwindowssystemtrayicon.cpp.

References QList< T >::at(), i, and QList< T >::size().

Referenced by qWindowsTrayIconWndProc().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initNotifyIconData()

static void initNotifyIconData ( NOTIFYICONDATA &  tnd)
inlinestatic

Definition at line 44 of file qwindowssystemtrayicon.cpp.

Referenced by QWindowsSystemTrayIcon::showMessage().

+ Here is the caller graph for this function:

◆ operator<<()

QDebug operator<< ( QDebug  d,
const QWindowsSystemTrayIcon t 
)

Definition at line 429 of file qwindowssystemtrayicon.cpp.

References d.

◆ qStringToLimitedWCharArray()

static void qStringToLimitedWCharArray ( QString  in,
wchar_t *  target,
int  maxLength 
)
inlinestatic

Definition at line 35 of file qwindowssystemtrayicon.cpp.

References qMin().

Referenced by setIconContents(), and QWindowsSystemTrayIcon::showMessage().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ qt_pixmapToWinHICON()

Q_GUI_EXPORT HICON qt_pixmapToWinHICON ( const QPixmap p)

Definition at line 536 of file qpixmap_win.cpp.

◆ qWindowsTrayIconWndProc()

LRESULT QT_WIN_CALLBACK qWindowsTrayIconWndProc ( HWND  hwnd,
UINT  message,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 87 of file qwindowssystemtrayicon.cpp.

References at, indexOfHwnd(), MYWM_NOTIFYICON, and MYWM_TASKBARCREATED.

Referenced by createTrayIconMessageWindow().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setIconContents()

static void setIconContents ( NOTIFYICONDATA &  tnd,
const QString tip,
HICON  hIcon 
)
static

Definition at line 51 of file qwindowssystemtrayicon.cpp.

References MYWM_NOTIFYICON, and qStringToLimitedWCharArray().

+ Here is the call graph for this function:

◆ setIconVisibility()

static void setIconVisibility ( NOTIFYICONDATA &  tnd,
bool  v 
)
static

Definition at line 59 of file qwindowssystemtrayicon.cpp.

Variable Documentation

◆ MYWM_TASKBARCREATED

uint MYWM_TASKBARCREATED = 0
static

◆ q_uNOTIFYICONID