Click here to Skip to main content
16,013,819 members
Home / Discussions / C#
   

C#

 
GeneralRe: Graphics::FromHwnd ??? Pin
Neil Van Note28-Apr-02 11:31
Neil Van Note28-Apr-02 11:31 
GeneralRe: Graphics::FromHwnd ??? Pin
Christian Graus28-Apr-02 12:08
protectorChristian Graus28-Apr-02 12:08 
GeneralRe: Graphics::FromHwnd ??? Pin
Neil Van Note28-Apr-02 12:19
Neil Van Note28-Apr-02 12:19 
GeneralRe: Graphics::FromHwnd ??? Pin
Christian Graus28-Apr-02 12:29
protectorChristian Graus28-Apr-02 12:29 
GeneralRe: Graphics::FromHwnd ??? Pin
Neil Van Note28-Apr-02 13:39
Neil Van Note28-Apr-02 13:39 
GeneralRe: Graphics::FromHwnd ??? Pin
James T. Johnson28-Apr-02 13:09
James T. Johnson28-Apr-02 13:09 
GeneralRe: Graphics::FromHwnd ??? Pin
Neil Van Note28-Apr-02 11:29
Neil Van Note28-Apr-02 11:29 
AnswerRe: Graphics::FromHwnd ??? Pin
Neil Van Note29-Apr-02 10:18
Neil Van Note29-Apr-02 10:18 
In the course of recent enlightenment I have a better solution that will reuse your form as is…

In the preview mode (/p) do this:

if (IntPtr.Zero != hWnd)
{
	Application.Run(new MainForm(hWnd));
}


In your form class do this:

private IntPtr parentWindow;
public MainForm(IntPtr parent)
{
	parentWindow = parent;
	if (IntPtr.Zero != parent)
		this.TopLevel = false;
.
.
.
}

protected override CreateParams CreateParams
{
	get
	{
		CreateParams cp = base.CreateParams;
		cp.Parent = parentWindow;
		return cp;
	}
}


Works like a champ!
GeneralRe: Calling Win32 API Pin
James T. Johnson27-Apr-02 22:56
James T. Johnson27-Apr-02 22:56 
GeneralQuestion Pin
Vlad Beu27-Apr-02 9:51
Vlad Beu27-Apr-02 9:51 
GeneralRe: Question Pin
James T. Johnson27-Apr-02 11:31
James T. Johnson27-Apr-02 11:31 
GeneralUsing COM Interface ICatInformation... Pin
Ollie27-Apr-02 4:52
Ollie27-Apr-02 4:52 
GeneralDisable Close Button Pin
Sabran27-Apr-02 0:05
Sabran27-Apr-02 0:05 
GeneralRe: Disable Close Button Pin
Neil Van Note27-Apr-02 9:26
Neil Van Note27-Apr-02 9:26 
GeneralRe: Disable Close Button Pin
Neil Van Note27-Apr-02 10:39
Neil Van Note27-Apr-02 10:39 
GeneralRe: Disable Close Button Pin
Neil Van Note27-Apr-02 11:32
Neil Van Note27-Apr-02 11:32 
GeneralRe: Disable Close Button Pin
Sabran27-Apr-02 12:51
Sabran27-Apr-02 12:51 
GeneralRe: Disable Close Button Pin
Nish Nishant27-Apr-02 15:00
sitebuilderNish Nishant27-Apr-02 15:00 
GeneralRe: Disable Close Button Pin
Neil Van Note27-Apr-02 15:34
Neil Van Note27-Apr-02 15:34 
GeneralRe: Disable Close Button Pin
Sabran28-Apr-02 9:03
Sabran28-Apr-02 9:03 
GeneralRe: Disable Close Button Pin
Neil Van Note28-Apr-02 9:33
Neil Van Note28-Apr-02 9:33 
GeneralThreads Pin
Sabran26-Apr-02 23:58
Sabran26-Apr-02 23:58 
GeneralRe: Threads Pin
James T. Johnson27-Apr-02 11:27
James T. Johnson27-Apr-02 11:27 
GeneralRe: Threads Pin
Sabran27-Apr-02 13:00
Sabran27-Apr-02 13:00 
GeneralRe: Threads Pin
James T. Johnson27-Apr-02 13:52
James T. Johnson27-Apr-02 13:52 

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.