Zur Hilfe nochmal mein Quelltext:
Delphi-Quellcode:
function DlgFunc(hWnd: HWND; uMsg: Cardinal; wParam: WPARAM; lParam: LPARAM): BOOL; stdcall;
var
pt: TPoint;
brush: HBRUSH;
begin
Result := TRUE;
case uMsg of
...
WM_MOUSEMOVE:
begin
if ((GetCapture = hWnd) and GetCursorPos(pt)) then
begin
// pixelcolor
clr := GetPixel(AppDC, pt.x, pt.y);
dcRect := getdc(GetDlgItem(hwnd, 106));
brush := CreateSolidBrush(clr);
SelectObject(dcRect, brush);
SetBkColor(dcRect , clr);
end;
end;
...
end;