diff --git a/app/SysTray-X/SysTray-X.pro b/app/SysTray-X/SysTray-X.pro index 1fe873b..22a9ddc 100644 --- a/app/SysTray-X/SysTray-X.pro +++ b/app/SysTray-X/SysTray-X.pro @@ -37,35 +37,6 @@ unix:!macx: { win32: { LIBS += User32.lib # QMAKE_LFLAGS += -static -lwinpthread -static-libgcc -static-libstdc++ $$(QMAKE_LFLAGS_WINDOWS) - - # - # Windows host (not used in cross compiling with mingw on Linux) - # - contains(QMAKE_HOST.os, Windows): { - contains(QMAKE_HOST.version, 192): { - # - # Windows 10 Universal CRT - # - UCRT_INCLUDE = "C:/Program Files (x86)/Windows Kits/10/include/10.0.10240.0/ucrt" - UCRT_LIBS = "C:/Program Files (x86)/Windows Kits/10/Lib/10.0.10240.0/ucrt" - - INCLUDEPATH += $$UCRT_INCLUDE - - contains(QMAKE_TARGET.arch, x86_64) { - CONFIG(debug, debug|release) { - LIBS += $$UCRT_LIBS"/x64/ucrtd.lib" - } else { - LIBS += $$UCRT_LIBS"/x64/ucrt.lib" - } - } else { - CONFIG(debug, debug|release) { - LIBS += $$UCRT_LIBS"/x86/ucrtd.lib" - } else { - LIBS += $$UCRT_LIBS"/x86/ucrt.lib" - } - } - } - } } unix:macx: { QMAKE_LFLAGS += -framework IOKit -framework Foundation diff --git a/app/SysTray-X/windowctrl-win.cpp b/app/SysTray-X/windowctrl-win.cpp index 30f767a..369a726 100644 --- a/app/SysTray-X/windowctrl-win.cpp +++ b/app/SysTray-X/windowctrl-win.cpp @@ -11,6 +11,7 @@ * Statics */ QList< quint64 > WindowCtrlWin::m_tb_windows; +QList< QRect > WindowCtrlWin::m_tb_geometries; /* @@ -31,7 +32,12 @@ bool WindowCtrlWin::findWindow( const QString& title ) EnumWindows( &EnumWindowsProc, (LPARAM)(LPSTR)( title.toStdString().c_str() ) ); - return false; + if( m_tb_windows.length() == 0 ) + { + return false; + } + + return true; } @@ -59,6 +65,12 @@ BOOL CALLBACK WindowCtrlWin::EnumWindowsProc( HWND hwnd, LPARAM lParam ) if( written && strstr( buffer, (char*)lParam ) != NULL ) { m_tb_windows.append( (quint64)hwnd ); + + RECT rect; + if( GetWindowRect(hwnd, &rect) ) + { + m_tb_geometries.append( QRect( QPoint( rect.left, rect.top ), QPoint( rect.right, rect.bottom ) ) ); + } } return TRUE; @@ -74,6 +86,15 @@ QList< quint64 > WindowCtrlWin::getWinIds() } +/* + * Get the Thunderbird window geometries + */ +QList< QRect > WindowCtrlWin::getWinGeos() +{ + return m_tb_geometries; +} + + /* * Minimize a window */ diff --git a/app/SysTray-X/windowctrl-win.h b/app/SysTray-X/windowctrl-win.h index 9c40097..8198bf1 100644 --- a/app/SysTray-X/windowctrl-win.h +++ b/app/SysTray-X/windowctrl-win.h @@ -13,6 +13,7 @@ * Qt includes */ #include +#include /** * @brief The WindowCtrlWin class @@ -53,6 +54,13 @@ class WindowCtrlWin : public QObject */ QList< quint64 > getWinIds(); + /** + * @brief getWinGeos. Get the window geometries. + * + * @return + */ + QList< QRect > getWinGeos(); + /** * @brief minimizeWindow. Minimize window. * @@ -119,6 +127,11 @@ class WindowCtrlWin : public QObject * @brief m_tb_window. The Thunderbird windows. */ static QList< quint64 > m_tb_windows; + + /** + * @brief m_tb_geometries. The Thunderbird window geometries. + */ + static QList< QRect > m_tb_geometries; }; #endif // WINDOWCTRLWIN_H