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. How to show a dialog in other desktop?

How to show a dialog in other desktop?

Scheduled Pinned Locked Moved C / C++ / MFC
c++helptutorialquestion
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.
  • A Offline
    A Offline
    Amarelia
    wrote on last edited by
    #1

    Dear Friends I have created a dialog based MFC application. Here I have one form say "MyForm", showing on my current desktop when I run my application. I have two button on this form called "NewDesktop" and "OldDesktop". Now when I press "NewDesktop" I use CreateDesktop() functions and then SwitchDesktop() so It creates new desktop and shows the new desktop. But now it hides my previous application and my form. Now I want to show my form(MyForm) in this new desktop. I don't know how to do that? Any help please? With many many thankx and regards in advance Mahesh

    T 1 Reply Last reply
    0
    • A Amarelia

      Dear Friends I have created a dialog based MFC application. Here I have one form say "MyForm", showing on my current desktop when I run my application. I have two button on this form called "NewDesktop" and "OldDesktop". Now when I press "NewDesktop" I use CreateDesktop() functions and then SwitchDesktop() so It creates new desktop and shows the new desktop. But now it hides my previous application and my form. Now I want to show my form(MyForm) in this new desktop. I don't know how to do that? Any help please? With many many thankx and regards in advance Mahesh

      T Offline
      T Offline
      Toby Opferman
      wrote on last edited by
      #2

      Have you tried "SetThreadDesktop" and then create the UI? 8bc7c0ec02c0e404c0cc0680f7018827ebee

      A 1 Reply Last reply
      0
      • T Toby Opferman

        Have you tried "SetThreadDesktop" and then create the UI? 8bc7c0ec02c0e404c0cc0680f7018827ebee

        A Offline
        A Offline
        Amarelia
        wrote on last edited by
        #3

        Hi... I have tried that but it return's false value. Whats seems to be the reason? Mahesh

        T 1 Reply Last reply
        0
        • A Amarelia

          Hi... I have tried that but it return's false value. Whats seems to be the reason? Mahesh

          T Offline
          T Offline
          Toby Opferman
          wrote on last edited by
          #4

          "Remarks The SetThreadDesktop function will fail if the calling thread has any windows or hooks on its current desktop (unless the hDesktop parameter is a handle to the current desktop)." You must do this FIRST, then create your window. I don't think there is a way to move an already created window between desktops as it's managed by the WM for that particular desktop. 8bc7c0ec02c0e404c0cc0680f7018827ebee

          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