PC Review


Reply
Thread Tools Rate Thread

Managed form from Non-Managed Code

 
 
=?Utf-8?B?SkNhdWJsZQ==?=
Guest
Posts: n/a
 
      29th Mar 2006
I have a problem / question. I have built a 1.1 C# application which in this
case is being used from a Non-Managed application as a plug-in. So this app
I have written is a DLL that has a Form that is used as a property page. In
the creation of this form we set the parent window through an interface the
main applicaiton has provided. which does the following:

public void Activate(IntPtr wndParent, ref Rectangle rect, bool modal)
{
// Make us a child of the given parent, and remove all window styles
except WS_CHILD
SetParent(Handle, wndParent);
SetWindowLong(Handle, -16, 0x40000000);

OnPageActivate(wndParent, rect, modal); // inform derived class
}

Now when this occurs our property page displays correctly however now all
the arrow keys act just like a tab key and I think it has to do something
with Managed code used from non-managed app. Not sure though. All I have is
a drop-down and two text boxes. The way I found to fix the problem (kind of)
is to override the ProcessCmdKeys like so:

protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
{
// TODO: Add frmHelloProperties.ProcessCmdKey implementation
if (keyData == Keys.Left || keyData == Keys.Right || keyData ==
Keys.Up || keyData == Keys.Down)
{
return true;
}
return base.ProcessCmdKey (ref msg, keyData);
}

The problem is now what if I want to use the arrow keys, say to navigate my
drop-down and such.

Have you guys ever heard of this? Do I need to use something like
Windowless controls or something? I am trying to figure out what behavior
would cause such a thing.

If you need more info please let me know and I'll provide it.

Thanks.


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Managed/Unmanaged code and #pragma managed/unmanaged ajtaylor@hushmail.com Microsoft VC .NET 6 18th Feb 2008 10:33 AM
About Non-Managed Code and Managed Code. Kevin Sun Microsoft VC .NET 2 10th Sep 2006 03:23 AM
Where do I put the code for managed classes in managed C++ =?Utf-8?B?VFQgKFRvbSBUZW1wZWxhZXJlKQ==?= Microsoft VC .NET 15 29th Apr 2005 03:00 PM
Difference in managed code and managed object Girish Microsoft Dot NET Framework 1 1st Dec 2003 09:16 AM
Difference between Managed Code and Managed Object Girish Tripathi Microsoft Dot NET Framework 1 27th Nov 2003 04:47 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:53 AM.