Главная страница
Top.Mail.Ru    Яндекс.Метрика
Текущий архив: 2004.02.10;
Скачать: CL | DM;

Вниз

Смена цвета окна   Найти похожие ветки 

 
Леприкон ©   (2003-12-05 09:08) [0]

Как сменить цвет у окна?

Пытаюсь продвигаться в сторону

//newBrush:HBRUSH;
newBrush:=CreateSolidBrush(RGB(100,0,200));
SetClassLong(Handle,GCL_HBRBACKGROUND,newBrush);
UpdateWindow(Handle);

но ничего не получается.


 
MBo ©   (2003-12-05 10:14) [1]


program Simple;

uses
Windows, Messages;

function AWndProc (Window: HWND; Message, WParam, LParam: DWord): Integer; stdcall;
var
ps : PAINTSTRUCT;
DC : HDC;
r : TRect;
begin
case Message of
WM_DESTROY:
begin
PostQuitMessage (0);
Result := 0;
Exit;
end;
WM_PAINT:
begin
dc := BeginPaint (Window, ps);
SetBKMode(dc,TRANSPARENT);
TextOut(DC, 10, 10, "Is it green?", 12);
EndPaint (Window, ps);
end;
end;
Result := DefWindowProc (Window, Message, WParam, LParam);
end;

var
WC : WNDCLASS;
H : HWND;
M : MSG;

begin
WC.hInstance := HInstance;
WC.hIcon := 0;

//WC.hbrBackground:=GetStockObject(LTGRAY_BRUSH);

WC.lpfnWndProc := @AWndProc;
WC.lpszClassName := "AClass";
RegisterClass(WC);
H := CreateWindowEx (0, "AClass", "Simple", WS_OVERLAPPEDWINDOW, Integer(CW_USEDEFAULT), Integer(CW_USEDEFAULT),
Integer(CW_USEDEFAULT), Integer(CW_USEDEFAULT), 0, 0, HInstance, nil);

////////////
SetClassLong(H,GCL_HBRBACKGROUND,CreateSolidBrush(RGB(0,100,0)));

ShowWindow (H, SW_SHOWNORMAL);

while GetMessage(M, 0, 0, 0) do begin
TranslateMessage (M);
DispatchMessage(M);
end;

end.




Страницы: 1 вся ветка

Текущий архив: 2004.02.10;
Скачать: CL | DM;

Наверх




Память: 0.46 MB
Время: 0.021 c
1-29443
sergg
2004-01-30 15:36
2004.02.10
Передача параметра в: const AFilter: string =


4-29680
Mihail
2003-12-03 07:48
2004.02.10
как создать свою кнопку на чужом окне.


3-29207
SasaR
2004-01-19 17:54
2004.02.10
Ibase тормоза


1-29424
Ashan
2004-01-31 15:01
2004.02.10
Как вызвать процедуру таймера через кнопку?


14-29531
Alex_Bredin
2004-01-21 10:44
2004.02.10
Дейт.Введение в БД. Null - да или нет?