43 #include <QtCore/qlibrary.h> 64 #ifndef SHIDIF_CANCELBUTTON 65 #define SHIDIF_CANCELBUTTON 0x0080 69 #define SHIDIM_FLAGS 0x0001 72 #ifndef SHIDIF_DONEBUTTON 73 #define SHIDIF_DONEBUTTON 0x0001 75 #ifndef SHIDIF_SIZEDLGFULLSCREEN 76 #define SHIDIF_SIZEDLGFULLSCREEN 0x0004 80 #define SHDB_HIDE 0x0002 83 #ifndef SHFS_SHOWTASKBAR 84 #define SHFS_SHOWTASKBAR 0x0001 86 #ifndef SHFS_HIDETASKBAR 87 #define SHFS_HIDETASKBAR 0x0002 89 #ifndef SHFS_SHOWSIPBUTTON 90 #define SHFS_SHOWSIPBUTTON 0x0004 92 #ifndef SHFS_HIDESIPBUTTON 93 #define SHFS_HIDESIPBUTTON 0x0008 95 #ifndef SHFS_SHOWSTARTICON 96 #define SHFS_SHOWSTARTICON 0x0010 98 #ifndef SHFS_HIDESTARTICON 99 #define SHFS_HIDESTARTICON 0x0020 103 #define SIPF_OFF 0x00000000 106 #define SIPF_ON 0x00000001 109 #ifndef SPI_SETSIPINFO 110 #define SPI_SETSIPINFO 224 112 #ifndef SPI_GETSIPINFO 113 #define SPI_GETSIPINFO 225 115 #ifndef SPI_GETPLATFORMTYPE 116 #define SPI_GETPLATFORMTYPE 257 144 qWarning(
"::GetDIBits(), lpvBits NULL");
148 GetObject(hSourceBitmap,
sizeof(BITMAP), &bm);
149 bm.bmHeight =
qAbs(bm.bmHeight);
151 HBITMAP hTargetBitmap;
155 memset(&dibInfo, 0,
sizeof(dibInfo));
156 dibInfo.bmiHeader.biBitCount = 32;
157 dibInfo.bmiHeader.biClrImportant = 0;
158 dibInfo.bmiHeader.biClrUsed = 0;
159 dibInfo.bmiHeader.biCompression = BI_RGB;;
160 dibInfo.bmiHeader.biHeight = -bm.bmHeight;
161 dibInfo.bmiHeader.biWidth = bm.bmWidth;
162 dibInfo.bmiHeader.biPlanes = 1;
163 dibInfo.bmiHeader.biSize =
sizeof(BITMAPINFOHEADER);
164 dibInfo.bmiHeader.biSizeImage = bm.bmWidth * bm.bmHeight * 4;
168 qWarning(
"::GetDIBits(), failed to GetDC");
172 int ret = bm.bmHeight;
174 hTargetBitmap = CreateDIBSection(displayDC, (
const BITMAPINFO*) &dibInfo, DIB_RGB_COLORS,
175 (
void**)&pixels, NULL, 0);
176 if (!hTargetBitmap) {
177 qWarning(
"::GetDIBits(), failed to CreateDIBSection");
181 HDC hdcSrc = CreateCompatibleDC(displayDC);
182 HDC hdcDst = CreateCompatibleDC(displayDC);
184 if (!(hdcDst && hdcSrc)) {
185 qWarning(
"::GetDIBits(), failed to CreateCompatibleDC");
189 HBITMAP hOldBitmap1 = (HBITMAP) SelectObject(hdcSrc, hSourceBitmap);
190 HBITMAP hOldBitmap2 = (HBITMAP) SelectObject(hdcDst, hTargetBitmap);
192 if (!(hOldBitmap1 && hOldBitmap2)) {
193 qWarning(
"::GetDIBits(), failed to SelectObject for bitmaps");
197 if (!BitBlt(hdcDst, 0, 0, bm.bmWidth, bm.bmHeight, hdcSrc, 0, 0, SRCCOPY)) {
198 qWarning(
"::GetDIBits(), BitBlt failed");
202 SelectObject(hdcSrc, hOldBitmap1);
203 SelectObject(hdcDst, hOldBitmap2);
208 ReleaseDC(NULL, displayDC);
210 memcpy(lpvBits, pixels, dibInfo.bmiHeader.biSizeImage);
212 DeleteObject(hTargetBitmap);
218 SHELLEXECUTEINFO
info;
220 info.lpVerb = L
"Open";
222 info.lpParameters = params;
223 info.lpDirectory = dir;
224 info.nShow = showCmd;
225 info.cbSize =
sizeof(
info);
226 ShellExecuteEx(&info);
227 return info.hInstApp;
250 wchar_t tszPlatform[64];
251 if (SystemParametersInfo(
SPI_GETPLATFORMTYPE,
sizeof(tszPlatform) /
sizeof(
wchar_t), tszPlatform, 0))
252 if (0 == _tcsicmp(reinterpret_cast<const wchar_t *> (platformString.
utf16()), tszPlatform))
260 osvi.dwOSVersionInfoSize =
sizeof(osvi);
261 if (GetVersionEx(&osvi)) {
262 return osvi.dwBuildNumber;
270 osvi.dwOSVersionInfoSize =
sizeof(osvi);
271 if (GetVersionEx(&osvi)) {
272 return (osvi.dwMajorVersion * 10 + osvi.dwMinorVersion);
279 const DWORD dwFirstWM65BuildNumber = 21139;
281 osvi.dwOSVersionInfoSize =
sizeof(osvi);
282 if (!GetVersionEx(&osvi))
284 return osvi.dwMajorVersion > 5
285 || (osvi.dwMajorVersion == 5 && (osvi.dwMinorVersion > 2 ||
286 (osvi.dwMinorVersion == 2 && osvi.dwBuildNumber >= dwFirstWM65BuildNumber)));
303 HDC deviceContext = GetDC(0);
304 int dpi = GetDeviceCaps(deviceContext, LOGPIXELSX);
305 ReleaseDC(0, deviceContext);
306 if ((dpi < 1000) && (dpi > 0))
314 HWND hwnd = widget->
winId();
332 MoveWindow(hwnd, r.top, r.left, r.right - r.left, r.bottom - r.top,
true);
333 SetWindowLong(hwnd, GWL_EXSTYLE, GetWindowLong (hwnd, GWL_EXSTYLE) |
WS_EX_NODRAG);
350 ShowWindow(hwnd, SW_HIDE);
352 if (!IsWindowVisible(hwnd)) {
355 ShowWindow(hwnd, SW_SHOW);
357 ShowWindow(hwnd, SW_MINIMIZE);
374 HWND handle = FindWindow(L
"HHTaskBar", L
"");
376 ShowWindow(handle, 0);
377 EnableWindow(handle,
false);
383 SetWindowPos(hwnd, 0, 0, 0, 0, 0, swpf);
385 HWND handle = FindWindow(L
"HHTaskBar", L
"");
387 ShowWindow(handle, 1);
388 EnableWindow(handle,
true);
401 memset(&si, 0,
sizeof(si));
BOOL qt_wince_ChangeClipboardChain(HWND, HWND)
void qt_wince_minimize(HWND hwnd)
bool qt_wince_is_high_dpi()
static mach_timebase_info_data_t info
QPointer< QWidget > widget
#define SHIDIF_DONEBUTTON
#define SHFS_SHOWSTARTICON
int left() const
Returns the x-coordinate of the rectangle's left edge.
int width() const
Returns the width of the rectangle.
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
COLORREF qt_wince_PALETTEINDEX(WORD)
void qt_wince_maximize(QWidget *widget)
BOOL(* AygInitDialog)(AygSHINITDLGINFO *)
#define SHFS_HIDESIPBUTTON
void * resolve(const char *symbol)
Returns the address of the exported symbol symbol.
BOOL(* AygSHSipInfo)(UINT, UINT, PVOID, UINT)
int height() const
Returns the height of the rectangle.
The QString class provides a Unicode character string.
void qt_wince_full_screen(HWND hwnd, bool fullScreen, UINT swpf)
Q_DECL_CONSTEXPR T qAbs(const T &t)
#define SHFS_SHOWSIPBUTTON
static AygInitDialog ptrAygInitDialog
#define SPI_GETPLATFORMTYPE
bool qt_wince_is_pocket_pc()
static AygSHDoneButton ptrAygSHDoneButton
void qt_wince_hide_taskbar(HWND hwnd)
void qt_wince_unmaximize(QWidget *widget)
Q_CORE_EXPORT void qWarning(const char *,...)
void qt_wince_show_SIP(bool show)
bool qt_wince_is_windows_mobile_65()
HWND qt_wince_SetClipboardViewer(HWND)
#define FALSE
Synonym for false.
bool qt_wince_is_smartphone()
HINSTANCE qt_wince_ShellExecute(HWND hwnd, LPCWSTR, LPCWSTR file, LPCWSTR params, LPCWSTR dir, int showCmd)
bool qt_wince_is_mobile()
#define SHFS_HIDESTARTICON
#define SHIDIF_SIZEDLGFULLSCREEN
static AygFullScreen ptrAygFullScreen
int top() const
Returns the y-coordinate of the rectangle's top edge.
static AygSHSipInfo ptrAygSHSipInfo
bool qt_wince_is_platform(const QString &platformString)
int qt_wince_GetDIBits(HDC, HBITMAP hSourceBitmap, uint, uint, LPVOID lpvBits, LPBITMAPINFO, uint)
BOOL(* AygSHDoneButton)(HWND, DWORD)
static QString fromLatin1(const char *, int size=-1)
Returns a QString initialized with the first size characters of the Latin-1 string str...
int qt_wince_get_version()
if(void) toggleToolbarShown
The QRect class defines a rectangle in the plane using integer precision.
#define QT_USE_NAMESPACE
This macro expands to using QT_NAMESPACE if QT_NAMESPACE is defined and nothing otherwise.
BOOL(* AygFullScreen)(HWND, DWORD)
static void resolveAygLibs()
The QLibrary class loads shared libraries at runtime.
const ushort * utf16() const
Returns the QString as a '\0\'-terminated array of unsigned shorts.
#define SHIDIF_CANCELBUTTON