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. Detecting a desktop switch

Detecting a desktop switch

Scheduled Pinned Locked Moved C / C++ / MFC
jsonquestion
1 Posts 1 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.
  • R Offline
    R Offline
    Ryan Binns
    wrote on last edited by
    #1

    Does anyone know of a way of detecting when a desktop switch has occurred? I'm not talking about terminal servies (WM_WTSSESSION_CHANGE will do that), but a simple single-user desktop switch. There's an API to do the switch (SwitchDesktop()), but there doesn't seem to be any way of detecting that it has occurred when someone else does the switch. I've used Spy++ to look at every single message sent to my app while I do a switch, and there doesn't seem to be anything unusual, just a bunch of WM_ACTIVATE, WM_ACTIVEAPP, WM_WINDOWPOSCHANGING (but not WM_WINDOWPOSCHANGED however) messages. Nothing extraordinary there. The only thing I saw I wasn't expecting was that the cx and cy fields in the WINDOWPOS structure were both set to -1, although SWP_NOSIZE was also set, so they would be ignored anyway.

    Ryan

    "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"

    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