#include <windows.h>
#include "WinUser.h"
#pragma comment(lib, "User32.lib")
//设置自定义鼠标样式
QString dirPath = QCoreApplication::applicationDirPath() + "/";
QString fullDirPath = dirPath + "Picker32.ico";
LOG(INFO) <<"cursor fullDirPath "<<fullDirPath.toStdString();
QByteArray ba = fullDirPath.toLatin1();
char* szStr = ba.data();
LOG(INFO) <<std::string(szStr);
WCHAR wszClassName[256];
memset(wszClassName,0,sizeof(wszClassName));
MultiByteToWideChar(CP_ACP,0,szStr,strlen(szStr)+1,wszClassName,
sizeof(wszClassName)/sizeof(wszClassName[0]));
HCURSOR hcur = (HCURSOR)LoadImage(NULL,wszClassName,IMAGE_ICON,32,32,LR_LOADFROMFILE);
::SetSystemCursor(hcur, 32512);
::SystemParametersInfo(SPI_SETCURSORS,0,NULL,SPIF_SENDCHANGE); //设置鼠标为默认样式
HCURSOR hcur = LoadCursorW(NULL, IDC_ARROW);//系统样式
::SetSystemCursor(hcur, 32512);