Google

東海大学理学部物理学科素粒子理論・安江研究室  

ホーム 最新情報 サイトマップ

ウィンドウズ

上へ ウィンドウズ カーソル メッセージの種類 描画・色 長方形領域 文字情報 時間 仮想キーコード

「WNDCLASS wndclass」の「wndclass.style」で使います

wndclass.style = CS_DBLCLKS;

  • CS_BYTEALIGNCLIENT Aligns the window's client area on the byte boundary (in the x direction). This style affects the width of the window and its horizontal position on the display.

  • CS_BYTEALIGNWINDOW Aligns a window on a byte boundary (in the x direction). This style affects the width of the window and its horizontal position on the display.

  • CS_CLASSDC Allocates one device context to be shared by all windows in the class. Because window classes are process specific, it is possible for multiple threads of an application to create a window of the same class. It is also possible for the threads to attempt to use the device context simultaneously. When this happens, the system allows only one thread to successfully finish its drawing operation. For more information, see Device Contexts.

  • CS_DBLCLKS Sends double-click messages to the window procedure when the user double-clicks the mouse while the cursor is within a window belonging to the class.

  • CS_GLOBALCLASS Allows an application to create a window of the class regardless of the value of the hInstance parameter passed to the CreateWindow or CreateWindowEx function. If you do not specify this style, the hInstance parameter passed to the CreateWindow (or CreateWindowEx) function must be the same as the hInstance parameter passed to the RegisterClass function. You can create a global class by creating the window class in a dynamic-link library (.dll) and listing the name of the .dll in the registry under the following keys: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Windows \AppInit_DLLs. Whenever a process starts, the system loads the specified .dlls in the context of the newly started process before calling the entry-point function in that process. The .dll must register the class during its initialization procedure and must specify the CS_GLOBALCLASS style.

  • CS_HREDRAW Redraws the entire window if a movement or size adjustment changes the width of the client area.

  • CS_NOCLOSE Disables Close on the window menu.

  • CS_OWNDC Allocates a unique device context for each window in the class.

  • CS_PARENTDC Sets the clipping region of the child window to that of the parent window so that the child can draw on the parent. A window with the CS_PARENTDC style bit receives a regular device context from the system's cache of device contexts. It does not give the child the parent's device context or device context settings. Specifying CS_PARENTDC enhances an application's performance. For more information, see Device Contexts.

  • CS_SAVEBITS Saves, as a bitmap, the portion of the screen image obscured by a window. The system uses the saved bitmap to re-create the screen image when the window is removed. The system displays the bitmap at its original location and does not send WM_PAINT messages to windows obscured by the window if the memory used by the bitmap has not been discarded and if other screen actions have not invalidated the stored image. This style is useful for small windows (for example, menus or dialog boxes) that are displayed briefly and then removed before other screen activity takes place. This style increases the time required to display the window, because the system must first allocate memory to store the bitmap.

  • CS_VREDRAW Redraws the entire window if a movement or size adjustment changes the height of the client area.

2節へ戻る

HWND CreateWindow(LPCTSTR lpClassName, LPCTSTR lpWindowName, DWORD dwStyle, INT x, INT y, INT nWidth, INT nHeight, HWND hWndParent, HMENU hMenu, HANDLE hInstance, LPVOID lpParam) で使います

CreateWindow(*, *, WS_OVERLAPPEDWINDOW, *, *, *, *, *, *, *, *);

ウィンドウズの種類を決めるには...

  • WS_BORDER Creates a window that has a thin-line border.

  • WS_CAPTION Creates a window that has a title bar (includes the WS_BORDER style).

  • WS_CHILD (or WS_CHILDWINDOW) Creates a child window. This style cannot be used with the WS_POPUP style.

  • WS_CLIPCHILDREN Excludes the area occupied by child windows when drawing occurs within the parent window. This style is used when creating the parent window.

  • WS_CLIPSIBLINGS Clips child windows relative to each other; that is, when a particular child window receives a WM_PAINT message, the WS_CLIPSIBLINGS style clips all other overlapping child windows out of the region of the child window to be updated. If WS_CLIPSIBLINGS is not specified and child windows overlap, it is possible, when drawing within the client area of a child window, to draw within the client area of a neighboring child window.

  • WS_DISABLED Creates a window that is initially disabled. A disabled window cannot receive input from the user. To change this after a window has been created, use EnableWindow.

  • WS_DLGFRAME Creates a window that has a border of a style typically used with dialog boxes. A window with this style cannot have a title bar.

  • WS_GROUP Specifies the first control of a group of controls. The group consists of this first control and all controls defined after it, up to the next control with the WS_GROUP style. The first control in each group usually has the WS_TABSTOP style so that the user can move from group to group. The user can subsequently change the keyboard focus from one control in the group to the next control in the group by using the direction keys. You can turn this style on and off to change dialog box navigation. To change this style after a window has been created, use SetWindowLong.

  • WS_HSCROLL Creates a window that has a horizontal scroll bar.

  • WS_ICONIC (or WS_MINIMIZE) Creates a window that is initially minimized. Same as the WS_MINIMIZE style.

  • WS_MAXIMIZE Creates a window that is initially maximized.

  • WS_MAXIMIZEBOX Creates a window that has a Maximize button. Cannot be combined with the WS_EX_CONTEXTHELP style. The WS_SYSMENU style must also be specified.

  • WS_MINIMIZEBOX Creates a window that has a Minimize button. Cannot be combined with the WS_EX_CONTEXTHELP style. The WS_SYSMENU style must also be specified.

  • WS_OVERLAPPED (or WS_TILED) Creates an overlapped window. An overlapped window has a title bar and a border. Same as the WS_TILED style.

  • WS_OVERLAPPEDWINDOW (or WS_TILEDWINDOW) Creates an overlapped window with the WS_OVERLAPPED, WS_CAPTION, WS_SYSMENU, WS_THICKFRAME, WS_MINIMIZEBOX, and WS_MAXIMIZEBOX styles. Same as the WS_TILEDWINDOW style.

  • WS_POPUP Creates a pop-up window. This style cannot be used with the WS_CHILD style.

  • WS_POPUPWINDOW Creates a pop-up window with WS_BORDER, WS_POPUP, and WS_SYSMENU styles. The WS_CAPTION and WS_POPUPWINDOW styles must be combined to make the window menu visible.

  • WS_SIZEBOX (or WS_THICKFRAME) Creates a window that has a sizing border. Same as the WS_THICKFRAME style.

  • WS_SYSMENU Creates a window that has a window-menu on its title bar. The WS_CAPTION style must also be specified.

  • WS_TABSTOP Specifies a control that can receive the keyboard focus when the user presses the TAB key. Pressing the TAB key changes the keyboard focus to the next control with the WS_TABSTOP style. You can turn this style on and off to change dialog box navigation. To change this style after a window has been created, use SetWindowLong.

  • WS_VISIBLE Creates a window that is initially visible. This style can be turned on and off by using ShowWindow or SetWindowPos.

  • WS_VSCROLL Creates a window that has a vertical scroll bar.

4節へ戻る

CREATESTRUCT構造体

typedef struct tagCREATESTRUCT {
LPVOID lpCreateParams;
HINSTANCE hInstance;
HMENU hMenu;
HWND hwndParent;
int cy;
int cx;
int y;
int x;
LONG style;
LPCTSTR lpszName;
LPCTSTR lpszClass;
DWORD dwExStyle;
} CREATESTRUCT;

太文字の部分CreateWindowで指定したパラメータになっています。

4節へ戻る

WM_CREATE

  • lParam: CreateWindowでウィンドウズを作ったときに、CREATESTRUCT構造体へのポインタを指定してあるとここにきます。たとえば、OnCreate関数内では

使用例

BOOL OnCreate(HWND hWnd, UINT Message, WPARAM wParam, LPARAM lParam)
{
LPCREATESTRUCT lpcs;
lpcs = (LPCREATESTRUCT)lParam;

・・・・・

return TRUE;
}
5節へ戻る

ShowWindow(HWND hWnd, UINT nCmdShow)等で使います

ShowWindow(hWnd, SW_HIDE);

nCmdShowの値

  • SW_FORCEMINIMIZE(どうあっても最小にする) Windows NT 5.0 and later: Minimizes a window, even if the thread that owns the window is hung. This flag should only be used when minimizing windows from a different thread.
  • SW_HIDE(隠れていて表示されない) Hides the window and activates another window.
  • SW_MAXIMIZE(最大化する) Maximizes the specified window.
  • SW_MINIMIZE(最小化する) Minimizes the specified window and activates the next top-level window in the Z order.
  • SW_RESTORE(隠れているのもは視覚化し、最初の状態の大きさにする) Activates and displays the window. If the window is minimized or maximized, the system restores it to its original size and position. An application should specify this flag when restoring a minimized window.
  • SW_SHOW((隠れているのもは視覚化し、現在の状態で表示する) Activates the window and displays it in its current size and position.
  • SW_SHOWDEFAULT(nCmdShowに従う) Sets the show state based on the SW_flag specified in the STARTUPINFO structure passed to the CreateProcess function by the program that started the application.
  • SW_SHOWMAXIMIZED(隠れているのもは視覚化し、最大化する) Activates the window and displays it as a maximized window.
  • SW_SHOWMINIMIZED(隠れているのもは視覚化し、最小化する) Activates the window and displays it as a minimized window.
  • SW_SHOWMINNOACTIVE(最小化する) Displays the window as a minimized window. The active window remains active.
  • SW_SHOWNA(現在の状態で表示) Displays the window in its current state. The active window remains active.
  • SW_SHOWNOACTIVATE(一番最近の状態にする) Displays a window in its most recent size and position. The active window remains active.
  • SW_SHOWNORMAL(隠れているのもは視覚化し、最初の状態の大きさにする) Activates and displays a window. If the window is minimized or maximized, the system restores it to its original size and position. An application should specify this flag when displaying the window for the first time.
1節へ戻る
7節へ戻る

ホーム 上へ 次へ

このWeb サイトではインターネットエクスプローラVer.3.0あるいはそれ以上が推奨です Internet Explorer
この Web サイト(since 1997年12月1日)に関する質問やコメントについては、Mail.gif (4196 バイト)安江 まで電子メールをお送りください。
Copyright © 1997-2015/01 東海大学理学部物理学科安江研究室 All rights reserved
最終更新日: 2015年01月27日
マイクロソフト Front Page98