KShare/platformspecifics/u32/u32backend.cpp
ArsenArsen f2b2a7eb4a Implement recording [!tested] [prob. broken] [1AM]
Implement the basic barebone structure of GIF recording.
While it is likely broken (probably black frames and similar issues) it's a good start.
Good night.
2017-06-06 01:26:26 +02:00

27 lines
939 B
C++

#include "u32backend.hpp"
#include <QCursor>
#include <QtWin>
#include <windows.h>
std::tuple<QPoint, QPixmap> PlatformBackend::getCursor() {
CURSORINFO cursorInfo;
cursorInfo.cbSize = sizeof(cursorInfo);
if (GetCursorInfo(&cursorInfo)) {
if (cursorInfo.flags == CURSOR_SHOWING) {
ICONINFO info; // It took me 5 hours to get to here
if (GetIconInfo(cursorInfo.hCursor, &info)) {
return std::tuple<QPoint, QPixmap>(QPoint(info.xHotspot, info.yHotspot),
QtWin::fromHBITMAP(info.hbmColor, QtWin::HBitmapAlpha));
} else
return std::tuple<QPoint, QPixmap>(QPoint(0, 0), QPixmap());
} else
return std::tuple<QPoint, QPixmap>(QPoint(0, 0), QPixmap());
} else
return std::tuple<QPoint, QPixmap>(QPoint(0, 0), QPixmap());
}
DWORD pid() {
return GetCurrentProcessId();
}