Einzelnen Beitrag anzeigen

Chris P

Registriert seit: 8. Mär 2004
230 Beiträge
 
Delphi 7 Enterprise
 
#4

Re: [nonVCL] Farbe von STATIC bei Mausbewegung ändern

  Alt 11. Feb 2007, 17:24
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;
  Mit Zitat antworten Zitat