1 /************************************************************************** 2 * Copyright (C) 2005-2020 by Oleksandr Shneyder * 3 * <o.shneyder@phoca-gmbh.de> * 4 * * 5 * This program is free software; you can redistribute it and/or modify * 6 * it under the terms of the GNU General Public License as published by * 7 * the Free Software Foundation; either version 2 of the License, or * 8 * (at your option) any later version. * 9 * This program is distributed in the hope that it will be useful, * 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 12 * GNU General Public License for more details. * 13 * * 14 * You should have received a copy of the GNU General Public License * 15 * along with this program. If not, see <https://www.gnu.org/licenses/>. * 16 ***************************************************************************/ 17 18 #ifndef _WAPI_H 19 #define _WAPI_H 20 #include "x2goclientconfig.h" 21 #ifdef Q_OS_WIN 22 #include <QRect> 23 #include <QPoint> 24 #include <QString> 25 #include <QStringList> 26 #include <QPixmap> 27 28 enum wapiCmdShow 29 { 30 WAPI_FORCEMINIMIZE, 31 WAPI_HIDE, 32 WAPI_MAXIMIZE, 33 WAPI_MINIMIZE, 34 WAPI_RESTORE, 35 WAPI_SHOW, 36 WAPI_SHOWDEFAULT, 37 WAPI_SHOWMAXIMIZED, 38 WAPI_SHOWMINIMIZED, 39 WAPI_SHOWMINNOACTIVE, 40 WAPI_SHOWNA, 41 WAPI_SHOWNOACTIVATE, 42 WAPI_SHOWNORMAL 43 }; 44 45 enum wapiBtnEvent 46 { 47 WAPI_LBUTTONUP, 48 WAPI_LBUTTONDOWN 49 }; 50 51 HWND wapiSetParent ( HWND child, HWND par ); 52 bool wapiClientRect ( HWND wnd, QRect& rect ); 53 bool wapiWindowRect ( HWND wnd, QRect& rect ); 54 bool wapiWindowRectWithoutDecoration(HWND wnd, QRect& rect) ; 55 bool wapiShowWindow ( HWND wnd, wapiCmdShow nCmdShow ); 56 bool wapiUpdateWindow ( HWND wnd ); 57 bool wapiSetWindowText ( HWND wnd, const QString& text); 58 void wapiSetWindowIcon ( HWND wnd, const QPixmap& icon); 59 bool wapiMoveWindow ( HWND wnd, int x, int y, int width, int height, 60 bool repaint ); 61 bool wapiGetBorders ( HWND wnd, int& vBorder, int& hBorder, int& barHeight ); 62 void wapiSetCallBackProc ( void ( *prc ) ( wapiBtnEvent, QPoint ) ); 63 void wapiHideFromTaskBar ( HWND wnd ); 64 HWND wapiFindWindow ( const ushort * className, const ushort * text ); 65 QString wapiShortFileName ( const QString& longName ); 66 bool wapiAccountInfo ( QString* retSid, QString* retUname, 67 QString* primaryGroupSID, QString* primaryGroupName, 68 QString* retSysName ); 69 void wapiShellExecute ( const QString& operation, const QString& file, 70 const QString& parameters, 71 const QString& dir,HWND win=0 ); 72 QString wapiGetDefaultPrinter(); 73 QStringList wapiGetLocalPrinters(); 74 long wapiSetFSWindow ( HWND hWnd, const QRect& desktopGeometry ); 75 void wapiRestoreWindow ( HWND hWnd, long style, const QRect& desktopGeometry ); 76 QString wapiGetDriveByLabel(const QString& label); 77 QString wapiGetUserName(); 78 79 80 #endif 81 #endif 82