---------------------------------------------------------------- // The class is registered, let's create the program hwnd = CreateWindowEx ( 0, // Extended possibilites for variation szClassName, // Classname TEXT("cf5t1"), // Title Text
parentView, //HWND_DESKTOP, // The window is a child-window to desktop //父窗口 NULL, // No menu hThisInstance, // Program Instance handler NULL // No Window Creation data );
procedure TWinControl.CreateParams(var Params: TCreateParams); begin FillChar(Params, SizeOf(Params), 0); with Params do begin Caption := FText; Style := WS_CHILD or WS_CLIPSIBLINGS; AddBiDiModeExStyle(ExStyle); if csAcceptsControls in ControlStyle then begin Style := Style or WS_CLIPCHILDREN; ExStyle := ExStyle or WS_EX_CONTROLPARENT; end; if not (csDesigning in ComponentState) and not Enabled then Style := Style or WS_DISABLED; if FTabStop then Style := Style or WS_TABSTOP; X := FLeft; Y := FTop; Width := FWidth; Height := FHeight; if Parent <> nil then WndParent := Parent.GetHandle else WndParent := FParentWindow; WindowClass.style := CS_VREDRAW + CS_HREDRAW + CS_DBLCLKS; WindowClass.lpfnWndProc := @DefWindowProc; WindowClass.hCursor := LoadCursor(0, IDC_ARROW); WindowClass.hbrBackground := 0; WindowClass.hInstance := HInstance; StrPCopy(WinClassName, ClassName); end; end;