Windows Styles - Window Programming - Lecture Slides, Slides of Windows Programming

Windows Styles, Hierarchy of windows, Desktop Window, Top level Window, Overlapped Window, Popup Window, Child window, Threads, Worker Thread, Client area, Edit Control Styles are the terms you can learn in this lecture and few others as well.

Typology: Slides

2011/2012

Uploaded on 11/06/2012

parasad
parasad 🇮🇳

4.5

(56)

131 documents

1 / 39

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Windows Programming
Lecture 11
Docsity.com
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27

Partial preview of the text

Download Windows Styles - Window Programming - Lecture Slides and more Slides Windows Programming in PDF only on Docsity!

Windows Programming

Lecture 11

Windows Styles

  • WS_CAPTION Creates a window that has a title bar (implies the WS_BORDER style).
  • WS_CHILD Creates a child window. Cannot be used with the WS_POPUP style.
  • WS_DISABLED Creates a window that is initially disabled.
  • WS_HSCROLL Creates a window that has a horizontal scroll bar.
  • WS_MAXIMIZE Creates a window of maximum size.
  • WS_VISIBLE Creates a window that is initially visible.

Hierarchy of windows

The basic building block for displaying information in the Microsoft® Windows™ graphical environment is the window. Microsoft Windows manages how each window relates to all other windows in terms of visibility, ownership, and parent/child relationship. Windows uses this relationship information when creating, destroying, or displaying a window

Desktop Window

When Windows initializes, it creates a window, known as the desktop window , that is sized to cover the entire display area and upon which all other windows are displayed. The window manager uses the desktop window as the top of the window manager's list. Thus, the desktop window is the top of the window hierarchy.

Top-level Window

Another type of relationship can exist between top-level windows: Top-level windows can own or be owned by other top-level windows. An owned window is always above its owner in the Z order and is hidden when its owner is minimized

Overlapped Window

  • A window with the WS_OVERLAPPED style.

Overlapped windows are top-level windows.

These are designed to serve as an application's

main window

  • Overlapped window can only be owned by

overlapped window.

Child window

The desktop window occupies the first level of the windows hierarchy and top-level windows occupy the second level. Child windows , which are windows created with the WS_CHILD style, occupy all other levels. The window manager connects child windows to their parent window in the same way it connects top-level windows to the desktop window.

Child window

  • Child window is confined to parent’s client area
  • Only child can have a parent (in CreateWindow() )
  • It can’t have a menu, but may have a caption
  • It overlays the parent, receives all messages in that area before parent does.
  • Child windows used for controls

When owner window is minimized, owned

window is hidden.

Destroying owner window destroy sall

owned windows.

Owned windows are always displayed on

the top of their owner window.

Threads

  • A thread is basically a path of execution through a program. It is also the smallest unit of execution that Win32 schedules. A thread consists of a stack, the state of the CPU registers, and an entry in the execution list of the system scheduler. Each thread shares all of the process’s resources
  • could be performed at the same time. Threads are an operating system feature that lets application logic be separated into several concurrent execution paths.

Worker Thread

A worker thread is commonly used to handle background tasks that the user shouldn’t have to wait for to continue using your application. Tasks such as recalculation and background printing are good examples of worker threads. This article details the steps necessary to create a worker thread.

User-interface Threads

In Windows, a thread that handles user input and responds to user events independently of threads executing other portions of the application. User-interface thread own one or more windows and have their own message queue. User- interface thread process messages received from the system.

Controls

A control is a child window an application uses in conjunction with another window to perform simple input and output (I/O) tasks. Controls are most often used within dialog boxes, but they can also be used in other windows. Controls within dialog boxes provide the user with the means to type text, choose options, and direct a dialog box to complete its action. Controls in other windows provide a variety of services, such as letting the user choose commands, view status, and view and edit text.