Здравствуйте, уважаемые коллеги. Хочу покрасить фон открытых окон в Windows из Аксапты, используя WinApi. Перечитал здесь и в инете кучу всего. Везде советуют следующее :
В классе WinApi прописываем SetClassLong
X++:
client static int setClassLong(int hWnd, int offset, int newValue)
{
DLL _winApiDLL = new DLL(#UserDLL);
DLLFunction _setClassLong = new DLLFunction(_winApiDLL, 'SetClassLongW');
_setClassLong.arg(ExtTypes::DWord, ExtTypes::DWord, ExtTypes::DWord);
_setClassLong.returns(ExtTypes::DWord);
return _setClassLong.call(hWnd, offset, newValue);
}
пишем джоб
X++:
static void GreenCalc(Args _args)
{
#define.GCL_HBRBACKGROUND (-10)
int hWnd;
int brush,oldBrush;
WinGDI WinGDI = new WinGDI(0);
;
hWnd = winapi::findWindow('','Калькулятор');
brush = WinGDI.createSolidBrush(WinAPI::RGB2int(0,255,0));
oldBrush = WinAPI::getClassLong(hWnd, #GCL_HBRBACKGROUND);
WinAPI::setClassLong(hWnd, #GCL_HBRBACKGROUND, brush);
WinAPI::invalidateRect(hWnd);
WinGDI.deleteObject(oldBrush);
}
открываем калькулятор, запускаем джоб и нифига. Может кто подскажет в чем беда?
AX2009, WinXP