Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   GUI-Design mit VCL / FireMonkey / Common Controls (https://www.delphipraxis.net/18-gui-design-mit-vcl-firemonkey-common-controls/)
-   -   Delphi SetCapture (https://www.delphipraxis.net/35965-setcapture.html)

MatthiasW 14. Dez 2004 10:02


SetCapture
 
Ich habe mit SetCapture(Handle) die Maus meinem Control zugeordnet (abgeleitet von TCustomControl). Aber wie komme ich jetzt an die Mausevents? Muß ich dazu jetzt einen lokalen Hook installieren :gruebel: :?: Die MouseDown/Move - Events werden nicht ausgelöst.

toms 24. Jan 2005 05:46

Re: SetCapture
 
Hi,

Hast du schon eine Lösung gefunden?

MatthiasW 25. Jan 2005 13:26

Re: SetCapture
 
Zitat:

Zitat von toms
Hast du schon eine Lösung gefunden?

ja habe ich. Sorry das ich erst jetzt antworte. Es kommt darauf an das der Handle des Application - Objects verwendet wird.

Delphi-Quellcode:
  //start subclassing
  OldWndProc := Pointer(SetWindowLong(Application.Handle, GWL_WNDPROC,
                       Integer(@CalenderBoxWindowProc)));
  //all mouse message to this control
  SetCapture(Application.Handle);

function CalenderBoxWindowProc(wnd: HWND; Msg: Cardinal; wParam, lParam: Integer): Integer; stdcall;
begin
  //subclassing procedure for the mouse events if colorbox is showing
  case Msg of
    WM_LBUTTONDOWN:
    begin
      //code der ausgeführt werden soll wenn die mouse betätigt wird
    end;
  end;
end;


Alle Zeitangaben in WEZ +1. Es ist jetzt 05:59 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz