Click here to Skip to main content
15,844,155 members
Home / Discussions / C#
   

C#

 
GeneralRe: xcopy and timestamp Pin
devvvy28-Aug-07 15:47
devvvy28-Aug-07 15:47 
QuestionHow To Cnvert Turbo c++ Serial Port To c#2.0 Pin
mohsen haghighi28-Aug-07 13:14
mohsen haghighi28-Aug-07 13:14 
AnswerRe: How To Cnvert Turbo c++ Serial Port To c#2.0 Pin
Spacix One28-Aug-07 15:23
Spacix One28-Aug-07 15:23 
Questionhosting windows applications in a winform Pin
algoaddict28-Aug-07 13:07
algoaddict28-Aug-07 13:07 
AnswerRe: hosting windows applications in a winform Pin
Spacix One28-Aug-07 15:13
Spacix One28-Aug-07 15:13 
QuestionRe: hosting windows applications in a winform Pin
algoaddict28-Aug-07 16:37
algoaddict28-Aug-07 16:37 
AnswerRe: hosting windows applications in a winform Pin
Spacix One29-Aug-07 6:04
Spacix One29-Aug-07 6:04 
AnswerRe: hosting windows applications in a winform Pin
Dave Kreskowiak29-Aug-07 6:14
mveDave Kreskowiak29-Aug-07 6:14 
algoaddict wrote:
for ie hosting on my winform im indeed using webform control, and for other apps that arrive with activex i can add the activex to my winform. my question is, how can i host other applications that doesnt arrive with activex ?


You have to launch the other application, wait for it's message pump to start, then grab it's main window handle and, using a P/Invoke call to the Win32 API function SetParent, change it's parent window to a host control on your form, like a Panel:
[DllImport("user32.dll", EntryPoint = "SetParent", SetLastError = true)]
private static extern IntPtr SetParent(IntPtr hwndChild, IntPtr hwndParent);
 
Process p = Process.Start("notepad.exe");
p.WaitForInputIdle();
SetParent(p.MainWindowHandle, panel1.Handle);

WARNING! This will not work for every application out there! It's dependant on the hosted application rending it's own window. Using this technique CAN and WILL cause rendering problems with these applications and there's nothing you can do about it.

The hosted application will act just like it does if opened on the desktop. The user can minimize the app, resize it's window, yada, yada, yada, inside your application window, just like your app was the Desktop. They can even CLOSE THE HOSTED APPLICATION, and there's nothing you can do to stop that from hanppening!



algoaddict wrote:
but i wish to have controls on the page that arent transparent and clickthrough, how can i acheive this ?


You can't. Like I said in the article, it's the entire form, including all of it's child controls, or nothing.


A guide to posting questions on CodeProject[^]

Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic
     2006, 2007


Questionc# class design help Pin
rsaint2728-Aug-07 12:28
rsaint2728-Aug-07 12:28 
QuestionREGEX start and end Pin
Saamir28-Aug-07 12:25
Saamir28-Aug-07 12:25 
AnswerRe: REGEX start and end Pin
PIEBALDconsult28-Aug-07 12:41
mvePIEBALDconsult28-Aug-07 12:41 
GeneralRe: REGEX start and end Pin
Spacix One28-Aug-07 12:43
Spacix One28-Aug-07 12:43 
AnswerRe: REGEX start and end Pin
Joshua Lunsford4-Sep-07 11:04
Joshua Lunsford4-Sep-07 11:04 
Questionsearching an XML file [modified] Pin
jacobparker28-Aug-07 11:14
jacobparker28-Aug-07 11:14 
AnswerRe: searching an XML file Pin
Spacix One28-Aug-07 11:38
Spacix One28-Aug-07 11:38 
GeneralRe: searching an XML file Pin
jacobparker28-Aug-07 13:30
jacobparker28-Aug-07 13:30 
GeneralRe: searching an XML file Pin
Spacix One28-Aug-07 15:04
Spacix One28-Aug-07 15:04 
GeneralRe: searching an XML file Pin
Christian Graus28-Aug-07 17:12
protectorChristian Graus28-Aug-07 17:12 
GeneralRe: searching an XML file Pin
Spacix One29-Aug-07 6:13
Spacix One29-Aug-07 6:13 
GeneralRe: searching an XML file Pin
jacobparker30-Aug-07 5:54
jacobparker30-Aug-07 5:54 
GeneralRe: searching an XML file Pin
Spacix One30-Aug-07 6:10
Spacix One30-Aug-07 6:10 
Questionform control text value & XML Pin
Blubbo28-Aug-07 10:30
Blubbo28-Aug-07 10:30 
QuestionScaling a Polygon Pin
Joshua Lunsford28-Aug-07 10:26
Joshua Lunsford28-Aug-07 10:26 
AnswerRe: Scaling a Polygon Pin
Hessam Jalali28-Aug-07 22:56
Hessam Jalali28-Aug-07 22:56 
GeneralRe: Scaling a Polygon Pin
Joshua Lunsford4-Sep-07 11:01
Joshua Lunsford4-Sep-07 11:01 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.