VC如何改变其他程序窗口的背景色
HWNDhwnd=(HWND)0x062103C4;HBRUSHhbrush=(HBRUSH)GetStockObject(BLACK_BRUSH);if(!SetCla...
HWND hwnd = (HWND)0x062103C4;
HBRUSH hbrush = (HBRUSH)GetStockObject(BLACK_BRUSH);
if (!SetClassLong(hwnd,GCL_HBRBACKGROUND,(DWORD)hbrush))
{
MessageBox(NULL,"failed","err",MB_OK | MB_ICONERROR);
DWORD err = GetLastError();
}
return 0;
我用这些代码,想改变句柄为0x062103C4的窗口的背景色,为什么改变不了,函数调用返回0,GetLastError返回也是0 展开
HBRUSH hbrush = (HBRUSH)GetStockObject(BLACK_BRUSH);
if (!SetClassLong(hwnd,GCL_HBRBACKGROUND,(DWORD)hbrush))
{
MessageBox(NULL,"failed","err",MB_OK | MB_ICONERROR);
DWORD err = GetLastError();
}
return 0;
我用这些代码,想改变句柄为0x062103C4的窗口的背景色,为什么改变不了,函数调用返回0,GetLastError返回也是0 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询