Welcome to my “Windows.”
The window is a visible area on the user interface. Windows are generally rectangular. It contains a variety of controls, is used as input and output interface. While windows are generally used for graphical user interfaces, they are sometimes used in command line interfaces as well. A system that uses windows as the main user interface is called a windows system. The idea stems from the Xerox Palo Alto Research Center.https://www.blogger.com
On the window system, the window is generally drawn as a two-dimensional object, is placed on the desktop. Most windows change size, move, hide, reply, and close as the user desires. When two windows overlap, just as in everyday life, one of them lies above the other, and somewhere below is covered by the top window. The window system management part of this operation then called the window administrator.
Windows is an important widget in several graphical user interfaces. Among them are VMS DEC Windows, the GNU / Unix-like system's X Window System, Microsoft Windows, and Open Windows
This concept was developed by the Stanford University Institute (led by Douglas Engelbart). Their earliest systems supported multiple windows, but no obvious way to show their boundaries (such as window borders, title bars, etc.).
The research continued at Xerox's Palo Alto Research Center / PARC (led by Alan Kay). They use overlapping windows. [3]
In the 1980s, PARC proposed the term "WIMP", which stands for Window, Icon, Menu, Pointer respectively.
At that time, Apple and PARC had a simple cooperation. Apple developed its own new interface based on PARC's interface. It was first used on Apple's Lisa and later on Macintosh computers. In the meantime, Microsoft is developing office software for "Mac." After that, they developed their own window system based on the Apple system.
Subclassing and Superclassification.
Window subclassing is a window instance through the GetWindowLong and SetWindowLong window procedure address is changed to a new function address, the new window procedure function to deal with those interested in the message, the other messages passed to the original window procedure. An instance of the class.
Window super classification is an existing window class (WNDCLASS or WNDCLASSEX), to change the characteristics of the window class. Only affect the newly created window instance of the window class does not affect the window has been created before the window process address changes. Superclassification can only change the characteristics of the user-created window, cannot be used for the system to create the window (such as the standard button on the dialog box). An example of a superclass process is as follows:
WNDCLASSEX WC;
wc.cbsize = SIZE of (WC);
Hint --- defines the handle of the module of the window class XXXX, such as the system-defined window class (such as Edit, Button) then hint = NULL (hint, "XXXX", & WC)
wc.lpszClassName = "YYYY"; // You have to change the name of the window class
wc.hbrBackground = CreateSolidBrush (RGB (0,0,0));
wc.lpfnWndProc = NewWndProc; // Change the window procedure
RegisterClassEx (& WC);
Subclassing and Superclassing MFC [edit]
MFC's CWindowImplBaseT:: SubclassWindow is used to dynamically bind a window instance to the current CWnd object. The message loop first calls the CWnd object's window procedure, and the message passed to the base class is processed by the default window procedure. CWnd:: SubclassDlgItem Used to subclass a control of a dialog to a CWnd-base class object. CWindowImplBaseT :: UnsubclassWindow Restore a subclassed window.
The template class CWindowImplBaseT provides a data member WNDPROC m_pfnSuperWindowProc and is initialized to :: DefWindowProc. However, during window superclassing, it stores the window procedure of the registered window class. When the window is subclassed, it saves the original window instance handle window process.
CWnd :: CreateEx installed a hook function _AfxCbtFilterHook called SetWindowsHookEx function before creating the window. The window is just created, the hook function _AfxCbtFilterHook is called. _AfxCbtFilterHook call SetWindowLong the window procedure is replaced by an AfxWndProcBase SetWindowLong return to the original window address is saved to the member variable oldWndProc. Visible, all windows created by CWnd:: CreateEx will be subclassed. In the DefWindowProc function, the message is passed to oldWndProc, the old window address that was saved when subclassing.
Windows Window Type [edit]
Using the Windows API function CreateWindowEx, you can specify the type of window created:
Overlapped Window: The top-level window, as the main window of the application. With the title bar, border and client area, you can have menus, maximum and minimum buttons, scroll bars. Use the CreateWindowEx function to specify WS_OVERLAPPED or WS_OVERLAPPEDWINDOW style.
Pop-up Window: Used for dialog boxes, MessageBox, and other temporary windows that appear outside the application's main window. Title bar optional. Use the CreateWindowEx function to specify the WS_POPUP style. If you need a title bar, indicate the WS_CAPTION style. Use WS_POPUPWINDOW style border and window menu.
Child Window: appears in the client area of the parent window (parent window), the excess is not visible. Typically used to divide the client area of the parent window into sub-regions. Use the CreateWindowEx function to specify the WS_CHILD style. The parent window can be Overlapped, Pop-up, other Child windows. The only necessary feature of the child window is the client area; cannot have a menu; other features are optional. When positioning the child window always use the parent window client area upper left corner of the coordinate system. Destroyed, Hidden, Moved, Shown and other window operations consistent with the parent window. Parent window If the WS_CLIPCHILDREN style is specified, the parent window cannot be drawn on the child window. Sibling windows can be drawn on overlapping client areas unless a WS_CLIPSIBLINGS style is specified.
Layered Window:
Message-Only Window
Owner / Owned Window: Overlapped Window / Pop-up Window can be owned by other Overlapped Window / Pop-up Window. This relationship has the following characteristics: In z-order, the owned window is always above the owner window. When the owner window is destroyed, the system automatically destroys all the windows it owns. When the owner window is minimized, the owned window is automatically hidden. the parameter of CreateWindowEx Function When creating a window with a WS_OVERLAPPED or WS_POPUP style, the owner window is specified with the parameter hwndParent. Dialogs and message boxes are owned by default. The GetWindow function indicates that the GW_OWNER flag gets the window's owner's handle.
No comments:
Post a Comment