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#
  4. force application to be shown on a specific monitor

force application to be shown on a specific monitor

Scheduled Pinned Locked Moved C#
csharpwpfquestion
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.
  • E Offline
    E Offline
    ezazazel
    wrote on last edited by
    #1

    Hi! Is it possible to force an application (WPF) to be shown on a specific monitor? I need this because my three applications are windowstate maximized without border, each one should be shown on another monitor. thx in advance, eza

    N D L E 4 Replies Last reply
    0
    • E ezazazel

      Hi! Is it possible to force an application (WPF) to be shown on a specific monitor? I need this because my three applications are windowstate maximized without border, each one should be shown on another monitor. thx in advance, eza

      N Offline
      N Offline
      Nagy Vilmos
      wrote on last edited by
      #2

      If you get an answer can you reply on this thread too, I would be interested in this as it is an issue with my company's app. We have a crude solution, but something elegant would be cuwel. Thanks


      Panic, Chaos, Destruction. My work here is done.

      1 Reply Last reply
      0
      • E ezazazel

        Hi! Is it possible to force an application (WPF) to be shown on a specific monitor? I need this because my three applications are windowstate maximized without border, each one should be shown on another monitor. thx in advance, eza

        D Offline
        D Offline
        DaveyM69
        wrote on last edited by
        #3

        I don't know about in WPF, but in WinForms you can get an array of all the available screens using the static Screen.AllScreens readonly property. So long as the form's StartPosition is FormStartPosition.Manual then you can use the desired screen's bounds to make sure it goes to the right place. If nothing similar exists in WPF, I believe you can still add a reference to System.Windows.Forms which should allow you to do this.

        Dave
        BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)
        Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)

        1 Reply Last reply
        0
        • E ezazazel

          Hi! Is it possible to force an application (WPF) to be shown on a specific monitor? I need this because my three applications are windowstate maximized without border, each one should be shown on another monitor. thx in advance, eza

          L Offline
          L Offline
          Luc Pattyn
          wrote on last edited by
          #4

          Hi, I have done such things many years ago, and can't test it right now. This is how I remember it: - AFAIK there is no single command to do it; - assuming the desktop extends across all monitors, the virtual desktop has boundaries much larger than the normal 1280*1024 or whatever resolution you use; - open your window in normal mode (not maxed/mined) and keep its size below one screen full; - now move it around by setting its topleft corner, move it to a point that is near the topleft of the monitor you want; - only then maximize it. :)

          Luc Pattyn [Forum Guidelines] [My Articles]


          - before you ask a question here, search CodeProject, then Google - the quality and detail of your question reflects on the effectiveness of the help you are likely to get - use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets


          1 Reply Last reply
          0
          • E ezazazel

            Hi! Is it possible to force an application (WPF) to be shown on a specific monitor? I need this because my three applications are windowstate maximized without border, each one should be shown on another monitor. thx in advance, eza

            E Offline
            E Offline
            ezazazel
            wrote on last edited by
            #5

            Found only System.Windows.Forms.AllScreens which can be used but is not how I really like it to be done. The reason is I'm using WPF, and just for this using the Windows.Forms is a pain. Has anyone an idea of how much extra RAM I need for using Windows.Forms just for one function? As far as I've ssen there aren't really any alternatives (except using unmanaged code and p/invoke) but this is the least think I really want to do (beyond using e.g NVIDIA APIs). More ideas are welcome! ;) greets, eza

            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