Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- procedure TCustomChromium.CreateBrowser;
- var
- info: TCefWindowInfo;
- rect: TRect;
- settings: TCefBrowserSettings;
- begin
- if not (csDesigning in ComponentState) then
- begin
- FillChar(info, SizeOf(info), 0);
- rect := GetClientRect;
- info.Style := WS_CHILD or WS_VISIBLE or WS_CLIPCHILDREN or WS_CLIPSIBLINGS or WS_TABSTOP;
- info.parent_window := Handle;
- info.x := rect.left;
- info.y := rect.top;
- info.Width := rect.right - rect.left;
- info.Height := rect.bottom - rect.top;
- FillChar(settings, SizeOf(TCefBrowserSettings), 0);
- settings.size := SizeOf(TCefBrowserSettings);
- GetSettings(settings);
- {$IFDEF CEF_MULTI_THREADED_MESSAGE_LOOP}
- CefBrowserHostCreate(@info, FHandler, FDefaultUrl, @settings, nil);
- {$ELSE}
- FBrowser := CefBrowserHostCreateSync(@info, FHandler, '', @settings, nil);
- try//+
- FBrowserId := FBrowser.Identifier;
- except end;//+
- {$ENDIF}
- end;
- end;
Add Comment
Please, Sign In to add comment