Qt 4.8
Classes | Macros | Typedefs | Functions | Variables
qsystemtrayicon_win.cpp File Reference
#include "qsystemtrayicon_p.h"
#include <qt_windows.h>
#include <windowsx.h>
#include <commctrl.h>
#include <private/qsystemlibrary_p.h>
#include <QApplication>
#include <QSettings>

Go to the source code of this file.

Classes

struct  Q_NOTIFYICONIDENTIFIER
 
class  QSystemTrayIconSys
 

Macros

#define _WIN32_IE   0x600
 
#define _WIN32_WINNT   0x0600
 
#define MYWM_NOTIFYICON   (WM_APP+101)
 
#define NIF_SHOWTIP   0x00000080
 
#define NIN_BALLOONTIMEOUT   (WM_USER + 4)
 
#define NIN_BALLOONUSERCLICK   (WM_USER + 5)
 
#define NIN_KEYSELECT   (WM_USER + 1)
 
#define NIN_SELECT   (WM_USER + 0)
 
#define NOTIFYICON_VERSION_4   4
 
#define Q_MSGFLT_ALLOW   1
 

Typedefs

typedef BOOL(WINAPI * PtrChangeWindowMessageFilter) (UINT message, DWORD dwFlag)
 
typedef BOOL(WINAPI * PtrChangeWindowMessageFilterEx) (HWND hWnd, UINT message, DWORD action, void *pChangeFilterStruct)
 
typedef HRESULT(WINAPI * PtrShell_NotifyIconGetRect) (const Q_NOTIFYICONIDENTIFIER *identifier, RECT *iconLocation)
 

Functions

static bool allowsMessages ()
 
static int iconFlag (QSystemTrayIcon::MessageIcon icon)
 

Variables

static uint MYWM_TASKBARCREATED = 0
 
static const UINT q_uNOTIFYICONID = 0
 

Macro Definition Documentation

◆ _WIN32_IE

#define _WIN32_IE   0x600

Definition at line 50 of file qsystemtrayicon_win.cpp.

◆ _WIN32_WINNT

#define _WIN32_WINNT   0x0600

Definition at line 46 of file qsystemtrayicon_win.cpp.

◆ MYWM_NOTIFYICON

#define MYWM_NOTIFYICON   (WM_APP+101)

◆ NIF_SHOWTIP

#define NIF_SHOWTIP   0x00000080

◆ NIN_BALLOONTIMEOUT

#define NIN_BALLOONTIMEOUT   (WM_USER + 4)

Definition at line 88 of file qsystemtrayicon_win.cpp.

◆ NIN_BALLOONUSERCLICK

#define NIN_BALLOONUSERCLICK   (WM_USER + 5)

Definition at line 92 of file qsystemtrayicon_win.cpp.

Referenced by QSystemTrayIconSys::winEvent().

◆ NIN_KEYSELECT

#define NIN_KEYSELECT   (WM_USER + 1)

Definition at line 84 of file qsystemtrayicon_win.cpp.

Referenced by QSystemTrayIconSys::winEvent().

◆ NIN_SELECT

#define NIN_SELECT   (WM_USER + 0)

Definition at line 80 of file qsystemtrayicon_win.cpp.

Referenced by QSystemTrayIconSys::winEvent().

◆ NOTIFYICON_VERSION_4

#define NOTIFYICON_VERSION_4   4

◆ Q_MSGFLT_ALLOW

#define Q_MSGFLT_ALLOW   1

Definition at line 99 of file qsystemtrayicon_win.cpp.

Referenced by QSystemTrayIconSys::QSystemTrayIconSys().

Typedef Documentation

◆ PtrChangeWindowMessageFilter

typedef BOOL(WINAPI * PtrChangeWindowMessageFilter) (UINT message, DWORD dwFlag)

Definition at line 102 of file qsystemtrayicon_win.cpp.

◆ PtrChangeWindowMessageFilterEx

typedef BOOL(WINAPI * PtrChangeWindowMessageFilterEx) (HWND hWnd, UINT message, DWORD action, void *pChangeFilterStruct)

Definition at line 103 of file qsystemtrayicon_win.cpp.

◆ PtrShell_NotifyIconGetRect

typedef HRESULT(WINAPI * PtrShell_NotifyIconGetRect) (const Q_NOTIFYICONIDENTIFIER *identifier, RECT *iconLocation)

Definition at line 101 of file qsystemtrayicon_win.cpp.

Function Documentation

◆ allowsMessages()

static bool allowsMessages ( )
static

Definition at line 126 of file qsystemtrayicon_win.cpp.

Referenced by QSystemTrayIconSys::findIconGeometry().

127 {
128 #ifndef QT_NO_SETTINGS
129  QSettings settings(QLatin1String("HKEY_CURRENT_USER\\Software\\Microsoft"
130  "\\Windows\\CurrentVersion\\Explorer\\Advanced"), QSettings::NativeFormat);
131  return settings.value(QLatin1String("EnableBalloonTips"), true).toBool();
132 #else
133  return false;
134 #endif
135 }
The QSettings class provides persistent platform-independent application settings.
Definition: qsettings.h:73
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString

◆ iconFlag()

static int iconFlag ( QSystemTrayIcon::MessageIcon  icon)
static

Definition at line 193 of file qsystemtrayicon_win.cpp.

Referenced by QSystemTrayIconSys::showMessage().

194 {
195  switch (icon) {
197  return NIIF_INFO;
199  return NIIF_WARNING;
201  return NIIF_ERROR;
203  return NIIF_NONE;
204  default:
205  Q_ASSERT_X(false, "QSystemTrayIconSys::showMessage", "Invalid QSystemTrayIcon::MessageIcon value");
206  return NIIF_NONE;
207  }
208 }
#define Q_ASSERT_X(cond, where, what)
Definition: qglobal.h:1837

Variable Documentation

◆ MYWM_TASKBARCREATED

uint MYWM_TASKBARCREATED = 0
static

◆ q_uNOTIFYICONID

const UINT q_uNOTIFYICONID = 0
static