Sessions, window stations and desktops (GetDesktopWindow () get the desktop handle, is a Windows created by Csrss.exe)

Source: Internet
Author: User

Because it is not safe, this piece of things have been not very clear, today deliberately sorted.

In general, their relationship is as follows:


We know that Windows supports multiple users, and the session can be understood as logging in for each user, such as current login and remote login.
Window stations can be understood as different user groups after landing, we can see different user names in the Task Manager (such as Richard, System, local service, etc.), of which there is only one activity station WINSTA0, Only this station is to accept the user mouse keyboard input. WINSTA0 station also includes 3 desktop (including Winlogon, Disconnect, Default), of which Winlogon refers to landing desktop, when we press ctrl+alt+ Del will enter the Desktop;disconnect refers to the screen saver desktop, default refers to We usually have the taskbar of desktop, of course, the real default desktop is not the application of the above, The desktop we see is actually the interface after the Shell Explorer is started.

Summarize some of the things we normally write about:
(1) The desktop handle that we usually get through GetDesktopWindow () is a window created by Csrss.exe, which is placed within the desktop of WinStation.
The desktop that we see through Win+d is actually a pop up window created by Expolore.exe, which is the same as our normal pop up window, owner is GetDesktopWindow ()
(2) We can create and switch desktop through APIs such as Createdesktop, OpenDesktop, switchdesktop, etc.
(3) We usually write the service program when found that the window does not bounce out, because the service is not running under station WINSTA0. Through FindWindow also can not find the window we are looking for, because it does not have our current winstation
of desktop.
(4) A window station object includes a clipboard, a global atomic set, and multiple desktop objects, so you can transfer data through the Clipboard between multiple desktop within the same window station.
(5) All processes are associated with the session, WinStation, and desktop, so we can represent it as a path: Session 1\winsta0\default, In this way we understand why some APIs require us to transmit information like this.

Resources:

Pushing the Limits of Windows:user and GDI Objects
Virtual desktop:a Simple Desktop Management Tool http://www.cppblog.com/weiym/archive/2012/05/12/174701.html

Sessions, window stations and desktops (GetDesktopWindow () get the desktop handle, is a Windows created by Csrss.exe)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.