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. Maximize + multiple monitors?

Maximize + multiple monitors?

Scheduled Pinned Locked Moved C / C++ / MFC
question
2 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.
  • D Offline
    D Offline
    Dominik Reichl
    wrote on last edited by
    #1

    Hi! A user maximizes the application on monitor #2 and then exits the program. When starting up again, trying to maximize the window using ShowWindow(SW_MAXIMIZE) maximizes the window on monitor #1, instead of the expected #2. Is there any way to set the preferred/active monitor? Optimally, a subsequent call to ShowWindow(SW_MAXIMIZE) should then maximize the window on monitor #2. Thanks and best regards Dominik


    Too many passwords to remember? Try KeePass Password Safe!

    M 1 Reply Last reply
    0
    • D Dominik Reichl

      Hi! A user maximizes the application on monitor #2 and then exits the program. When starting up again, trying to maximize the window using ShowWindow(SW_MAXIMIZE) maximizes the window on monitor #1, instead of the expected #2. Is there any way to set the preferred/active monitor? Optimally, a subsequent call to ShowWindow(SW_MAXIMIZE) should then maximize the window on monitor #2. Thanks and best regards Dominik


      Too many passwords to remember? Try KeePass Password Safe!

      M Offline
      M Offline
      Mattias G
      wrote on last edited by
      #2

      Yes, use GetWindowPlacement to record the window max/min state, size, and monitor when the app exits, store the returned struct as binary data in the registry (or elsewhere), and the use SetWindowPlacement when the app boots the next time. Don't forget to handle bizarre situations as when a user discards a monitor or changes screen resolution.

      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