News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Buttons display differently on XP & 98

Started by Mr Earl, September 05, 2005, 11:53:35 AM

Previous topic - Next topic

Mr Earl

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? 

czDrillard

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

Mr Earl

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

Mark Jones

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
   );
"To deny our impulses... foolish; to revel in them, chaos." MCJ 2003.08

Mr Earl

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