Thanks Nish that did the trick.
I have further problem now that I have got past this.
In WIN32 programming if you create a child window on a top level window,
the child window cannot be activated when you click in it. All that happens
is the top level window is activated. This is the behaviour I want from my
Windows form child but this is not happening. The windows for can be
activated.
Is this beacuse I have just used SetParent on the Windows form to set its
parent to my main window or is it down to some property of of the Windows
form?
How can I stop a windows form child window from being activated
Thanks
Steve
"Nishant S" <ni**@nospam.asianetindia.com> wrote in message
news:%2****************@TK2MSFTNGP14.phx.gbl...
Try using :-
(HWND)myform->Handle.ToPointer()
--
Regards,
Nish [VC++ MVP]
http://www.voidnish.com /* MVP tips tricks and essays web site */
http://blog.voidnish.com /* My blog on C++/CLI, MFC, Whidbey, CLR... */
"Steve Marsden" <st***@conquest.ltd.uk> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl... I had a further thought that I could use the WIN32 API function SetParent
as in
SetParent(myform->Handle,mainwnd);
but I get error
Cannot convert from System::IntPtr to HWND
How can I do this
"Steve Marsden" <st***@conquest.ltd.uk> wrote in message
news:OM**************@TK2MSFTNGP10.phx.gbl... > Hi
>
> I want to specify the parent of a windows form to be a window handle I
> have
> elsewhere in my project which is an unmanaged WIN32 handle. How can I
> do
> this?
>
> If I simple say myform->Parent=mainwnd (where mainwnd is a WIN32
> handle) I > obviously get the error Cannort convert from HWND to
> System::Windows::Forms::Control
>
> Thanks
>
>
>