Isdelphihandle
Findvclwindow
function Isvclcontrol (handle:hwnd): Boolean;
function FindControl (handle:hwnd): Twincontrol;
function Findvclwindow (const pos:tpoint): Twincontrol;
functionFindControl (Handle:hwnd): Twincontrol;varOwningprocess:dword;beginResult:=Nil; if(Handle <>0) and(GetWindowThreadProcessId (Handle, owningprocess) <>0) and(owningprocess= GetCurrentProcessId) Then begin ifGlobalfindatom (PChar (controlatomstring)) = Controlatom ThenResult:=Pointer (Getprop (Handle, Makeintatom (Controlatom)))ElseResult:=Objectfromhwnd (Handle); End;End;functionObjectfromhwnd (Handle:hwnd): Twincontrol;varOwningprocess:dword;begin if(GetWindowThreadProcessId (Handle, owningprocess) <>0) and(owningprocess= GetCurrentProcessId) ThenResult:= Pointer (SendMessage (Handle, Rm_getobjectinstance,0,0)) ElseResult:=Nil;End;
I measured it, whether the drag control is placed on the form, or dynamically generated control, is a pointer to the Delphi object through the Getprop method. So when do you use Marvellous's Objectfromhwnd function?
Clue or click TButton after the occurrence, because Levi's book mentions this point ~
When will FindControl use the Objectfromhwnd function? --VCL difficult to debug, add a log function, record the time