Board index » delphi » MDIChild in DLL from Centura
hlaw...@gros.co.at (Josef Hlawaty)
![]() Delphi Developer |
Mon, 04 Dec 2000 03:00:00 GMT
MDIChild in DLL from CenturaI solved the problem, using a MDI-Child in a DLL (Delphi 2.01) with a You have to override three procedures: procedure CreateParams (var Params: TCreateParams); override; You need the MDIClient-Handle of the MDIForm: var And you have to export this three procedures of the dll: procedure InitDLL (h: HWND); far; stdcall; procedure InitDLL (h: HWND); // h is the window-handle of the MDIForm procedure ShowMyForm; procedure DoneDLL; procedure TMyForm.CreateParams (var Params: TCreateParams); procedure TMyForm.CreateWindowHandle (const Params: TCreateParams); var begin WindowHandle:=SendMessage(hWndClient,WM_MDICREATE,0,Longint(@CreateStruct)) procedure TMyForm.DestroyWindowHandle; BTW FormStyle has to be fsNormal. Do not use fsMDIChild! Two problems are left: 1) The Window-Menu of the MDIForm is not updated when the child is if (UpdateNeeded=True) then begin UpdateNeeded is a boolean value. I set it to True in TMyForm.FormClose 2) The form gets VK_TABs in OnKeyDown and KeyPress instead of changing procedure TMyForm.FormKeyDown(Sender: TObject; var Key: Word; Shift: var begin if (f=True) and (Key=VK_TAB) then begin Suggestions welcome! Josef Hlawaty |