Delphi - built-in application scrollbars not visible

Based on the question Embed in another process , I am implementing an application that has only the TWebBrowser component in its main form in my main application. Even I embed it in the TScrollBox component, scrollbars are not displayed when the main application resizes. I have done some research on this issue, but to no avail. How to enable scrollbars?

LE: To clarify the issue: Appendix A is a simple form with the TWebBrowser component. Application B, the main application, deploys application A to the TScrollBox placed on the form with the Align parameter for alClient. Code to insert A to B

procedure ShowAppEmbedded(WindowHandle: THandle; Container: TWinControl);
var
  WindowStyle : Integer;
  FAppThreadID: Cardinal;
begin
  /// Set running app window styles.
  WindowStyle := GetWindowLong(WindowHandle, GWL_STYLE);
  WindowStyle := WindowStyle
                 - WS_CAPTION
                 - WS_BORDER
                 - WS_OVERLAPPED
                 - WS_THICKFRAME;
  SetWindowLong(WindowHandle,GWL_STYLE,WindowStyle);

  /// Attach container app input thread to the running app input thread, so that
  ///  the running app receives user input.
  FAppThreadID := GetWindowThreadProcessId(WindowHandle, nil);
  AttachThreadInput(GetCurrentThreadId, FAppThreadID, True);

  /// Changing parent of the running app to our provided container control
  Windows.SetParent(WindowHandle,Container.Handle);
  SendMessage(Container.Handle, WM_UPDATEUISTATE, UIS_INITIALIZE, 0);
  UpdateWindow(WindowHandle);

  /// This prevents the parent control to redraw on the area of its child windows (the running app)
  SetWindowLong(Container.Handle, GWL_STYLE, GetWindowLong(Container.Handle,GWL_STYLE) or WS_CLIPCHILDREN);
  /// Make the running app to fill all the client area of the container
  SetWindowPos(WindowHandle,0,0,0,Container.ClientWidth,Container.ClientHeight,SWP_NOZORDER);

  SetForegroundWindow(WindowHandle);
end;

(B) TScrollBox B , A , .

. Kobik A B TPanel, alClient TScrollBox. OnPanelResize :

  if IsWindow(App_B_WindowHandle) then
    SetWindowPos(App_B_WindowHandle, 0, 0, 0, Panel1.Width, Panel1.Height, SWP_ASYNCWINDOWPOS);
+4
1

VCL (, TPanel) TScrollbox. Panel. , TScrollbox . Delphi. , TPanel.OnResize, ( ).

, , - .

+1

Source: https://habr.com/ru/post/1615208/


All Articles