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. Making window half of the screen

Making window half of the screen

Scheduled Pinned Locked Moved C / C++ / MFC
tutorialquestion
5 Posts 4 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.
  • S Offline
    S Offline
    Sakhalean
    wrote on last edited by
    #1

    Hi All, I have a form view. I want to display this SDI to Half (Left)of the screen. Again I have another form view. I want to display this SDI to Half (Right)of the screen. How to do? I have changed the CREATESTRUCT structure. but it is not working. Any idea.

    N N E 3 Replies Last reply
    0
    • S Sakhalean

      Hi All, I have a form view. I want to display this SDI to Half (Left)of the screen. Again I have another form view. I want to display this SDI to Half (Right)of the screen. How to do? I have changed the CREATESTRUCT structure. but it is not working. Any idea.

      N Offline
      N Offline
      Niklas L
      wrote on last edited by
      #2

      You can use SetWindowPos() on your AfxGetMainWnd() after it has been created in your CApp::InitInstance()

      home

      S 1 Reply Last reply
      0
      • S Sakhalean

        Hi All, I have a form view. I want to display this SDI to Half (Left)of the screen. Again I have another form view. I want to display this SDI to Half (Right)of the screen. How to do? I have changed the CREATESTRUCT structure. but it is not working. Any idea.

        N Offline
        N Offline
        Naveen
        wrote on last edited by
        #3

        You should go for splitter window. See this sample SDI with split window[^] Added: Are you talking about two different applications?

        nave [My Articles] [My Blog]

        1 Reply Last reply
        0
        • N Niklas L

          You can use SetWindowPos() on your AfxGetMainWnd() after it has been created in your CApp::InitInstance()

          home

          S Offline
          S Offline
          Sakhalean
          wrote on last edited by
          #4

          OK SetWindowPos is working thank you.

          1 Reply Last reply
          0
          • S Sakhalean

            Hi All, I have a form view. I want to display this SDI to Half (Left)of the screen. Again I have another form view. I want to display this SDI to Half (Right)of the screen. How to do? I have changed the CREATESTRUCT structure. but it is not working. Any idea.

            E Offline
            E Offline
            Emilio Garavaglia
            wrote on last edited by
            #5

            Although Niklas post is correct I should recommend to consider a better design. Unless you are developing something very specific (like a process plant control synoptic) you should not manage how your window(s) appear on the user screen. You are not the owner of the user environment and the user may also have other application running, may be even more important (or less, depends on the circumstances) than your, and will perceive your popping out at the placement you decide as a sort of ... invadence. Consider, instead, a different design where a single frame window contains two children (your actual windows), may be either managed through a splitter or with fixed proportional positions. You decide how the children fits the parent, but let the user free to place the parent in his own screen.

            2 bugs found. > recompile ... 65534 bugs found. :doh:

            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