Infralution Support Forum Index Infralution Support
Support groups for Infralution products
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Virtual Tree Not Recieving Windows Messages

 
Post new topic   Reply to topic    Infralution Support Forum Index -> Virtual Tree Support
View previous topic :: View next topic  
Author Message
rodneyjt



Joined: 02 Jun 2017
Posts: 3

PostPosted: Fri Jun 02, 2017 7:07 pm    Post subject: Virtual Tree Not Recieving Windows Messages Reply with quote

Hello,

We are using the Virtual Tree in a product that runs as an addon in other software. Specific Key strokes are not being received by the Tree when the tree is in a modeless dialog shown from the parent application. (Modal dialogs work fine.)

This is a known windows 'feature' as described here. There are methods to hook into the Windows Messages for controls and forms.

Do you have a fix or implementation of the Virtual Tree that overcomes this issue?

Thanks
Back to top
View user's profile Send private message
Infralution



Joined: 28 Feb 2005
Posts: 4753

PostPosted: Sat Jun 03, 2017 12:18 am    Post subject: Reply with quote

I tried to replicate this issue by creating a modeless form (containing Virtual Tree) from within a class library DLL, which in turn was called by the main executable assembly. The problem was not evident. Does your AddIn architecture use unmanaged DLLs (rather than managed assemblies)?
_________________
Infralution Support
Back to top
View user's profile Send private message Visit poster's website
rodneyjt



Joined: 02 Jun 2017
Posts: 3

PostPosted: Sun Jun 04, 2017 2:10 am    Post subject: Reply with quote

The addin is all managed assemblies. But it's running from CAD applications in which this is a known issue from certain Windows applications the load addins through COM. We are using other controls which have the Windows hooks implemented in order to work properly.
Back to top
View user's profile Send private message
Infralution



Joined: 28 Feb 2005
Posts: 4753

PostPosted: Sun Jun 04, 2017 3:10 am    Post subject: Reply with quote

This issue would affect all controls within a modeless dialog launched from a DLL where that DLL is loaded via COM or unmanaged code. I think it would be better to apply the fix within your code where this situation arises rather than adding a hook to every virtual tree control when in 99.9% of the time it is not required. It would also be difficult for us to test any solution since we can't replicate it easily.

You can use the Infralution.Common.WindowsHook class to implement the hook in your dialog control
_________________
Infralution Support
Back to top
View user's profile Send private message Visit poster's website
rodneyjt



Joined: 02 Jun 2017
Posts: 3

PostPosted: Mon Jun 05, 2017 12:20 pm    Post subject: Reply with quote

Thank you for the information about the Infralution.Common.WindowsHook class. Do you have an example of how to implement this class. Should it be applied to the VirtualTree directly?
Back to top
View user's profile Send private message
Infralution



Joined: 28 Feb 2005
Posts: 4753

PostPosted: Tue Jun 06, 2017 12:03 am    Post subject: Reply with quote

In your dialog class add a method to handle the hook invoke:

Code:
static void OnHookInvoked(object sender, WindowsHookEventArgs e)
{       
}


Then create and install the hook inside your dialog/form constructor:

Code:
hook = new WindowsHook(WindowsHookType.GetMessage);
hook.HookInvoked += new WindowsHookEventHandler(OnHookInvoked);
hook.Install();


You should also uninstall the hook in the dialog dispose method.
_________________
Infralution Support
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Infralution Support Forum Index -> Virtual Tree Support All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group