Add geometries list

This commit is contained in:
Ximi1970
2020-02-23 22:32:41 +01:00
parent a020b6c256
commit 983154471e
3 changed files with 35 additions and 30 deletions

View File

@@ -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

View File

@@ -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
*/

View File

@@ -13,6 +13,7 @@
* Qt includes
*/
#include <QObject>
#include <QRect>
/**
* @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