Thread: Dialog box height/width differs in winXP

  1. #1
    Magically delicious LuckY's Avatar
    Join Date
    Oct 2001
    Posts
    856

    Dialog box height/width differs in winXP

    I've been working on an app from a win98 box and all was fine. I just compiled and ran it on my winXP box and the height and width of the dialog is smaller than it was on the other box...
    Does this happen to you? Might you have any idea how I can work around it (other than just making the dialog bigger, since that will make it too big on some boxes)?

    btw, this is an API app.

    Thanks buddy.

  2. #2
    Confused Magos's Avatar
    Join Date
    Sep 2001
    Location
    Sweden
    Posts
    3,145
    I noticed that too, but it's just a few pixels so I usually leave some extra space.
    MagosX.com

    Give a man a fish and you feed him for a day.
    Teach a man to fish and you feed him for a lifetime.

  3. #3
    It's full of stars adrianxw's Avatar
    Join Date
    Aug 2001
    Posts
    4,829
    Put a call to MoveWindow() for example, in the dialog boxes WM_CREATE handler then you can choose what size it will be.
    Wave upon wave of demented avengers march cheerfully out of obscurity unto the dream.

  4. #4
    Magically delicious LuckY's Avatar
    Join Date
    Oct 2001
    Posts
    856
    Originally posted by adrianxw
    Put a call to MoveWindow() for example, in the dialog boxes WM_CREATE handler then you can choose what size it will be.
    Thanx adrian, but that won't fix the problem. I can simply change the height/width when I create the window. What I want to do is add a few pixels only if the client os is winxp or greater.

    What I've done thus far is check if _osver >= 261 (for _MSC_VER) or if _osversion >= 261 (for other compilers). I don't know how valid this will be. I just used the value 261 because I checked and my _osversion in xp returns 261...

    I have to think there must be some way to check what version the os is more acurately or at least there must be more documentation on if 261 is the _osversion of all xp boxes... ?

  5. #5
    It's full of stars adrianxw's Avatar
    Join Date
    Aug 2001
    Posts
    4,829
    _osver() returns the build number, not the basic version, this value may change if you install major service packs. Use _winver(), the major version numer is in the high byte, the minor in the low byte, (or you can be obtain them individually by _winmajor() and _winminor()).
    Wave upon wave of demented avengers march cheerfully out of obscurity unto the dream.

  6. #6
    Magically delicious LuckY's Avatar
    Join Date
    Oct 2001
    Posts
    856
    When I located _osver, I found _winver and the like in the stdlib.h file for MSVC.. The reason I opted to go with _osver/_osversion is _winver is microsoft specific. There is no equivalent (or at least none that I'm aware of) for borland, which is what I'm compiling with... Perhaps I should just build with MSVC solely so I can use those variables? Hmm...

  7. #7
    It's full of stars adrianxw's Avatar
    Join Date
    Aug 2001
    Posts
    4,829
    >>> There is no equivalent (or at least none that I'm aware of) for borland,

    Really? Okay, how about the GetVersionEx() API routine, you must be able to see that surely?
    Wave upon wave of demented avengers march cheerfully out of obscurity unto the dream.

  8. #8
    Magically delicious LuckY's Avatar
    Join Date
    Oct 2001
    Posts
    856
    Perfect! That's just what the doctor ordered...

    Thanks adrian. Med venlig hilsen.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 9
    Last Post: 02-13-2008, 02:59 PM
  2. Parent of a BrowseForFolder dialog box
    By @nthony in forum Windows Programming
    Replies: 4
    Last Post: 01-08-2007, 02:54 PM
  3. New Theme
    By XSquared in forum A Brief History of Cprogramming.com
    Replies: 160
    Last Post: 04-01-2004, 08:00 PM
  4. Dialog Box & Property Sheet :: MFC
    By kuphryn in forum Windows Programming
    Replies: 2
    Last Post: 08-01-2002, 01:33 PM
  5. Tab Controls - API
    By -KEN- in forum Windows Programming
    Replies: 7
    Last Post: 06-02-2002, 09:44 AM