Hey fellow delphirinos,

I am currently using the following code to get an application in my application:

procedure TForm1.Button1Click(Sender: TObject);
begin
ShellExecute(Application.Handle,'Open','Notepad.exe' ,nil,nil,SW_NORMAL);
//Wait for it to be loaded.
Sleep(500);
//Get the handle of the other program using the caption of the window.
wHandle := FindWindow(NIL,'Untitled - Notepad');
//Now change the parent of the other program to be your program.
Windows.SetParent(wHandle,self.Handle);
end;

That works as in, its giving me notepad in my application as a moveable window like application. (im testing with notepad but that's not the app I eventually want to use).

But now the question, I want the app as a borderless window in a fixed location on my form (I got a sort of space reserved in my form where iwant to load the app in, but its silly to have a window title and close button etc for the "inside application".. So how do I load it without any borders/title/minimize,close top right buttons and in a location I want on my form ?

These kind of settings are specific CreateParams of a window, so only if your target application provides some API to change it. Otherwise you can't.

Hmm, so you can't even regulate "where" the window will be placed in your application ? (like top, height, width etc) ? cause now well it takes a place and it must somehow get instructed to take that exact place .. ?

Not sure about moving, since moving with the mouse is also just a message.

Me again, the application actually has a console borderless command for startup.. so I can get it borderless that way :) If I only can tell the top and left (i can work around the width and height on my applications end) then ill be all set !

A solution to what you are describing is to place a notepad (or a notepad clone) active-X control into your form.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.