Link to home
Start Free TrialLog in
Avatar of sunset99
sunset99

asked on

TForm will mask messages that should be sent to plugin DLL?

In my application, the main form will get a plugin form,  which contain a TMemo component, from external dll and display this form in a panel. (Of course, the plugin form's BorderStyle is already setted to bsNone)

1.The main form will show the external form like this:
>> LoadPlugin(Application.Handle, PluginPanel.Handle);

2.In the external DLL, the LoadPlugin is as below:
>> LoadPlugin(hAPP: THANDLE; hHostWnd: HWND);
>> begin
>>   Application.Handle := hAPP;
>>   with TfmPlugin.CreateParented(AHostWnd) do
>>     Show;
>> end;

3.Result:
Yes, fmPlugin can display correctly in PluginPanel, but the TMemo on fmPlugin can't get arrow key events. If fmPlugin display common dialogs, such as FindDialog, shortcut keys for dialog can't work either.

I think the main form must have masked some keyboard messages which should be sent to the plugin DLL, but I don't know how to solve this problem, if you know, please tell me.

Many thanks.
Avatar of rondi
rondi

Try playin with KeyPreview properties.
Set KeyPreview of the Host form to False and maybe
even try setting KeyPreview of the plugin to True.

rondi.
try to compile the DLLs with "Build with Runtime Packages" checked.
Avatar of Russell Libby
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

To be PAQ/Refund

Please leave any comments here within the next seven days.
 
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
 
Thank you,
Russell

EE Cleanup Volunteer
ASKER CERTIFIED SOLUTION
Avatar of RotaredoM
RotaredoM

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial