LibreOffice Module sfx2 (master) 1
Macros | Functions | Variables
shutdowniconw32.cxx File Reference
#include <sal/macros.h>
#include <sal/log.hxx>
#include <unotools/moduleoptions.hxx>
#include <unotools/dynamicmenuoptions.hxx>
#include "shutdownicon.hxx"
#include <sfx2/sfxresid.hxx>
#include <sfx2/strings.hrc>
#include <shlobj.h>
#include <objidl.h>
#include <osl/diagnose.h>
#include <osl/thread.h>
#include <systools/win32/qswin32.h>
#include <comphelper/sequenceashashmap.hxx>
#include <comphelper/windowserrorstring.hxx>
#include <o3tl/char16_t2wchar_t.hxx>
#include <set>
Include dependency graph for shutdowniconw32.cxx:

Go to the source code of this file.

Macros

#define EXECUTER_WINDOWCLASS   L"SO Executer Class"
 
#define EXECUTER_WINDOWNAME   L"SO Executer Window"
 
#define ID_QUICKSTART   1
 
#define IDM_EXIT   2
 
#define IDM_OPEN   3
 
#define IDM_WRITER   4
 
#define IDM_CALC   5
 
#define IDM_IMPRESS   6
 
#define IDM_DRAW   7
 
#define IDM_BASE   8
 
#define IDM_TEMPLATE   9
 
#define IDM_MATH   12
 
#define IDM_INSTALL   10
 
#define IDM_STARTCENTER   14
 
#define ICON_LO_DEFAULT   1
 
#define ICON_TEXT_DOCUMENT   2
 
#define ICON_SPREADSHEET_DOCUMENT   4
 
#define ICON_DRAWING_DOCUMENT   6
 
#define ICON_PRESENTATION_DOCUMENT   8
 
#define ICON_TEMPLATE   11
 
#define ICON_DATABASE_DOCUMENT   12
 
#define ICON_MATH_DOCUMENT   13
 
#define ICON_OPEN   5
 
#define SFX_TASKBAR_NOTIFICATION   WM_USER+1
 
#define ALLOC(type, n)   static_cast<type *>(HeapAlloc(GetProcessHeap(), 0, sizeof(type) * n ))
 
#define FREE(p)   HeapFree(GetProcessHeap(), 0, p)
 

Functions

static void OnMeasureItem (HWND hwnd, LPMEASUREITEMSTRUCT lpmis)
 
static void OnDrawItem (HWND hwnd, LPDRAWITEMSTRUCT lpdis)
 
static void addMenuItem (HMENU hMenu, UINT id, UINT iconId, const OUString &text, int &pos, bool bOwnerdraw, const OUString &module)
 
static HMENU createSystrayMenu ()
 
static void deleteSystrayMenu (HMENU hMenu)
 
static void addTaskbarIcon (HWND hWnd)
 
static LRESULT CALLBACK listenerWndProc (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
static LRESULT CALLBACK executerWndProc (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
static DWORD WINAPI SystrayThread (LPVOID)
 
void win32_init_sys_tray ()
 
void win32_shutdown_sys_tray ()
 
static void SHFree_ (void *pv)
 
static OUString SHGetSpecialFolder (int nFolderID)
 
static HRESULT WINAPI SHCoCreateInstance (LPVOID lpszReserved, REFCLSID clsid, LPUNKNOWN pUnkUnknown, REFIID iid, LPVOID *ppv)
 
static bool CreateShortcut (const OUString &rAbsObject, const OUString &rAbsObjectPath, const OUString &rAbsShortcut, const OUString &rDescription, const OUString &rParameter)
 
static bool FileExistsW (LPCWSTR lpPath)
 

Variables

static HWND aListenerWindow = nullptr
 
static HWND aExecuterWindow = nullptr
 
static HMENU popupMenu = nullptr
 

Macro Definition Documentation

◆ ALLOC

#define ALLOC (   type,
  n 
)    static_cast<type *>(HeapAlloc(GetProcessHeap(), 0, sizeof(type) * n ))

Definition at line 672 of file shutdowniconw32.cxx.

◆ EXECUTER_WINDOWCLASS

#define EXECUTER_WINDOWCLASS   L"SO Executer Class"

Definition at line 43 of file shutdowniconw32.cxx.

◆ EXECUTER_WINDOWNAME

#define EXECUTER_WINDOWNAME   L"SO Executer Window"

Definition at line 44 of file shutdowniconw32.cxx.

◆ FREE

#define FREE (   p)    HeapFree(GetProcessHeap(), 0, p)

Definition at line 673 of file shutdowniconw32.cxx.

◆ ICON_DATABASE_DOCUMENT

#define ICON_DATABASE_DOCUMENT   12

Definition at line 67 of file shutdowniconw32.cxx.

◆ ICON_DRAWING_DOCUMENT

#define ICON_DRAWING_DOCUMENT   6

Definition at line 64 of file shutdowniconw32.cxx.

◆ ICON_LO_DEFAULT

#define ICON_LO_DEFAULT   1

Definition at line 61 of file shutdowniconw32.cxx.

◆ ICON_MATH_DOCUMENT

#define ICON_MATH_DOCUMENT   13

Definition at line 68 of file shutdowniconw32.cxx.

◆ ICON_OPEN

#define ICON_OPEN   5

Definition at line 69 of file shutdowniconw32.cxx.

◆ ICON_PRESENTATION_DOCUMENT

#define ICON_PRESENTATION_DOCUMENT   8

Definition at line 65 of file shutdowniconw32.cxx.

◆ ICON_SPREADSHEET_DOCUMENT

#define ICON_SPREADSHEET_DOCUMENT   4

Definition at line 63 of file shutdowniconw32.cxx.

◆ ICON_TEMPLATE

#define ICON_TEMPLATE   11

Definition at line 66 of file shutdowniconw32.cxx.

◆ ICON_TEXT_DOCUMENT

#define ICON_TEXT_DOCUMENT   2

Definition at line 62 of file shutdowniconw32.cxx.

◆ ID_QUICKSTART

#define ID_QUICKSTART   1

Definition at line 47 of file shutdowniconw32.cxx.

◆ IDM_BASE

#define IDM_BASE   8

Definition at line 54 of file shutdowniconw32.cxx.

◆ IDM_CALC

#define IDM_CALC   5

Definition at line 51 of file shutdowniconw32.cxx.

◆ IDM_DRAW

#define IDM_DRAW   7

Definition at line 53 of file shutdowniconw32.cxx.

◆ IDM_EXIT

#define IDM_EXIT   2

Definition at line 48 of file shutdowniconw32.cxx.

◆ IDM_IMPRESS

#define IDM_IMPRESS   6

Definition at line 52 of file shutdowniconw32.cxx.

◆ IDM_INSTALL

#define IDM_INSTALL   10

Definition at line 57 of file shutdowniconw32.cxx.

◆ IDM_MATH

#define IDM_MATH   12

Definition at line 56 of file shutdowniconw32.cxx.

◆ IDM_OPEN

#define IDM_OPEN   3

Definition at line 49 of file shutdowniconw32.cxx.

◆ IDM_STARTCENTER

#define IDM_STARTCENTER   14

Definition at line 58 of file shutdowniconw32.cxx.

◆ IDM_TEMPLATE

#define IDM_TEMPLATE   9

Definition at line 55 of file shutdowniconw32.cxx.

◆ IDM_WRITER

#define IDM_WRITER   4

Definition at line 50 of file shutdowniconw32.cxx.

◆ SFX_TASKBAR_NOTIFICATION

#define SFX_TASKBAR_NOTIFICATION   WM_USER+1

Definition at line 71 of file shutdowniconw32.cxx.

Function Documentation

◆ addMenuItem()

static void addMenuItem ( HMENU  hMenu,
UINT  id,
UINT  iconId,
const OUString &  text,
int pos,
bool  bOwnerdraw,
const OUString &  module 
)
static

Definition at line 91 of file shutdowniconw32.cxx.

References IDM_TEMPLATE, mi, module, pos, text(), and TRUE.

Referenced by createSystrayMenu().

◆ addTaskbarIcon()

static void addTaskbarIcon ( HWND  hWnd)
static

Definition at line 223 of file shutdowniconw32.cxx.

References ICON_LO_DEFAULT, ID_QUICKSTART, SFX_TASKBAR_NOTIFICATION, and SfxResId().

Referenced by listenerWndProc().

◆ CreateShortcut()

static bool CreateShortcut ( const OUString &  rAbsObject,
const OUString &  rAbsObjectPath,
const OUString &  rAbsShortcut,
const OUString &  rDescription,
const OUString &  rParameter 
)
static

Definition at line 718 of file shutdowniconw32.cxx.

References SHCoCreateInstance(), and TRUE.

◆ createSystrayMenu()

static HMENU createSystrayMenu ( )
static

◆ deleteSystrayMenu()

static void deleteSystrayMenu ( HMENU  hMenu)
static

Definition at line 205 of file shutdowniconw32.cxx.

References mi, and pos.

Referenced by listenerWndProc().

◆ executerWndProc()

static LRESULT CALLBACK executerWndProc ( HWND  hWnd,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)
static

◆ FileExistsW()

static bool FileExistsW ( LPCWSTR  lpPath)
static

Definition at line 756 of file shutdowniconw32.cxx.

◆ listenerWndProc()

static LRESULT CALLBACK listenerWndProc ( HWND  hWnd,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)
static

◆ OnDrawItem()

void OnDrawItem ( HWND  hwnd,
LPDRAWITEMSTRUCT  lpdis 
)
static

Definition at line 569 of file shutdowniconw32.cxx.

References FW_BOLD, PATCOPY, RECT, size, SIZE, x, and y.

Referenced by listenerWndProc().

◆ OnMeasureItem()

void OnMeasureItem ( HWND  hwnd,
LPMEASUREITEMSTRUCT  lpmis 
)
static

Definition at line 542 of file shutdowniconw32.cxx.

References FW_BOLD, GetDC, size, and SIZE.

Referenced by listenerWndProc().

◆ SHCoCreateInstance()

static HRESULT WINAPI SHCoCreateInstance ( LPVOID  lpszReserved,
REFCLSID  clsid,
LPUNKNOWN  pUnkUnknown,
REFIID  iid,
LPVOID *  ppv 
)
static

Definition at line 701 of file shutdowniconw32.cxx.

Referenced by CreateShortcut().

◆ SHFree_()

static void SHFree_ ( void *  pv)
static

Definition at line 662 of file shutdowniconw32.cxx.

Referenced by SHGetSpecialFolder().

◆ SHGetSpecialFolder()

static OUString SHGetSpecialFolder ( int  nFolderID)
static

Definition at line 675 of file shutdowniconw32.cxx.

References ALLOC, FREE, and SHFree_().

◆ SystrayThread()

static DWORD WINAPI SystrayThread ( LPVOID  )
static

Definition at line 429 of file shutdowniconw32.cxx.

References aListenerWindow, and SAL_WARN.

Referenced by win32_init_sys_tray().

◆ win32_init_sys_tray()

void win32_init_sys_tray ( )

◆ win32_shutdown_sys_tray()

void win32_shutdown_sys_tray ( )

Variable Documentation

◆ aExecuterWindow

HWND aExecuterWindow = nullptr
static

◆ aListenerWindow

HWND aListenerWindow = nullptr
static

Definition at line 73 of file shutdowniconw32.cxx.

Referenced by SystrayThread(), and win32_shutdown_sys_tray().

◆ popupMenu

HMENU popupMenu = nullptr
static

Definition at line 75 of file shutdowniconw32.cxx.

Referenced by listenerWndProc().