Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Controls placed by Resource Editor are different size than controls placed programmatically?

Controls placed by Resource Editor are different size than controls placed programmatically?

Scheduled Pinned Locked Moved C / C++ / MFC
comhelpquestionlearning
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • X Offline
    X Offline
    xjohnx
    wrote on last edited by
    #1

    Does anyone know why on like 3 of 40 of the computers my company has, the controls placed on a dialog programmatically via MoveWindow are sized different than if they were just placed in the .RC file with the Resource Editor? I have an image to show what I mean. On the right hand side I have what a normal machine looks like. on the left hand side is a screwed up machine( you'll notice all the top controls which are placed in the resource editor are much larger, where the bottom controls which are placed with MoveWindow function end up in the correct place) http://www.john-moses.com/img/artviewer_bug.jpg[^] So I have a dialog that has several controls on it, most of which don't need to be resized, only 2 of the controls on the dialog need to be resized. All the controls on the dialog that don't need to be resized I just place in the .RC file with the Resource Editor, and don't bother making member variables for. For the 2 controls that need to resizing, I'll place in the Resource Editor, but in the OnSize function I'll call MoveWindow on the 2 control's member functions to resize them. This works just fine on like 98% of the computers are my company, but for like 3 people, for some reason this mix of Resource Editor/MoveWindow placed controls causes some kind of visual bug. Any Ideas what could cause this? I looked at the machines "Desktop Properties -> Display Properties -> Advanced", and all our fonts and sizes are the same. We all do have different processors and video cards, nothing we can do about that. We're all running Windows XP Pro eh?

    S 1 Reply Last reply
    0
    • X xjohnx

      Does anyone know why on like 3 of 40 of the computers my company has, the controls placed on a dialog programmatically via MoveWindow are sized different than if they were just placed in the .RC file with the Resource Editor? I have an image to show what I mean. On the right hand side I have what a normal machine looks like. on the left hand side is a screwed up machine( you'll notice all the top controls which are placed in the resource editor are much larger, where the bottom controls which are placed with MoveWindow function end up in the correct place) http://www.john-moses.com/img/artviewer_bug.jpg[^] So I have a dialog that has several controls on it, most of which don't need to be resized, only 2 of the controls on the dialog need to be resized. All the controls on the dialog that don't need to be resized I just place in the .RC file with the Resource Editor, and don't bother making member variables for. For the 2 controls that need to resizing, I'll place in the Resource Editor, but in the OnSize function I'll call MoveWindow on the 2 control's member functions to resize them. This works just fine on like 98% of the computers are my company, but for like 3 people, for some reason this mix of Resource Editor/MoveWindow placed controls causes some kind of visual bug. Any Ideas what could cause this? I looked at the machines "Desktop Properties -> Display Properties -> Advanced", and all our fonts and sizes are the same. We all do have different processors and video cards, nothing we can do about that. We're all running Windows XP Pro eh?

      S Offline
      S Offline
      Stephen Hewitt
      wrote on last edited by
      #2

      The coordinates in an RC file are expressed in dialog units. See here[^] for details on how to deal with them. Alternatively use place-holders in the .rc file and then use the GetWindowRect and MapWindowPoints APIs to get the coordinates in pixels (relative to the window's client area).

      Steve

      X 1 Reply Last reply
      0
      • S Stephen Hewitt

        The coordinates in an RC file are expressed in dialog units. See here[^] for details on how to deal with them. Alternatively use place-holders in the .rc file and then use the GetWindowRect and MapWindowPoints APIs to get the coordinates in pixels (relative to the window's client area).

        Steve

        X Offline
        X Offline
        xjohnx
        wrote on last edited by
        #3

        Oh thanks pal, you da man. I went for the placeholder like solution as it was quicker for me in this case, but next time I run into this (which I'm sure is soon), I'm going to follow the article.

        S 1 Reply Last reply
        0
        • X xjohnx

          Oh thanks pal, you da man. I went for the placeholder like solution as it was quicker for me in this case, but next time I run into this (which I'm sure is soon), I'm going to follow the article.

          S Offline
          S Offline
          Stephen Hewitt
          wrote on last edited by
          #4

          I normally go for the place-holder solution myself.

          Steve

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups