Handle zero? Hwnd := 0
Any window. You can also obtain handles to other things, such as
processes, bitmaps, fonts, files, and memory, but those aren't useful if
you're looking for a window handle, so pay close attention to whether a
parameter's type is do***ented as HWnd, HProcess, HBitmap, HFont,
THandle, HGlobal, HLocal, or something else. All of them are really just
integers, so the compiler won't catch you if you pass a window handle
where a thread handle is expected, or vice versa.
No. TLabel is not a windowed control. It's a descendant of
TGraphicControl, which has no handle, as compared to TWinControl.
TGraphicControl and its descendants don't exist, as far as the OS is
concerned. When a TLabel paints itself, the OS merely sees the label's
parent being painting. Delphi manages all the graphic controls itself.
This occurs in TWinControl.PaintControls, which calls Perform on all a
control's children to send them all wm_Paint messages. Only TWinControl
descendants can receive wm_Paint messages (and any other messages) from
the OS, but with Perform, those messages can also go to non-windowed
controls.
--
Rob
|