[DUG] DLL Forms
Ross Levis
ross at stationplaylist.com
Sun Aug 6 02:09:11 NZST 2006
I was on the wrong track. Someone has put me on the right track now, but I'm not sure how best to implement it.
I can now get DLL forms to handle tabs!!! But this requires taking over the processing of all windows messages for the application. I put this in the Application.OnIdle event.
Handle := FindWindow(...); // handle to DLL dialog
...
var
LMsg: TMsg;
begin
while GetMessage(LMsg, 0, 0, 0) do
begin
if not IsDialogMessage(Handle,LMsg) then
begin
TranslateMessage(LMsg);
DispatchMessage(LMsg);
end;
end;
end;
This works great for the DLL window, but the main application now does not process any windows messages.
Is there a better way? I don't understand why it will not process window messages for the main app. I thought it should be similar to doing an Application.ProcessMessages.
Thoughts?
Thanks,
Ross.
----- Original Message -----
From: Ross Levis
To: NZ Borland Developers Group - Delphi List
Sent: Saturday, August 05, 2006 8:03 PM
Subject: Re: [DUG] DLL Forms
I meant WS_TABSTOP.
----- Original Message -----
From: Ross Levis
To: NZ Borland Developers Group - Delphi List
Sent: Saturday, August 05, 2006 7:37 PM
Subject: Re: [DUG] DLL Forms
Ok, I think I'm on to something.
I believe the DLL windows use the same window styles as defined in the parent window. The Parent in this case is a window handle that my app creates with AllocateHWnd which does not have any styles as such. I think this is the problem.
Is there a way to apply a style such as WM_TABSTOP to a window created with AllocateHWnd? Or would I need to use CreateWindow and never make the window visible?
The reason for using AllocateHWnd is because it is a separate component which loads the DLL's and it does not have a window itself, so this window is created to handle some WM_USER messages that need to be processed.
Thanks,
Ross.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://ns3.123.co.nz/pipermail/delphi/attachments/20060806/f8d2b805/attachment.html
More information about the Delphi
mailing list