Windows USER

Windows USER is a component of the Microsoft Windows operating system that provides core functionality for building simple user interfaces. The component has existed in all versions of Windows, and includes functionality for window management, message passing, input processing and standard controls.

Functionality and role

Windows USER provides a large part of the core user experience for Microsoft Windows. Historically, it was responsible for:[1] [2]

  • Causing windows to be drawn (using GDI as a device-independent API for drawing primitives)
  • Obscuring overlapping windows behind others
  • Window size and positioning
  • Providing all the standard window management controls (such as close boxes or title bars)
  • Providing the standard Windows menu bar
  • Providing of standard controls (such as button, List box or Edit Box)
  • Providing dialog box management (short-cut keys, tab key processing)
  • Processing all user input from the mouse and keyboard
  • The desktop background image
  • Drawing all standard visual elements
  • Inter-process communication using Dynamic Data Exchange
  • Mouse pointer cursor display and management
  • Data transfer (Clipboard)

Gradually, as Windows has become larger and better factored, Windows USER has cooperated with other components to provide this functionality:

  • Controls: Starting with Windows 95, new controls were placed into a separate common controls component. Starting with Windows XP, new implementations of the standard controls were also moved to that same component.
  • Windows Management experience: Starting with Windows Vista, drawing standard window management was moved from Windows USER to the Desktop Window Manager.
  • Standard Visuals: Starting with Windows XP, visual elements are drawn by the Theming component.
  • Inter-program communication: Starting with Windows 3.1, Object Linking and Embedding replaced Dynamic Data Exchange as the recommended model for inter program communication.
  • Menu bar: Starting in Windows 7, the Ribbon interface is a recommended replacement for the menu bar and context menus. It is provided by the UIRibbon component.[3]

Developer experience

Windows USER implements abstractions that are used to build Windows applications. These include

  • HWND (Handle to Window)

The HWND is the basic unit of visual display and input in the Windows developer platform. All visual elements either have their own HWNDs or live as part of a larger HWND. Many functions in Windows USER manipulate properties on HWNDs such as size, position and title. Each HWND also has a communication channel (WNDPROC - Window Procedure) for delivery of messages.

Windows are managed as a tree, with the desktop window at the root of the hierarchy. Child windows are usually (but not always) visually contained within their parents.

  • MSG (Message)

Applications and the operating system communicate with HWNDs using messages. A window message is the combination of a target HWND, a message code, and other details such as mouse position.

  • Message Loop

By combining calls to Windows USER in the right way, a Windows application processes messages. The core Windows message loop (including calls to GetMessage, TranslateMessage and DispatchMessage) is at the core of any Windows application.

Developer functionality related to Windows USER is provided in the C header file winuser.h.

Implementation

In 16-bit versions of Windows, Windows USER was implemented as a file called user.exe. The file extension here was a misnomer, as Windows USER was in fact always a dynamic link library.

In 32-bit versions of Windows, the 32-bit version of Windows USER is called user32.dll and is located in the System32 directory, while compatibility with 16-bit applications is provided by having a modified version of user.exe also present.

In 64-bit versions of Windows, the 64-bit implementation of Windows USER is called user32.dll and is located in the System32 directory, while a modified 32-bit version (also called user32.dll) is present in the SysWOW64 directory.

gollark: Please also give me write access to the repo.
gollark: Oh, right, array indexing.
gollark: ```python# parsita-based pseudocode syntax parserfrom stmt import *from parsita import *from parsita.util import constantdef compose(f, g): return lambda x: f(g(x))def map_expr(x): start, end = x if end == "": return start return Op([start, end[1]], end[0])def map_unop_expr(x): return Op(x[1], x[0])def aliases(name, aliases): p = lit(name) for alias in aliases: p |= (lit(alias) > (lambda _: name)) return pclass ExprParser(TextParsers): ε = lit("") IntLit = reg("\-?[0-9]+") > compose(IntLit, int) StrLit = "'" >> reg("[^']*") << "'" > StrLit # TODO escapes (not in "spec" but could be needed) FloatLit = reg("\-?[0-9]+\.[0-9]+") > compose(FloatLit, float) Identifier = reg("[a-zA-Z_]+[a-zA-Z_0-9]*") > Var BracketedExpr = "(" >> Expr << ")" UnaryOperator = lit("NOT") Start = FloatLit | StrLit | IntLit | BracketedExpr | (UnaryOperator & Expr > map_unop_expr) | Identifier # avoid left recursion problems by not doing left recursion # AQA pseudocode does not appear to have a notion of "operator precedence", simplifying parsing logic nicely BinaryOperator = aliases("≤", ["<="]) | aliases("≠", ["!="]) | aliases("≥", [">="]) | lit("DIV") | lit("MOD") | lit("AND") | lit("OR") | reg("[+/*\-=<>]") End = (BinaryOperator & Expr) | ε Expr = (Start & End) > map_exprparse = ExprParser.Expr.parsex = parse("1+2+3 != 6 AND NOT 4 AND x + y")if isinstance(x, Failure): print(x.message)else: print(x.value)```
gollark: <@332271551481118732> Expression parsing is done, I think.
gollark: I wonder if AQA pseudocode *does* have operator precedence. We may need to harvest exam papers.

See also

References

  1. Petzold, Charles (1998). Programming Windows Fifth Edition, Microsoft Press, ISBN 978-1-57231-995-0 .
  2. Chen, Raymond (2007). The Old New Thing, Addison-Wesley Professional, ISBN 978-0-321-44030-3
  3. Windows Ribbon Framework
This article is issued from Wikipedia. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.