Override CreateWnd() and DestroyWnd() in most situations. Override DestroyWnd() to execute registration windows, temporarily save any window-dependent data if the csRecreating flag csRecreating present in the ControlState property and calls inherited DestroyWnd() (which calls DestroyWindowHandle() ) to destroy the HWND. Override CreateWnd() to call the inherited CreateWnd() (which calls CreateWindowHandle() ) to create the HWND, load and discard temporary window-specific data if it was previously saved, and register the windows.
Override CreateWindowHandle() and DestroyWindowHandle() when you need to get / release HWND using other tools besides the usual Win32 calls to CreateWindow/Ex() and DestroyWindow() . For example, TForm overrides them to create / free MDI child windows by sending WM_MDICREATE and WM_MDIDESTROY messages to the WM_MDICREATE window.
I have never seen an override of CreateHandle() and DestroyHandle() for anything useful.
See discussion for more details:
What is the difference between CreateWnd and CreateWindowHandle?
Remy Lebeau
source share