Click here to Skip to main content
15,895,084 members
Home / Discussions / C#
   

C#

 
GeneralRe: xcopy and timestamp Pin
devvvy28-Aug-07 14:47
devvvy28-Aug-07 14:47 
QuestionHow To Cnvert Turbo c++ Serial Port To c#2.0 Pin
mohsen haghighi28-Aug-07 12:14
mohsen haghighi28-Aug-07 12:14 
AnswerRe: How To Cnvert Turbo c++ Serial Port To c#2.0 Pin
Spacix One28-Aug-07 14:23
Spacix One28-Aug-07 14:23 
Questionhosting windows applications in a winform Pin
algoaddict28-Aug-07 12:07
algoaddict28-Aug-07 12:07 
AnswerRe: hosting windows applications in a winform Pin
Spacix One28-Aug-07 14:13
Spacix One28-Aug-07 14:13 
QuestionRe: hosting windows applications in a winform Pin
algoaddict28-Aug-07 15:37
algoaddict28-Aug-07 15:37 
AnswerRe: hosting windows applications in a winform Pin
Spacix One29-Aug-07 5:04
Spacix One29-Aug-07 5:04 
AnswerRe: hosting windows applications in a winform Pin
Dave Kreskowiak29-Aug-07 5:14
mveDave Kreskowiak29-Aug-07 5: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 11:28
rsaint2728-Aug-07 11:28 
QuestionREGEX start and end Pin
Saamir28-Aug-07 11:25
Saamir28-Aug-07 11:25 
AnswerRe: REGEX start and end Pin
PIEBALDconsult28-Aug-07 11:41
mvePIEBALDconsult28-Aug-07 11:41 
GeneralRe: REGEX start and end Pin
Spacix One28-Aug-07 11:43
Spacix One28-Aug-07 11:43 
AnswerRe: REGEX start and end Pin
Joshua Lunsford4-Sep-07 10:04
Joshua Lunsford4-Sep-07 10:04 
Questionsearching an XML file [modified] Pin
jacobparker28-Aug-07 10:14
jacobparker28-Aug-07 10:14 
AnswerRe: searching an XML file Pin
Spacix One28-Aug-07 10:38
Spacix One28-Aug-07 10:38 
GeneralRe: searching an XML file Pin
jacobparker28-Aug-07 12:30
jacobparker28-Aug-07 12:30 
GeneralRe: searching an XML file Pin
Spacix One28-Aug-07 14:04
Spacix One28-Aug-07 14:04 
GeneralRe: searching an XML file Pin
Christian Graus28-Aug-07 16:12
protectorChristian Graus28-Aug-07 16:12 
GeneralRe: searching an XML file Pin
Spacix One29-Aug-07 5:13
Spacix One29-Aug-07 5:13 
GeneralRe: searching an XML file Pin
jacobparker30-Aug-07 4:54
jacobparker30-Aug-07 4:54 
GeneralRe: searching an XML file Pin
Spacix One30-Aug-07 5:10
Spacix One30-Aug-07 5:10 
Questionform control text value & XML Pin
Blubbo28-Aug-07 9:30
Blubbo28-Aug-07 9:30 
QuestionScaling a Polygon Pin
Joshua Lunsford28-Aug-07 9:26
Joshua Lunsford28-Aug-07 9:26 
AnswerRe: Scaling a Polygon Pin
Hessam Jalali28-Aug-07 21:56
Hessam Jalali28-Aug-07 21:56 
GeneralRe: Scaling a Polygon Pin
Joshua Lunsford4-Sep-07 10:01
Joshua Lunsford4-Sep-07 10: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.