Sizing HTA windows around embedded ActiveX controls 
Author Message
 Sizing HTA windows around embedded ActiveX controls

I'm having mixed results with the "automatically" sized windows around
displayed ActiveX controls, and am looking for suggestions on what I can do
to help tweak this.

When using the Citrix ICA ActiveX control (ver 6.20.985.0), I don't even
worry about the HTA window; I tell the control what size I want the
connection window to be and the HTA automatically sizes to fit it.

The RDP client (ver 5.1.2526.0),  in contrast, seems to have a "frame"
around it including a whit strip to the left 10 pixels wide and one above 16
pixels wide.

The worst-behaved in my opinion is the old pcAnywhere ActiveX client. For
some reason, any HTA window generated for it is not resizable by default.

Any suggestions on ways to work around this stuff?  Can I "offset" the point
in the window at which a control displays, for example? If I could do
something like a 'control.moveto(-10,-16)' to the RDP client it would clean
up one problem.

Can I force an HTA to be resizable by a special property?

Finally, any ideas on *why* these problems occur?  I assume I am looking at
various, possibly sloppy things in the coding of the ActiveX controls.



Sat, 08 May 2004 05:48:57 GMT  
 Sizing HTA windows around embedded ActiveX controls
[Please do not mail me a copy of your followup]



Quote:
>Can I force an HTA to be resizable by a special property?

I thought it was resizable by default?  I have an HTA that I didn't
want resizable (no resize handles on the window frame), and I had to
add extra attributes in order to disable resizing.

Quote:
>Finally, any ideas on *why* these problems occur?  I assume I am looking at
>various, possibly sloppy things in the coding of the ActiveX controls.

Yes, I think your theory is correct.  Just today in the "C++ Faqs"
book, I was reading about the differences between OCX controls and
ActiveX controls.  The latter require more negotiation between the
container and the control in order to have everything work nicely,
which means that the containers are a little more complex in order
that the controls can be a little simpler.  I suspect it is this
negotation that is going wrong with the controls you're trying to use.

You can always force the window to a specific size as it's being
loaded.  In my HTA, I have a 1024x768 background image and I wanted
the window to be exactly sized to fit that imag.  I wrote an ATL COM
object that returned info by ::GetSystemMetrics so that I could size
the window appropriately based on the height of the caption bar, the
thickness of the window frame, etc.
--
Ask me about my upcoming book on Direct3D from Addison-Wesley!
  Direct3D Book http://www.xmission.com/~legalize/book/
    Don't Support Spammers!  Boycott Fractal Painter 7!
     http://www.xmission.com/~legalize/spammers.html



Sat, 08 May 2004 09:22:29 GMT  
 Sizing HTA windows around embedded ActiveX controls
WHat you say makes sense.

The pcAnywhere ActiveX control dates back to 1997 - they made it then and
apparently didn't develop it any further.  I can see why it would be very
likely to have issues (it's the one which refuses to allow resizing).

Microsoft's RDP client is more frustrating.  It is an OCX, and is in fact
the version bundled with Windows XP.  You'd think that one would be
*perfectly* well-behaved...


Quote:
> [Please do not mail me a copy of your followup]


secret code

> >Can I force an HTA to be resizable by a special property?

> I thought it was resizable by default?  I have an HTA that I didn't
> want resizable (no resize handles on the window frame), and I had to
> add extra attributes in order to disable resizing.

> >Finally, any ideas on *why* these problems occur?  I assume I am looking
at
> >various, possibly sloppy things in the coding of the ActiveX controls.

> Yes, I think your theory is correct.  Just today in the "C++ Faqs"
> book, I was reading about the differences between OCX controls and
> ActiveX controls.  The latter require more negotiation between the
> container and the control in order to have everything work nicely,
> which means that the containers are a little more complex in order
> that the controls can be a little simpler.  I suspect it is this
> negotation that is going wrong with the controls you're trying to use.

> You can always force the window to a specific size as it's being
> loaded.  In my HTA, I have a 1024x768 background image and I wanted
> the window to be exactly sized to fit that imag.  I wrote an ATL COM
> object that returned info by ::GetSystemMetrics so that I could size
> the window appropriately based on the height of the caption bar, the
> thickness of the window frame, etc.
> --
> Ask me about my upcoming book on Direct3D from Addison-Wesley!
>   Direct3D Book http://www.xmission.com/~legalize/book/
>     Don't Support Spammers!  Boycott Fractal Painter 7!
>      http://www.xmission.com/~legalize/spammers.html



Sat, 08 May 2004 09:53:30 GMT  
 Sizing HTA windows around embedded ActiveX controls

Quote:
> Any suggestions on ways to work around this stuff?  Can I "offset" the
point
> in the window at which a control displays, for example? If I could do
> something like a 'control.moveto(-10,-16)' to the RDP client it would
clean
> up one problem.

> Can I force an HTA to be resizable by a special property?

If you can get Width and Heigth properties from your embeded Object (the
OCX)
why not simply resize the HTA using HTML syntax ???

window.screen.width
window.screen.height
window.screenLeft
window.screenTop
etc ...

or perharps your Embed object can have attribut tags:

<OBJECT
 classid="clsid:1234"
 codebase="......"
 ID=test WIDTH=800 HEIGHT=600>

so use script to write the Object inside the HTA

HTH
zwetan



Mon, 10 May 2004 02:44:02 GMT  
 Sizing HTA windows around embedded ActiveX controls
That's what I've been doing.  The issue I'm really trying to work around is
the fact that I am forced to have "white space" around the controls.  For
both the RDP and PCA clients, the control window starts about 10 pixels to
the right and 16 pixels down from the upper left corner of the frame.


Quote:
> > Any suggestions on ways to work around this stuff?  Can I "offset" the
> point
> > in the window at which a control displays, for example? If I could do
> > something like a 'control.moveto(-10,-16)' to the RDP client it would
> clean
> > up one problem.

> > Can I force an HTA to be resizable by a special property?

> If you can get Width and Heigth properties from your embeded Object (the
> OCX)
> why not simply resize the HTA using HTML syntax ???

> window.screen.width
> window.screen.height
> window.screenLeft
> window.screenTop
> etc ...

> or perharps your Embed object can have attribut tags:

> <OBJECT
>  classid="clsid:1234"
>  codebase="......"
>  ID=test WIDTH=800 HEIGHT=600>

> so use script to write the Object inside the HTA

> HTH
> zwetan



Mon, 10 May 2004 06:57:21 GMT  
 Sizing HTA windows around embedded ActiveX controls
I solved this finally about 3 weeks ago, and thought I should post the
summary{*filter*}anyone doing a Google search.

The real issue here is that the body has default non-zero margin
offsets.  I just had to set these to 0 to eliminate the white spaces.

Here's the extracted pieces of an HTA showing a body with an ID and a
Window_OnLoad script that resets the margins.

<script language="VBScript">
Sub Window_OnLoad()
  htabody.bottomMargin="0"
  htabody.topMargin="0"
  htabody.leftMargin="0"
  htabody.rightMargin="0"
end sub
</script>
<body id="htabody"></body>



Quote:
> I'm having mixed results with the "automatically" sized windows
around
> displayed ActiveX controls, and am looking for suggestions on what I
can do
> to help tweak this.

> When using the Citrix ICA ActiveX control (ver 6.20.985.0), I don't
even
> worry about the HTA window; I tell the control what size I want the
> connection window to be and the HTA automatically sizes to fit it.

> The RDP client (ver 5.1.2526.0),  in contrast, seems to have a
"frame"
> around it including a whit strip to the left 10 pixels wide and one
above 16
> pixels wide.

> The worst-behaved in my opinion is the old pcAnywhere ActiveX
client. For
> some reason, any HTA window generated for it is not resizable by
default.

> Any suggestions on ways to work around this stuff?  Can I "offset"
the point
> in the window at which a control displays, for example? If I could
do
> something like a 'control.moveto(-10,-16)' to the RDP client it
would clean
> up one problem.

> Can I force an HTA to be resizable by a special property?

> Finally, any ideas on *why* these problems occur?  I assume I am
looking at
> various, possibly sloppy things in the coding of the ActiveX
controls.



Wed, 30 Jun 2004 22:45:26 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. How to control size of HTA window when its opened

2. Need to get around ActiveX control prompt in IE5.5

3. Set Mousespeed in ActiveX Control embedded in webpage

4. problem embedding custom activeX controls

5. Trouble with Scripting/Embedding ActiveX Controls

6. Confusion about .hta, ActiveX Control and security

7. Confusion about .hta, ActiveX Control and security

8. embedding activex control into html page

9. Confusion about .hta, ActiveX Control and security

10. Windows size of HTA

11. How to set window size of .HTA?

12. ActiveX Control Container for VBCCE5 ActiveX Controls!?

 

 
Powered by phpBB® Forum Software