Einzelnen Beitrag anzeigen

Chris P

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

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

  Alt 11. Feb 2007, 19:37
Das hier führt leider immer noch zu gewünschten Erfolg:
Delphi-Quellcode:
WM_INITDIALOG:
     begin
        GetWindowRect(GetDlgItem(hwnd, 106), rc);
        AppDC := CreateDC('DISPLAY', nil, nil, nil);
     end;
   WM_CTLCOLORSTATIC:
      begin
        case GetDlgCtrlId(lParam) of
          IDC_COLOR_RECT:
            begin
              brush := CreateSolidBrush(clr);
              Result := BOOl(brush);
            end;
        end;
      end;
   WM_MOUSEMOVE:
      begin
        if ((GetCapture = hWnd) and GetCursorPos(pt)) then
        begin
       
          // pixelcolor
          clr := GetPixel(AppDC, pt.x, pt.y);

          invalidateRect(GetDlgItem(hwnd, 106), @rc, true);
         
        end;
      end;
 ....
  Mit Zitat antworten Zitat