HEX0x29A

Chromium CEF3 Flash crash fix

May 8th, 2017
411
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Delphi 0.93 KB | None | 0 0
  1. procedure TCustomChromium.CreateBrowser;
  2. var
  3.   info: TCefWindowInfo;
  4.   rect: TRect;
  5.   settings: TCefBrowserSettings;
  6. begin
  7.   if not (csDesigning in ComponentState) then
  8.   begin
  9.     FillChar(info, SizeOf(info), 0);
  10.     rect := GetClientRect;
  11.     info.Style := WS_CHILD or WS_VISIBLE or WS_CLIPCHILDREN or WS_CLIPSIBLINGS or WS_TABSTOP;
  12.     info.parent_window := Handle;
  13.     info.x := rect.left;
  14.     info.y := rect.top;
  15.     info.Width := rect.right - rect.left;
  16.     info.Height := rect.bottom - rect.top;
  17.     FillChar(settings, SizeOf(TCefBrowserSettings), 0);
  18.     settings.size := SizeOf(TCefBrowserSettings);
  19.     GetSettings(settings);
  20. {$IFDEF CEF_MULTI_THREADED_MESSAGE_LOOP}
  21.     CefBrowserHostCreate(@info, FHandler, FDefaultUrl, @settings, nil);
  22. {$ELSE}
  23.     FBrowser := CefBrowserHostCreateSync(@info, FHandler, '', @settings, nil);
  24.     try//+
  25.       FBrowserId := FBrowser.Identifier;
  26.     except  end;//+
  27. {$ENDIF}
  28.   end;
  29. end;
Add Comment
Please, Sign In to add comment