View previous topic :: View next topic |
Author |
Message |
sepa
Joined: 06 May 2007 Posts: 13
|
Posted: Tue May 22, 2007 4:50 pm Post subject: SyntaxMemo updating on ChildForm |
|
|
Hi.
I have a form, which load a plugin dll as child form. This plugin form is created like this Code: |
procedure TfmMain.CreateParams(var Params: TCreateParams);
begin
inherited CreateParams(Params);
Params.Style := (WS_CHILD or WS_MAXIMIZE) and not WS_CAPTION and not WS_BORDER;
Params.WindowClass.cbWndExtra := SizeOf(Pointer); //4 bytes for address of form
end;
|
When i place SyntaxMemo on this child form, it works ok, but no refresh of CodeFolding and SyntaxTree. To make some refresh i have to call SyntaxAnalizer.CustomizeLexer and press "Cancel" each time. What i need to do, to make SyntaxMemo fully working on ChildForm?
PS There no sources of main form. I need to write plugin, and i can hook WinProc of main window. May be there is some message which main form doesn't pass to child form?
I can send you simple test project in D7 to test this. |
|
Back to top |
|
|
econtrol Site Admin
Joined: 09 Jun 2006 Posts: 202
|
Posted: Tue May 22, 2007 5:29 pm Post subject: |
|
|
Yes, please send test project.
Michael. |
|
Back to top |
|
|
econtrol Site Admin
Joined: 09 Jun 2006 Posts: 202
|
Posted: Tue May 22, 2007 8:56 pm Post subject: |
|
|
Solution:
If Syntax Memo or Syntax Analyser are used in DLL you need periodically call CheckSynchronize method from Classes.pas to enable threads synchronization.
For example, drop on the form timer and in OnTimer call CheckSynchronize.
Code: | procedure TfmMain.Timer1Timer(Sender: TObject); begin
CheckSynchronize;
end; |
Michael. |
|
Back to top |
|
|
|