User32
Encyclopedia
Windows USER is a component of the Microsoft Windows
Microsoft Windows
Microsoft Windows is a series of operating systems produced by Microsoft.Microsoft introduced an operating environment named Windows on November 20, 1985 as an add-on to MS-DOS in response to the growing interest in graphical user interfaces . Microsoft Windows came to dominate the world's personal...

 operating system
Operating system
An operating system is a set of programs that manage computer hardware resources and provide common services for application software. The operating system is the most important type of system software in a computer 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
Window manager
A window manager is system software that controls the placement and appearance of windows within a windowing system in a graphical user interface. Most window managers are designed to help provide a desktop environment...

, message passing
Message passing
Message passing in computer science is a form of communication used in parallel computing, object-oriented programming, and interprocess communication. In this model, processes or objects can send and receive messages to other processes...

, input processing
Input device
In computing, an input device is any peripheral used to provide data and control signals to an information processing system such as a computer or other information appliance...

 and standard controls.

Functionality and Role

Windows USER provides a large part of the core user experience for Microsoft Windows. Historically, USER was responsible for:

  • Causing windows to be drawn
  • Obscuring overlapping windows behind others
  • Window size and positioning
  • Providing all the standard window management controls (such as close boxes or title bars
    Title bar
    In computing, the title bar consists of that part of a window where the title of the window appears. Most graphical operating systems and window managers position the title bar at the top of the application window as a horizontal bar....

    )
  • Providing the standard Windows menu bar
    Menu bar
    A menu bar is a region of a screen or application interface where drop down menus are displayed. The menu bar's purpose is to supply a common housing for window- or application-specific menus which provide access to such functions as opening files, interacting with an application, or displaying...

  • Providing of standard controls (such as button
    Button (computing)
    In computing, a button is a user interface element that provides the user a simple way to trigger an event, like searching for a query at a search engine, or to interact with dialog boxes, like confirming an action.-Description:A typical button is a rectangle or rounded rectangle, wider than it is...

    , List box or Edit Box
    Text box
    A text box, text field or text entry box is a kind of widget used when building a graphical user interface . A text box's purpose is to allow the user to input text information to be used by the program...

    )
  • Providing dialog box management (short-cut keys, tab key processing)
  • Processing all user input from the mouse and keyboard
  • The desktop
    Desktop metaphor
    The desktop metaphor is an interface metaphor which is a set of unifying concepts used by graphical user interfaces to help users more easily interact with the computer. The desktop metaphor treats the monitor of a computer as if it is the user's desktop, upon which objects such as documents and...

     background image
  • Drawing all standard visual elements
  • Inter-process communication
    Inter-process communication
    In computing, Inter-process communication is a set of methods for the exchange of data among multiple threads in one or more processes. Processes may be running on one or more computers connected by a network. IPC methods are divided into methods for message passing, synchronization, shared...

     using Dynamic Data Exchange
    Dynamic Data Exchange
    Dynamic Data Exchange is a technology for interprocess communication under Microsoft Windows or OS/2.- Overview :Dynamic Data Exchange was first introduced in 1987 with the release of Windows 2.0 as a method of interprocess communication so that one program can communicate with or control another...

  • Mouse pointer cursor display and management
  • Data transfer (Clipboard
    Clipboard (software)
    The clipboard is a software facility that can be used for short-term data storage and/or data transfer between documents or applications, via copy and paste operations...

    )


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
    Windows 95
    Windows 95 is a consumer-oriented graphical user interface-based operating system. It was released on August 24, 1995 by Microsoft, and was a significant progression from the company's previous Windows products...

    , new controls were placed into a separate common controls component. Starting with Windows XP
    Windows XP
    Windows XP is an operating system produced by Microsoft for use on personal computers, including home and business desktops, laptops and media centers. First released to computer manufacturers on August 24, 2001, it is the second most popular version of Windows, based on installed user base...

    , new implementations of the standard controls were also moved to that same component.

  • Windows Management experience: Starting with Windows Vista
    Windows Vista
    Windows Vista is an operating system released in several variations developed by Microsoft for use on personal computers, including home and business desktops, laptops, tablet PCs, and media center PCs...

    , drawing standard window management was moved from Windows USER to the Desktop Window Manager
    Desktop Window Manager
    Desktop Window Manager is the window manager in Windows Vista and Windows 7 that enables the Windows Aero graphical user interface and visual theme. The Desktop Window Manager requires video cards supporting DirectX 9.0 and Shader Model 2.0. DWM is not included with Windows Vista Starter edition...

    .

  • 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
    Object Linking and Embedding
    Object Linking and Embedding is a technology developed by Microsoft that allows embedding and linking to documents and other objects. For developers, it brought OLE Control eXtension , a way to develop and use custom user interface elements...

     replaced Dynamic Data Exchange as the recommended model for inter program communication.

  • Menu bar: Starting in Windows 7, the Ribbon
    Ribbon (computing)
    In GUI-based application software, a ribbon is an interface where a set of toolbars are placed on tabs in a tab bar. Recent releases of some Microsoft applications have embraced this form with a modular ribbon as their main interface. The Ribbon is a contextual interface that offers functionality...

     interface is a recommended replacement for the menu bar and context menus. It is provided by the UIRibbon component.

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, 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, while a modified 32 bit version (also called user32.dll) is present in the SysWOW64 directory.

External links

The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK