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
WindowStyle := GetWindowLong(WindowHandle, GWL_STYLE);
WindowStyle := WindowStyle
- WS_CAPTION
- WS_BORDER
- WS_OVERLAPPED
- WS_THICKFRAME;
SetWindowLong(WindowHandle,GWL_STYLE,WindowStyle);
FAppThreadID := GetWindowThreadProcessId(WindowHandle, nil);
AttachThreadInput(GetCurrentThreadId, FAppThreadID, True);
Windows.SetParent(WindowHandle,Container.Handle);
SendMessage(Container.Handle, WM_UPDATEUISTATE, UIS_INITIALIZE, 0);
UpdateWindow(WindowHandle);
SetWindowLong(Container.Handle, GWL_STYLE, GetWindowLong(Container.Handle,GWL_STYLE) or WS_CLIPCHILDREN);
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);