Board index » cppbuilder » width/height not changing when resized

width/height not changing when resized


2005-12-14 04:52:34 AM
cppbuilder111
Hi.
I have a dll that contains a pForm.
The parent of the form is supplied from outside the dll.
My desired behavior is:
I want the pform to not have a caption or resize/min/max controls, but
to always resize itself according to its parent.
I'm having a bit of a time figuring out all the angles.
I tried the following without satisfactory results:
pForm align = alClient
pForm BorderIcons all false
pForm BorderStyle bsNone
pForm FormCanResize always sets resize = true
When the calling app gets a EV_WM_SIZE message, it calls a function in
the dll which tries to set pForm->Height and pForm->Width.
pForm Height and Width remain unchanged after this occurs.
(I looked at it in the de{*word*81}, and also using OutputDebugString
calls).
If I change the pForm BorderStyle to bsSingle, there is no improvement
and I get a space at the top of the window that appears like an empty
caption.
If I change pForm BorderStyle to bsSizeable, I still can't seem to
change pForm->Width or Height.
Can someone suggest how to get the desired behavior, or tell me why it
is not really possible?
Maybe a better way than having the calling app have to call a function
on the EV_WM_SIZE event would be good also!
thanks
Jeff Kish
 
 

Re:width/height not changing when resized

"Jeff Kish" < XXXX@XXXXX.COM >wrote in message
Quote
Hi.

I have a dll that contains a pForm.
The parent of the form is supplied from outside the dll.

My desired behavior is:
I want the pform to not have a caption or resize/min/max controls, but
to always resize itself according to its parent.

I'm having a bit of a time figuring out all the angles.
I tried the following without satisfactory results:
Is this really a DLL, or is it a package (BPL)?
If it really is a DLL, is the DLL's Application->Handle property set to the
handle of the application's main window? If not, you will very likely
experience odd behavior with VCL forms in a DLL.
- Dennis
 

Re:width/height not changing when resized

On Tue, 13 Dec 2005 13:43:49 -0800, "Dennis Jones" < XXXX@XXXXX.COM >
wrote:
Quote

"Jeff Kish" < XXXX@XXXXX.COM >wrote in message
news: XXXX@XXXXX.COM ...
>Hi.
>
>I have a dll that contains a pForm.
>The parent of the form is supplied from outside the dll.
>
>My desired behavior is:
>I want the pform to not have a caption or resize/min/max controls, but
>to always resize itself according to its parent.
>
>I'm having a bit of a time figuring out all the angles.
>I tried the following without satisfactory results:

Is this really a DLL, or is it a package (BPL)?

If it really is a DLL, is the DLL's Application->Handle property set to the
handle of the application's main window? If not, you will very likely
experience odd behavior with VCL forms in a DLL.

- Dennis

Yes, this is really a dll, not a package.
It is being accessed by non cbuilder apps.
I don't think the dll application->Handle is being set. You say it
should be set to the applications main window handle? OK.. I'll give
it a try.
thanks much
Jeff Kish
 

{smallsort}

Re:width/height not changing when resized

On Tue, 13 Dec 2005 13:43:49 -0800, "Dennis Jones" < XXXX@XXXXX.COM >
wrote:
Quote

"Jeff Kish" < XXXX@XXXXX.COM >wrote in message
news: XXXX@XXXXX.COM ...
>Hi.
>
>I have a dll that contains a pForm.
>The parent of the form is supplied from outside the dll.
>
>My desired behavior is:
>I want the pform to not have a caption or resize/min/max controls, but
>to always resize itself according to its parent.
>
>I'm having a bit of a time figuring out all the angles.
>I tried the following without satisfactory results:

Is this really a DLL, or is it a package (BPL)?

If it really is a DLL, is the DLL's Application->Handle property set to the
handle of the application's main window? If not, you will very likely
experience odd behavior with VCL forms in a DLL.

- Dennis

uhh.. where is the appropriate place to do this? I would guess I have
to create some api call so I can pass in the window handle, eh?
Also does it have to be the main window? Just wondering, thanks.
Jeff Kish
 

Re:width/height not changing when resized

"Jeff Kish" < XXXX@XXXXX.COM >wrote in message
Quote
On Tue, 13 Dec 2005 13:43:49 -0800, "Dennis Jones" < XXXX@XXXXX.COM >
wrote:

uhh.. where is the appropriate place to do this? I would guess I have
to create some api call so I can pass in the window handle, eh?
Yes, you have to create an exported function call to do this.
Quote
Also does it have to be the main window? Just wondering, thanks.
Yes, it must be the main window. From the BCB online help for
Application::Handle:
"Note: When writing a DLL that uses VCL forms, assign the window handle of
the host EXE's main window to the DLL's Application->Handle property. This
makes the DLL's form part of the host application. Never assign to the
Handle property in an EXE."
- Dennis