The MASM Forum Archive 2004 to 2012

General Forums => The Campus => Topic started by: Mr Earl on September 05, 2005, 11:53:35 AM

Title: Buttons display differently on XP & 98
Post by: Mr Earl on September 05, 2005, 11:53:35 AM
I created some BS_BITMAP buttons on my XP box, where they
display correctly, but when I run the pgm on my 98SE box
they display larger in relation to the window holding them,
thus they display in a different location and dont fit in
the window.

What do I have to check so I can adjust the size/locations? 
Title: Re: Buttons display differently on XP & 98
Post by: czDrillard on September 05, 2005, 04:27:02 PM
Different font sizes cause size of controls to vary.  You must scale your bitmaps to suit your new button sizes.  For example if dialog box size width is 500 pixels (not dialog units) and your your button width is 100 pixels on xp.  Check button dialog width when app is running on 98SE.  Say it is now 90 pixels wide then multiply your bitmap width by 0.9.  Do same for width.  This has to be done for any buttons or controls not created as a resource.  Process WM_PAINT

best regards,

czDrillard
Title: Re: Buttons display differently on XP & 98
Post by: Mr Earl on September 06, 2005, 11:14:13 AM
Thanks sz
I'm having trouble getting the pixel size of my buttons.
Can you point me to the commands I need to look at.
MEarl
Title: Re: Buttons display differently on XP & 98
Post by: Mark Jones on September 07, 2005, 05:01:43 PM
Can it be done with GetClientRect? Haven't tried this yet but:


BOOL GetClientRect(
    HWND hWnd, // handle of window (or control?)
    LPRECT lpRect // address of structure for client coordinates
   );
Title: Re: Buttons display differently on XP & 98
Post by: Mr Earl on September 07, 2005, 08:51:35 PM
Hi Mark
I've been trying everything including GetClientRect.
That doesn't return pixels.
Nothing I find even mentions pixels.  I can deal
with the assembly language, but the API and the
graphics are new to me. 
MEarl