永久会员
- 威望
- 1132
- 贡献
- 894
- 热心值
- 0
- 金币
- 680
- 注册时间
- 2019-7-19
|
- Gdiplus::GdiplusStartupInput gdiplusStartupInput;
- ULONG_PTR gdiplusToken;
- Gdiplus::GdiplusStartup(&gdiplusToken, &gdiplusStartupInput, nullptr);
- POINT pt;
- GetCursorPos(&pt);
- /* 0 , 0 改一下*/
- if (pt.x == 0 && pt.y == 0) {
- CURSORINFO cursorInfo = {sizeof(cursorInfo)};
- GetCursorInfo(&cursorInfo);
- if (cursorInfo.flags == CURSOR_SHOWING) {
- ICONINFO iconInfo;
- GetIconInfo(cursorInfo.hCursor, &iconInfo);
- Gdiplus::Bitmap bitmap(iconInfo.hbmColor, nullptr);
- CLSID clsid;
- CLSIDFromString(L"{557CF400-1A04-11D3-9A73-0000F81EF32E}", &clsid);
- bitmap.Save(L"cursor.bmp", &clsid);
- DeleteObject(iconInfo.hbmColor);
- DeleteObject(iconInfo.hbmMask);
- }
- }
- CURSORINFO cursorInfo = {sizeof(cursorInfo)};
- GetCursorInfo(&cursorInfo);
- Gdiplus::GdiplusShutdown(gdiplusToken);
复制代码
|
|