Different Heights for a Window on different machines 
Author Message
 Different Heights for a Window on different machines

the dialog width and height in pixels will depend on the dialog font and the
dialog template size.
look at MapDialogRect() to convert between template sizes and pixels.
HTH
sCaLLioN


Mon, 19 Aug 2002 03:00:00 GMT  
 Different Heights for a Window on different machines
Hi,
  I am working on a GUI based product using VC++ 6.0 WINDOWS 95/98  and
I have this strange

problem.I have created a dialog in the resource.But
GetWindowPlacement(..) seems to return 2

different heights on 2 different machines.

This is a piece of code

 .....
.....
...
    RECT rect;
     CDialog  dialog;
     dialog.Create(IDD_MY_DIALOG,this);
     dialog.GetWindowRect(&rect);
     height = rect.bottom-rect.top;    
.......    
...
.....
On most of the machines it returns the same height but the machine
having WINDOWS 98 second edition is an exception.
  I am largely dependent on this height to remain the same on all sorts
of machine. height

seems to differ on some of the machines . How can I handle this
situation. Any help will be appreciated.

TIA
Rohith.



Tue, 20 Aug 2002 03:00:00 GMT  
 Different Heights for a Window on different machines
As has already been pointed out, you will get different sizes.
MapDialogRect is only a partial help, because it depends upon some
accidental features. I've found over the years that using
GetDialogBaseUnits and MapDialogRect are fairly useless, and I try to
write dialogs whose behavior is totally independent of the dialog
proportions. What are you trying to do with this information? There
may be a better way.
                        joe

Quote:

>Hi,
>  I am working on a GUI based product using VC++ 6.0 WINDOWS 95/98  and
>I have this strange

>problem.I have created a dialog in the resource.But
>GetWindowPlacement(..) seems to return 2

>different heights on 2 different machines.

>This is a piece of code

> .....
>.....
>...
>    RECT rect;
>     CDialog  dialog;
>     dialog.Create(IDD_MY_DIALOG,this);
>     dialog.GetWindowRect(&rect);
>     height = rect.bottom-rect.top;    
>.......    
>...
>.....
>On most of the machines it returns the same height but the machine
>having WINDOWS 98 second edition is an exception.
>  I am largely dependent on this height to remain the same on all sorts
>of machine. height

>seems to differ on some of the machines . How can I handle this
>situation. Any help will be appreciated.

>TIA
>Rohith.

Joseph M. Newcomer [MVP]

Web: http://www3.pgh.net/~newcomer
MVP Tips: http://www3.pgh.net/~newcomer/mvp_tips.htm


Tue, 20 Aug 2002 03:00:00 GMT  
 Different Heights for a Window on different machines


Fri, 19 Jun 1992 00:00:00 GMT  
 Different Heights for a Window on different machines
Hi, Rohith.

Check the API GetSystemMetrics(),
in particular, GetSystemMetrics(SM_CYCAPTION), returns
the height of the window caption, which can be changed in
Display Properties->Appearence, so it can be vary in different machines.
Also SM_CYSIZEFRAME or something similar should be considered.

Hope this helps.

    Raffaele


Quote:
> Hi,
>   I am working on a GUI based product using VC++ 6.0 WINDOWS 95/98  and
> I have this strange

> problem.I have created a dialog in the resource.But
> GetWindowPlacement(..) seems to return 2

> different heights on 2 different machines.

> This is a piece of code

>  .....
> .....
> ...
>     RECT rect;
>      CDialog  dialog;
>      dialog.Create(IDD_MY_DIALOG,this);
>      dialog.GetWindowRect(&rect);
>      height = rect.bottom-rect.top;
> .......
> ...
> .....
> On most of the machines it returns the same height but the machine
> having WINDOWS 98 second edition is an exception.
>   I am largely dependent on this height to remain the same on all sorts
> of machine. height

> seems to differ on some of the machines . How can I handle this
> situation. Any help will be appreciated.

> TIA
> Rohith.



Tue, 20 Aug 2002 03:00:00 GMT  
 Different Heights for a Window on different machines


Fri, 19 Jun 1992 00:00:00 GMT  
 Different Heights for a Window on different machines


Quote:
> As has already been pointed out, you will get different sizes.
> MapDialogRect is only a partial help, because it depends upon some
> accidental features. I've found over the years that using
> GetDialogBaseUnits and MapDialogRect are fairly useless, and I try to
> write dialogs whose behavior is totally independent of the dialog
> proportions. What are you trying to do with this information? There
> may be a better way.

One should note that there are other factors that will change the size
of a dialog, such as the caption height, etc.  This won't effect the
client rect as the font will, but it will effect the result of
GetWindowPlacement.

For any real help you'll have to let us know why you think you need a
consistent size.  Normally the DLU functionality built in to the OS
will render this need obsolete.  When it's not you can usually deal
with things by dynamically sizing the dialog to fit the controls or the
controls to fit the dialog.  The formere is simple, and the latter can
be dealt with using a decent "layout manager" library.  You can find a
couple of these at http://www.codeproject.com, including an extensible
one written by myself.

--
William E. Kempf
Software Engineer, MS Windows Programmer

Sent via Deja.com http://www.deja.com/
Before you buy.



Tue, 20 Aug 2002 03:00:00 GMT  
 
 [ 7 post ] 

 Relevant Pages 

1. Different sizes of long int on different machines.

2. Code which produced different behaviour on different machines

3. Utilizing ODBC to communicate two different processes on different machines

4. different machines different results

5. Different sizes of a dialog on different machines

6. My splash screen bitmap (256color) appears different on different machines

7. Different structs on different windows versions ?

8. Printing is different across Windows 95 machines...

9. How to use different row heights in CListCtrl

10. Different item heights in CListCtrl??

11. Different row ( or item ) heights in a CListCtrl

12. Globals in different files, different types, same names

 

 
Powered by phpBB® Forum Software