ウィンドウスタイル一覧

提供: AutoHotkey Wiki
移動: 案内検索
リファレンス > その他解説 > ウィンドウスタイル一覧 - 公式ドキュメント

ウィンドウやコントロールで使用するスタイル。
スタイルは32ビットの整数値で、2進数にしたときの各桁が1なら、その桁に対応するスタイルが設定されていると言うことになる。
(style & 0x00400000)!=0のような式で、 style変数に格納されたスタイル値に特定のスタイルが設定されているかを判定できる。

ウィンドウ用スタイル[編集]

Common styles[編集]

名前 説明
default for GUI window WS_POPUP, WS_CAPTION, WS_SYSMENU, WS_MINIMIZEBOX
forced for GUI window WS_CLIPSIBLINGS
WS_BORDER 0x00800000 境界を持つウィンドウを作成します。
WS_POPUP 0x80000000 ポップアップ ウィンドウを作成します。WS_CHILD スタイルと一緒に使うことはできません。
WS_CAPTION 0x00C00000 タイトル バーを持つウィンドウを作成します (暗黙に WS_BORDER スタイルを持ちます)。
WS_DLGFRAME スタイルと一緒に使うことはできません。
WS_DISABLED 0x08000000 初期状態で使用禁止のウィンドウを作成します。
WS_DLGFRAME 0x00400000 二重境界を持ち、タイトルを持たないウィンドウを作成します。
WS_GROUP 0x00020000 ユーザーが方向キーを使って次のコントロールに移動できるコントロールのグループの、最初のコントロールを指定します。
最初のコントロールの後で WS_GROUP スタイルを FALSE と指定して定義したコントロールは、すべて同じグループに属します。
次の WS_GROUP スタイルを持つコントロールは、次のグループを開始します (つまり、次のグループの始まりが、前のグループの終わりになります)。
WS_HSCROLL 0x00100000 水平スクロール バーを持つウィンドウを作成します。
WS_MAXIMIZE 0x01000000 最大表示されたウィンドウを作成します。
WS_MAXIMIZEBOX 0x00010000 最大表示ボタンを持つウィンドウを作成します。
WS_MINIMIZE 0x20000000 初期状態でアイコン化されたウィンドウを作成します。必ず WS_OVERLAPPED スタイルと一緒に使います。
WS_MINIMIZEBOX 0x00020000 アイコン化ボタンを持つウィンドウを作成します。
WS_OVERLAPPED 0 オーバラップ ウィンドウを作成します。オーバラップ ウィンドウは、通常キャプションと境界を持ちます。
WS_OVERLAPPEDWINDOW 0x00CF0000 WS_OVERLAPPEDWS_CAPTIONWS_SYSMENUWS_THICKFRAMEWS_MINIMIZEBOXWS_MAXIMIZEBOX スタイルを持つオーバラップ ウィンドウを作成します。
WS_POPUPWINDOW 0x80880000 WS_BORDERWS_POPUPWS_SYSMENU スタイルを持つポップアップ ウィンドウを作成します。
コントロール メニューを可視にするには、WS_CAPTION スタイルと WS_POPUPWINDOW を組み合わせなければなりません。
WS_SIZEBOX 0x0000F2C0 +/-Resize. Creates a window that has a sizing border. Same as the WS_THICKFRAME style.
WS_SYSMENU 0x00080000 タイトル バーにコントロール メニュー ボックスを持つウィンドウを作成します。タイトル バーを持つウィンドウにだけ使います。
WS_TABSTOP 0x00010000 +/-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.
WS_THICKFRAME 0x00040000 ウィンドウのサイズ変更に使うことができる、太い枠を持つウィンドウを作成します。
WS_VSCROLL 0x00200000 垂直スクロール バーを持つウィンドウを作成します。
WS_VISIBLE 0x10000000 初期状態で可視のウィンドウを作成します。
WS_CHILD 0x40000000 子ウィンドウを作成します。WS_POPUP スタイルと一緒に使うことはできません。

コントロール用スタイル[編集]

Edit[編集]

名前 説明
default WS_TABSTOP and WS_EX_CLIENTEDGE (extended style E0x200)

If an Edit is auto-detected as multi-line due to its starting contents containing multiple lines, its height being taller than 1 row, or its row-count having been explicitly specified as greater than 1, the following styles will be applied by default: WS_VSCROLL, ES_WANTRETURN, and ES_AUTOVSCROLL

If an Edit is auto-detected as a single line, it defaults to having ES_AUTOHSCROLL.

forced なし。
ES_AUTOHSCROLL 0x0080 ユーザーが行末に文字を入力したときに、テキストを自動的に 10 文字分右へスクロールします。
ユーザーが Enter キーを押すと、コントロールは、位置 0 へ戻すようにテキスト全体をスクロールします。
ES_AUTOVSCROLL 0x0040 ユーザーが最終行で Enter キーを押したとき、自動的に 1 ページ分上にテキストをスクロールします。
ES_CENTER 0x0001 1 行または複数行のエディット コントロールで、テキストを中央揃えで表示します。
ES_LOWERCASE 0x0010 エディット コントロールに入力された文字をすべて小文字に変換します。
ES_NOHIDESEL 0x0100 通常、エディット コントロールが入力フォーカスを失うと選択が通常の表示に戻り、入力フォーカスを受け取ったときに選択を強調表示します。ES_NOHIDESEL は、このデフォルトの動作を行わないようにします。
ES_NUMBER 0x2000 +/-Number. Accepts into the edit control only digits to be typed.
ES_OEMCONVERT 0x0400 エディット コントロールに入力されたテキストを、ANSI 文字セットから OEM 文字セットに変換し、その後 ANSI 文字セットに戻します。
これにより、アプリケーションがコンボ ボックス内の ANSI 文字列を OEM 文字列に変換するために Windows 関数 AnsiToOem を呼び出すとき、正しい変換が確実に行われます。このスタイルは、ファイル名を保持するエディット コントロールでは最も有用です。
ES_MULTILINE 0x0004 複数行のエディット コントロールを指定します (デフォルトは 1 行のエディット コントロールです)。
ES_AUTOVSCROLL スタイルが指定されていると、エディット コントロールはできるだけ多くの行を表示し、ユーザーが Enter キーを押したときに垂直方向にスクロールします。
ES_AUTOVSCROLL が指定されていないと、エディット コントロールはできるだけ多くの行を表示し、それ以上表示できなくなったときにユーザーが Enter キーを押すとビープ音を鳴らします。
ES_AUTOHSCROLL スタイルが指定されると、複数行のエディット コントロールは、カレットがコントロールの右端を越えたときに自動的に水平方向にスクロールします。
新しい行を開始するときは、ユーザーは Enter キーを押さなければなりません。ES_AUTOHSCROLL が指定されないと、必要に応じて自動的に次の行の始めに単語を折り返します。
Enter キーを押しても新しい行が始まります。単語の折り返し位置は、ウィンドウのサイズによって決まります。ウィンドウのサイズが変更されると、折り返し位置も変更されテキストが再表示されます。
複数行のエディット コントロールには、スクロール バーを持たせることができます。
スクロール バーを持つエディット コントロールは自分自身でスクロール バー メッセージを処理します。
スクロール バーを持たないエディット コントロールでは、上で説明したようにスクロールが行われ、親ウィンドウから送られた任意のスクロール メッセージを処理します。
ES_PASSWORD 0x0020 エディット コントロールに入力されたすべての文字を アスタリスク (*) で表示します。
アプリケーションは SetPasswordChar メンバ関数を使って、表示する文字を変更できます。
ES_READONLY 0x0800 エディット コントロール内でテキストの入力や編集ができないようにします。
ES_RIGHT 0x0002 1 行または複数行のエディット コントロールで、テキストを右揃えで表示します。
ES_UPPERCASE 0x0008 エディットコントロールに入力されたすべての文字を大文字に変換します。
ES_WANTRETURN 0x1000 ユーザーがダイアログ ボックスの複数行のエディット コントロールにテキストを入力しているときに Enter キーを押すとキャリッジ リターンが挿入されることを示します。
このスタイルが指定されていないときに Enter キーを押すと、ダイアログ ボックスのデフォルトのプッシュボタンを押したことと同じになります。このスタイルは、1 行のエディット コントロールでは効果がありません。

Text,Picture[編集]

名前 説明
default なし。
forced Picture: SS_BITMAP
SS_BLACKFRAME 0x07 ウィンドウの枠と同じ色で描画される枠を持つボックスを指定します。デフォルトは黒です。
SS_BLACKRECT 0x04 ウィンドウの枠の描画に使われる色で塗りつぶされた四角形を指定します。デフォルトは黒です。
SS_CENTER 0x01 単純な四角形を指定し、その中に指定されたテキストを中央揃えで表示します。
テキストは表示される前に書式化されます。行末を越える単語は自動的に次の行に折り返され、中央に揃えられます。
SS_ETCHEDFRAME 0x12 Draws the frame of the static control using the EDGE_ETCHED edge style.
SS_ETCHEDHORZ 0x10 Draws the top and bottom edges of the static control using the EDGE_ETCHED edge style.
SS_ETCHEDVERT 0x11 Draws the left and right edges of the static control using the EDGE_ETCHED edge style.
SS_GRAYFRAME 0x08 画面の背景色 (デスクトップ) と同じ色で描画される枠のボックスを指定します。デフォルトは灰色です。
SS_GRAYRECT 0x05 画面のバックグラウンドを塗りつぶすのに使う色で塗りつぶされた四角形を指定します。デフォルトは灰色です。
SS_LEFT 0x0000 単純な四角形を指定し、その中に指定されたテキストを左揃えで表示します。
テキストは表示される前に書式化されます。行末を越える単語は自動的に次の行に折り返され、左に揃えられます。
SS_LEFTNOWORDWRAP 0x0C 単純な四角形を指定し、その中に指定されたテキストを左揃えで表示します。
テキストは表示される前に書式化されます。タブは展開されますが、単語は折り返されません。行末を越えるテキストはクリップされます。
SS_NOPREFIX 0x80 このスタイルを指定しない限り、Windows はコントロールのテキスト内のアンパサンド (&) 文字をアクセラレータのプレフィックス文字として解釈します。
この場合、アンパサンド (&) は取り除かれ、文字列中のその次の文字に下線が付けられます。
スタティック コントロールがこの機能を必要としないテキストを持っているときは、SS_NOPREFIX を追加します。
このスタティック コントロールのスタイルは、定義されているすべてのスタティック コントロールに含めることができます。
ビットごとの OR 演算子を使って、他のスタイルと SS_NOPREFIX を組み合わせて指定できます。
このスタイルは、ダイアログ ボックスのスタティック コントロールにファイル名やアンパサンド (&) を持つその他の文字列を表示する必要があるときなどに使います。
SS_NOTIFY 0x0100 Sends the parent window the STN_CLICKED notification when the user clicks the control.
SS_RIGHT 0x0002 単純な四角形を指定し、その中に指定されたテキストを右揃えで表示します。
テキストは表示される前に書式化されます。行末を越える単語は自動的に次の行に折り返され、右に揃えられます。
SS_SUNKEN 0x1000 Draws a half-sunken border around a static control.
SS_WHITEFRAME 0x09 ウィンドウの背景色と同じ色で描画される枠を持つボックスを指定します。デフォルトは白です。
SS_WHITERECT 0x06 ウィンドウのバックグラウンドを塗りつぶすのに使われる色で塗りつぶされた四角形を指定します。デフォルトは白です。

Picture[編集]

名前 説明
default なし。
forced アイコンとカーソルでは SS_ICON、その他では SS_BITMAP
SS_REALSIZECONTROL 0x40 [Windows XP or later] Adjusts the bitmap to fit the size of the control.
SS_CENTERIMAGE 0x200 Centers the bitmap in the control. If the bitmap is too large, it will be clipped. For text controls If the control contains a single line of text, the text is centered vertically within the available height of the control

Microsoft Windows XP: This style bit no longer results in unused portions of the control being filled with the color of the top left pixel of the bitmap or icon. Unused portions of the control will remain the background color.

UpDonw[編集]

名前 説明
default UDS_ARROWKEYS, UDS_ALIGNRIGHT, UDS_SETBUDDYINT, and UDS_AUTOBUDDY.
forced なし。
UDS_WRAP 0x1 範囲の始点または終点を越えて増減されたときに位置を "ラップ" します。
UDS_SETBUDDYINT 0x2 位置が変更されたときに、WM_SETTEXT メッセージを使って、バディ ウィンドウのテキストをコントロールが設定します。
テキストは、10 進文字列または 16 進文字列として書式化された位置から成ります。
UDS_ALIGNRIGHT 0x4 バディ ウィンドウの右端の隣にスピン ボタン コントロールを配置します。バディ ウィンドウの幅は、コントロールの幅に応じて減少します。
UDS_ALIGNLEFT 0x8 バディ ウィンドウの左端の隣にスピン ボタン コントロールを配置します。バディ ウィンドウの幅は、コントロールの幅に応じて減少します。
UDS_AUTOBUDDY 0x10 コントロールのバディ ウィンドウとして、Z 順で直前のウィンドウを自動的に選択します。
UDS_ARROWKEYS 0x20 上向きの矢印または下向きの矢印キーが押されたときに、コントロールが位置を増減します。
UDS_HORZ 0x40 コントロールの矢印を上下ではなく、左右を指すようにします。
UDS_NOTHOUSANDS 0x80 10 進 3 桁ごとに 1000 単位の区切りを挿入しません。
UDS_HOTTRACK 0x100 Causes the control to exhibit "hot tracking" behavior. That is, it highlights the control's buttons as the mouse passes over them. This style requires Microsoft Windows 98 or Windows 2000. If the system is running Windows 95 NT4, the flag is ignored. The flag is also ignored on Windows XP when the desktop theme overrides it.
(16進数) The number format displayed inside the buddy control may be changed from decimal to hexadecimal by following this example:
Gui +LastFound
SendMessage, 1133, 16, 0, msctls_updown321 ; 1133 is UDM_SETBASE

However, this affects only the buddy control, not the UpDown's reported position.

Button, Checkbox, Radio, GroupBox[編集]

名前 説明
default BS_MULTILINE (except for GroupBox, and except for buttons, checkboxes, and radios that have no explicitly set width or height, nor any CR/LF characters in their text)

WS_TABSTOP (except for GroupBox) -- however, radio buttons other than the first of each radio group lack WS_TABSTOP by default. In addition, radio buttons have BS_NOTIFY so that double clicks can be detected.

forced Button: BS_PUSHBUTTON or BS_DEFPUSHBUTTON
Radio: BS_AUTORADIOBUTTON
Checkbox: BS_AUTOCHECKBOX or BS_AUTO3STATE
GroupBox: BS_GROUPBOX
BS_LEFT 0x0100 +/-Left. Left-aligns the text in the button rectangle on the right side of the check box.
BS_PUSHLIKE 0x1000 Makes a button (such as a check box, three-state check box, or radio button) look and act like a push button. The button looks raised when it isn't pushed or checked, and sunken when it is pushed or checked.
BS_RIGHT 0x0200 +/-Right. Right-aligns text in the button rectangle on the right side of the check box.
BS_RIGHTBUTTON 0x0020 +Right (i.e. +Right includes both BS_RIGHT and BS_RIGHTBUTTON, but -Right removes only BS_RIGHT, not BS_RIGHTBUTTON). Positions a check box square or radio button circle on the right side of the control's available width.
BS_BOTTOM 0x0800 Places the text at the bottom of the button rectangle.
BS_CENTER 0x0300 +/-Center. Centers the text horizontally in the button rectangle.
BS_DEFPUSHBUTTON 0x0001 +/-Default. Creates a push button with a heavy black border. If the button is in a dialog box, the user can select the button by pressing the ENTER key, even when the button does not have the input focus. This style is useful for enabling the user to quickly select the most likely option, or default.
BS_MULTILINE 0x2000 +/-Wrap. Wraps the button text to multiple lines if the text string is too long to fit on a single line in the button rectangle.
BS_TOP 0x0400 Places text at the top of the button rectangle.
BS_VCENTER 0x0C00 Vertically centers text in the button rectangle.
BS_FLAT 0x8000 Specifies that the button is two-dimensional; it does not use the default shading to create a 3-D image.

DropDownList, ComboBox[編集]

名前 説明
default WS_TABSTOP (+/-Tabstop)
DropDownList: WS_VSCROLL
ComboBox: WS_VSCROLL, CBS_AUTOHSCROLL
forced DropDownList: CBS_DROPDOWNLIST
ComboBox: Either CBS_DROPDOWN or CBS_SIMPLE
CBS_AUTOHSCROLL 0x0040 ユーザーが行末を越えて文字を入力すると、エディット コントロール内のテキストを自動的に右にスクロールします。
このスタイルが設定されていないと、四角形境界内に入るテキストだけしか受け付けられません。
CBS_DISABLENOSCROLL 0x0800 リスト ボックスがスクロールするほど項目を持っていないときに、垂直スクロールバーを使用できない状態で表示します。
このスタイルを指定しないと、スクロールするほど項目を持っていない場合、スクロールバーは表示されません。
CBS_LOWERCASE 0x4000 +/-Lowercase. Converts to lowercase any uppercase characters that are typed into the edit control of a combo box.
CBS_NOINTEGRALHEIGHT 0x0400 コンボ ボックスのサイズは、コンボ ボックスを作成するときにアプリケーションが指定したサイズと同じになります。
通常は、一部しか表示できない項目を表示しないように、Windows はコンボ ボックスのサイズを変更します。
CBS_OEMCONVERT 0x0080 コンボ ボックスのエディット コントロールに入力されたテキストは、ANSI 文字セットから OEM 文字セットへ変換され、その後、ANSI 文字セットに戻されます。
これにより、アプリケーションがコンボ ボックス内の ANSI 文字列を OEM 文字に変換するために Windows 関数 AnsiToOem を呼び出したとき、正しい文字変換が確実に行われます。
このスタイルはファイル名を保持するコンボ ボックスで最も有用です。CBS_SIMPLE または CBS_DROPDOWN スタイルで作成されたコンボ ボックスでのみ指定できます。
CBS_SIMPLE 0x0001 リスト ボックスを常に表示します。リスト ボックスの現在の選択項目がエディット コントロールに表示されます。
CBS_SORT 0x0100 リスト ボックス内に表示される文字列を自動的にソートします。
CBS_UPPERCASE 0x2000 +/-Uppercase. Converts to uppercase any lowercase characters that are typed into the edit control of a combo box.

ListBox[編集]

名前 説明
default WS_TABSTOP, LBS_USETABSTOPS, WS_VSCROLL, and WS_EX_CLIENTEDGE (extended style E0x200).
forced LBS_NOTIFY (supports detection of double-clicks)
LBS_DISABLENOSCROLL 0x1000 リスト ボックスがスクロールするほど項目を持っていないときに、垂直スクロール バーを使用禁止状態で表示します。
このスタイルを指定しないときにスクロールするほど項目を持っていないと、スクロール バーは表示されません。
LBS_NOINTEGRALHEIGHT 0x0100 リスト ボックスを作成したとき、そのサイズがアプリケーションで指定したサイズと正確に同じになることを指定します。
通常、一部しか表示できない項目を表示しないように、Windows がリスト ボックスのサイズを変更します。
LBS_EXTENDEDSEL 0x0800 Shift キーとマウス、または特殊なキーの組み合わせを使って、ユーザーが複数の項目を選択できるようにします。
LBS_MULTIPLESEL 0x0008 ユーザーが文字列をクリックまたはダブルクリックするたびに、文字列の選択が切り替えられます。文字列はいくつでも選択できます。
LBS_NOSEL 0x4000 +/-ReadOnly. Specifies that the user can view list box strings but cannot select them.
LBS_SORT 0x0002 リスト ボックス内の文字列をアルファベット順にソートします。
LBS_USETABSTOPS 0x0080 リスト ボックスが文字列を描画するときに、タブ文字を認識し、展開します。
デフォルトのタブ位置は 32 ダイアログ単位です (ダイアログ単位とは、水平または垂直の長さのことです。
1 水平ダイアログ単位は、現在のダイアログの基本幅単位の 4 分 1 です。ダイアログの基本単位は、現在のシステム フォントの高さと幅を基準に計算されます。
Windows 関数 GetDialogBaseUnits は、現在のダイアログの基本単位をピクセルで返します)。

ListView[編集]

名前 説明
default WS_TABSTOP, LVS_REPORT, LVS_SHOWSELALWAYS, LVS_EX_FULLROWSELECT, LVS_EX_HEADERDRAGDROP, WS_EX_CLIENTEDGE (E0x200)
forced なし。
LVS_ALIGNLEFT 0x800 アイコン ビューおよび小さなアイコン ビューで、コントロールの左端に沿ってアイテムが配置されます。
LVS_ALIGNTOP 0 アイコン ビューおよび小さなアイコン ビューで、コントロールの上端に沿ってアイテムが配置されます。
LVS_AUTOARRANGE 0x100 アイコン ビューおよび小さなアイコン ビューで、アイコンが自動的に整列します。
LVS_EDITLABELS 0x200 アイテムのテキストをインプレイスで編集できるようにします。
親ウィンドウは、必ず LVN_ENDLABELEDIT 通知メッセージを処理します。
LVS_ICON 0 アイコン ビューを指定します。
LVS_LIST 0x3 リスト ビューを指定します。
LVS_NOCOLUMNHEADER 0x4000 列ヘッダーがレポート ビューに表示されないようにします。
デフォルトでは、レポート ビューの列はヘッダーを持ちます。
LVS_NOLABELWRAP 0x80 アイコン ビューの 1 行にアイテム テキストを表示します。
デフォルトでは、アイテム テキストはアイコン ビュー内でラップされます。
LVS_NOSCROLL 0x2000 スクロールを禁止します。すべてのアイテムがクライアント領域内になければなりません。
LVS_NOSORTHEADER 0x8000 ボタンのように動作しない列ヘッダーを指定します。
レポート ビューの列ヘッダーをクリックしてもソートのような動作を実行しないときに、このスタイルが有用です。
LVS_OWNERDATA 0x1000 This style specifies a virtual list-view control (not directly supported by AutoHotkey).
LVS_OWNERDRAWFIXED 0x400 レポート ビューのアイテムをオーナー ウィンドウが描画できるようにします。
各アイテムを描画するために、リスト ビュー コントロールは WM_DRAWITEM メッセージを送ります。
各サブアイテムに別のメッセージを送ることはありません。指定したリスト ビュー アイテムのアイテム データはDRAWITEMSTRUCT 構造体の itemData メンバが保持しています。
LVS_REPORT 0x1 レポート ビューを指定します。
LVS_SHAREIMAGELISTS 0x40 コントロールが、割り当てられたイメージリストの所有権を持たないことを示します (つまり、コントロールが破棄されるときにもイメージリストは破棄されません)。
このスタイルを使って、同じイメージリストを複数のリストビューコントロールに割り当てることができます。
LVS_SHOWSELALWAYS 0x8 コントロールにフォーカスがなくても、選択されていれば常に選択状態で表示します。
LVS_SINGLESEL 0x4 一度に 1 つのアイテムだけを選択できるようにします。デフォルトでは、複数のアイテムを選択できます。
LVS_SMALLICON 0x2 小さなアイコン ビューを指定します。
LVS_SORTASCENDING 0x10 アイテム テキストをもとにして、アイテムを昇順にソートします。
LVS_SORTDESCENDING 0x20 アイテム テキストをもとにして、アイテムを降順にソートします。

ListView拡張スタイル[編集]

名前 説明
LVS_EX_BORDERSELECT LV0x8000 When an item is selected the border color of the item changes rather than the item being highlighted (might be non-functional in recent operating systems).
LVS_EX_CHECKBOXES LV0x4 +/-Checked. Displays a checkbox with each item. When set to this style, the control creates and sets a state image list with two images using DrawFrameControl. State image 1 is the unchecked box, and state image 2 is the checked box. Setting the state image to zero removes the check box altogether.

Windows XP or later: Checkboxes are visible and functional with all list-view modes except the tile view mode introduced in Windows XP. Clicking a checkbox in tile view mode only selects the item; the state does not change.

LVS_EX_FLATSB LV0x100 Enables flat scroll bars in the list view.
LVS_EX_FULLROWSELECT LV0x20 When a row is selected, all its fields are highlighted. This style is available only in conjunction with the LVS_REPORT style.
LVS_EX_GRIDLINES LV0x1 +/-Grid. Displays gridlines around rows and columns. This style is available only in conjunction with the LVS_REPORT style.
LVS_EX_HEADERDRAGDROP LV0x10 Enables drag-and-drop reordering of columns in a list-view control. This style is only available to list-view controls that use the LVS_REPORT style.
LVS_EX_INFOTIP LV0x400 When a list-view control uses the LVS_EX_INFOTIP style, the LVN_GETINFOTIP notification message is sent to the parent window before displaying an item's ToolTip.
LVS_EX_LABELTIP LV0x4000 If a partially hidden label in any list-view mode lacks ToolTip text, the list-view control will unfold the label. If this style is not set, the list-view control will unfold partly hidden labels only for the large icon mode. Requires Windows XP or later, or the DLLs distributed with Internet Explorer 5.0 or later.
LVS_EX_MULTIWORKAREAS LV0x2000 If the list-view control has the LVS_AUTOARRANGE style, the control will not autoarrange its icons until one or more work areas are defined (see LVM_SETWORKAREAS). To be effective, this style must be set before any work areas are defined and any items have been added to the control.
LVS_EX_ONECLICKACTIVATE LV0x40 The list-view control sends an LVN_ITEMACTIVATE notification message to the parent window when the user clicks an item. This style also enables hot tracking in the list-view control. Hot tracking means that when the cursor moves over an item, it is highlighted but not selected. See the Extended List-View Styles Remarks section for a discussion of item activation.
LVS_EX_REGIONAL LV0x200 Sets the list-view window region to include only the item icons and text using SetWindowRgn. Any area that is not part of an item is excluded from the window region. This style is only available to list-view controls that use the LVS_ICON style.
LVS_EX_SIMPLESELECT LV0x100000 In icon view, moves the state image of the control to the top right of the large icon rendering. In views other than icon view there is no change. When the user changes the state by using the space bar, all selected items cycle over, not the item with the focus. Requires Windows XP or later.
LVS_EX_SUBITEMIMAGES LV0x2 Allows images to be displayed for fields beyond the first. This style is available only in conjunction with the LVS_REPORT style.
LVS_EX_TRACKSELECT LV0x8 Enables hot-track selection in a list-view control. Hot track selection means that an item is automatically selected when the cursor remains over the item for a certain period of time. The delay can be changed from the default system setting with a LVM_SETHOVERTIME message. This style applies to all styles of list-view control. You can check whether hot-track selection is enabled by calling SystemParametersInfo.
LVS_EX_TWOCLICKACTIVATE LV0x80 The list-view control sends an LVN_ITEMACTIVATE notification message to the parent window when the user double-clicks an item. This style also enables hot tracking in the list-view control. Hot tracking means that when the cursor moves over an item, it is highlighted but not selected.
LVS_EX_UNDERLINECOLD LV0x1000 Causes those non-hot items that may be activated to be displayed with underlined text. This style requires that LVS_EX_TWOCLICKACTIVATE be set also.
LVS_EX_UNDERLINEHOT LV0x800 Causes those hot items that may be activated to be displayed with underlined text. This style requires that LVS_EX_ONECLICKACTIVATE or LVS_EX_TWOCLICKACTIVATE also be set.

TreeView[編集]

名前 説明
default WS_TABSTOP, TVS_SHOWSELALWAYS, TVS_HASLINES, TVS_LINESATROOT, TVS_HASBUTTONS, WS_EX_CLIENTEDGE (E0x200)
forced なし。
TVS_CHECKBOXES 0x100 アイテムにチェックボックスを付けます。いったんこのスタイルが設定されると、チェックボックスを取り除くことはできません。
TVS_DISABLEDRAGDROP 0x10 ツリービューが親ウィンドウに TVN_BEGINDRAG 通知メッセージを送らないようにします。
TVS_EDITLABELS 0x8 ユーザーがツリービューのアイテムのテキストを編集できるようにします。
TVS_FULLROWSELECT 0x1000 アイテムをその列全体で選択できるようにします。アイテムのある列のどの部分をクリックしてもそのアイテムが選択されます。
選択されると列全体が強調表示されます。TVS_HASLINES スタイルと組み合わせて指定することはできません。
TVS_HASBUTTONS 0x1 子アイテムを持つときに親アイテムの横に + や - のボタンを表示します。
TVS_HASLINES 0x2 アイテムを線でつなぎます。
TVS_INFOTIP 0x800 ツリービューはツールチップ情報を得るために親ウィンドウに TVN_GETINFOTIP 通知メッセージを送ります。
TVS_LINESATROOT 0x4 一番上のアイテムに線を付けます。TVS_HASLINES スタイルが指定されていない場合は無視されます。
TVS_NOHSCROLL 0x8000 +/-HScroll. Disables horizontal scrolling in the control. The control will not display any horizontal scroll bars.
TVS_NONEVENHEIGHT 0x4000 ツリービューに TVM_SETITEMHEIGHT メッセージを送ることで、アイテムの高さを設定できるようにします。(デフォルトではアイテムの高さは均等です。)
TVS_NOSCROLL 0x2000 ツリービューがスクロールしないようにします。スクロールバーも表示しません。
TVS_NOTOOLTIPS 0x80 アイテムがツリービューからはみ出ているときにツールチップが付かないようにします。
TVS_RTLREADING 0x40 アラビア語やヘブライ語などのシステムにおいて、右から左向きに表示します。日本語のシステムでは指定できません。
TVS_SHOWSELALWAYS 0x20 ツリービューがフォーカスを持っていない状態でも、アイテム選択状態が表示されるようにします。
TVS_SINGLEEXPAND 0x400 選択されたアイテムのみが展開されるようにします。
TVS_TRACKSELECT 0x200 マウスカーソルがアイテムの上に来たときに下線が付きます。

DateTime[編集]

名前 説明
default DTS_SHORTDATECENTURYFORMAT and WS_TABSTOP (+/-Tabstop)
forced なし。
DTS_UPDOWN 0x1 Provides an up-down control to the right of the control to modify date-time values, which replaces the of the drop-down month calendar that would otherwise be available.
DTS_SHOWNONE 0x2 Displays a checkbox inside the control that users can uncheck to make the control have no date/time selected. Whenever the control has no date/time, Gui Submit and GuiControlGet will retrieve a blank value (empty string).
DTS_SHORTDATEFORMAT 0x0 Displays the date in short format. In some locales, it looks like 6/1/05 or 6/1/2005. On older operating systems, a two-digit year might be displayed. This is why DTS_SHORTDATECENTURYFORMAT is the default and not DTS_SHORTDATEFORMAT.
DTS_LONGDATEFORMAT 0x4 Format option "LongDate". Displays the date in long format. In some locales, it looks like Wednesday, June 01, 2005.
DTS_SHORTDATECENTURYFORMAT 0xC Format option blank/omitted. Displays the date in short format with four-digit year. In some locales, it looks like 6/1/2005. If the system's version of Comctl32.dll is older than 5.8, this style is not supported and DTS_SHORTDATEFORMAT is automatically substituted.
DTS_TIMEFORMAT 0x9 Format option "Time". Displays only the time, which in some locales looks like 5:31:42 PM.
DTS_APPCANPARSE 0x10 Not yet supported. Allows the owner to parse user input and take necessary action. It enables users to edit within the client area of the control when they press the F2 key. The control sends DTN_USERSTRING notification messages when users are finished.
DTS_RIGHTALIGN 0x20 +/-Right. The calendar will drop down on the right side of the control instead of the left.
(colors inside the drop-down calendar) The colors of the day numbers inside the drop-down calendar obey that set by the Gui Font command or the c (Color) option. To change the colors of other parts of the calendar, follow this example:
Gui +LastFound
SendMessage, 0x1006, 4, 0xFFAA99, SysDateTimePick321 ; 0x1006 is DTM_SETMCCOLOR. 4 is MCSC_MONTHBK (background color).
;The color must be specified in BGR vs. RGB format (red and blue components swapped).

MonthCal[編集]

名前 説明
default なし。
forced なし。
MCS_DAYSTATE 0x1 Makes the control send MCN_GETDAYSTATE notifications to request information about which days should be displayed in bold. [Not yet supported]
MCS_MULTISELECT 0x2 Named option "Multi". Allows the user to select a range of dates rather than being limited to a single date. By default, the maximum range is 366 days, which can be changed by sending the MCM_SETMAXSELCOUNT message to the control. For example:
Gui +LastFound
SendMessage, 0x1004, 7, 0, SysMonthCal321 ; 7 days. 0x1004 is MCM_SETMAXSELCOUNT.
MCS_WEEKNUMBERS 0x4 Displays week numbers (1-52) to the left of each row of days. Week 1 is defined as the first week that contains at least four days.
MCS_NOTODAYCIRCLE 0x8 Prevents the circling of today's date within the control.
MCS_NOTODAY 0x10 Prevents the display of today's date at the bottom of the control.
(colors) The colors of the day numbers inside the calendar obey that set by the Gui Font command or the c (Color) option. To change the colors of other parts of the calendar, follow this example:
Gui +LastFound
SendMessage, 0x100A, 5, 0xFFAA99, SysMonthCal321 ; 0x100A is MCM_SETCOLOR. 5 is MCSC_TITLETEXT (color of title text).
;The color must be specified in BGR vs. RGB format (red and blue components swapped).

Slider[編集]

名前 説明
default WS_TABSTOP (+/-Tabstop)
forced なし。
TBS_VERT 0x2 +/-Vertical. The control is oriented vertically.
TBS_LEFT 0x4 +/-Left. The control displays tick marks at the top of the control (or to its left if TBS_VERT is present). Same as TBS_TOP
TBS_TOP 0x4 same as TBS_LEFT.
TBS_BOTH 0x8 +/-Center. The control displays tick marks on both sides of the control. This will be both top and bottom when used with TBS_HORZ or both left and right if used with TBS_VERT.
TBS_AUTOTICKS 0x1 The control has a tick mark for each increment in its range of values. Use +/-TickInterval to have more flexibility.
TBS_ENABLESELRANGE 0x20 The control displays a selection range only. The tick marks at the starting and ending positions of a selection range are displayed as triangles (instead of vertical dashes), and the selection range is highlighted (highlighting might require that the theme be removed via Gui -theme).

To set the selection range, follow this example, which sets the starting position to 55 and the ending position to 66:

SendMessage, 1035, 1, 55, msctls_trackbar321, WinTitle
SendMessage, 1036, 1, 66, msctls_trackbar321, WinTitle
TBS_FIXEDLENGTH 0x40 +/-Thick. Allows the thumb's size to be changed.
TBS_NOTHUMB 0x80 The control does not display the moveable bar.
TBS_NOTICKS 0x10 +/-NoTicks. The control does not display any tick marks.
TBS_TOOLTIPS 0x100 +/-Tooltip. The control supports ToolTips. When a control is created using this style, it automatically creates a default ToolTip control that displays the slider's current position. You can change where the ToolTips are displayed by using the TBM_SETTIPSIDE message. Windows 95 and NT4 require Internet Explorer 3.0 or later to support this style.
TBS_REVERSED 0x200 Unfortunately, this style has no effect on the actual behavior of the control, so there is probably no point in using it (instead, use +Invert in the control's options to reverse it). Depending on OS version, this style might require Internet Explorer 5.0 or greater.
TBS_DOWNISLEFT 0x400 Unfortunately, this style has no effect on the actual behavior of the control, so there is probably no point in using it. Depending on OS version, this style might require Internet Explorer 5.01 or greater.

Progress[編集]

名前 説明
default PBS_SMOOTH
forced なし。
PBS_SMOOTH 0x1 +/-Smooth. The progress bar displays progress status in a smooth scrolling bar instead of the default segmented bar. When this style is present, the control automatically reverts to the Classic Theme appearance on Windows XP or later. Windows 95 and NT4 require Internet Explorer 3.0 or later to support this option.
PBS_VERTICAL 0x4 +/-Vertical. The progress bar displays progress status vertically, from bottom to top. Windows 95 and NT4 require Internet Explorer 3.0 or later to support this option.
PBS_MARQUEE 0x8 [Requires Windows XP or later] The progress bar moves like a marquee; that is, each change to its position causes the bar to slide further along its available length until it wraps around to the other side. A bar with this style has no defined position. Each attempt to change its position will instead slide the bar by one increment.

This style is typically used to indicate an ongoing operation whose completion time is unknown.

Tab[編集]

名前 説明
default WS_TABSTOP and TCS_MULTILINE
forced WS_CLIPSIBLINGS
TCS_OWNERDRAWFIXED: forced on or off as required by the control's background color and/or text color.
TCS_SCROLLOPPOSITE 0x0001 Unneeded tabs scroll to the opposite side of the control when a tab is selected.
TCS_BOTTOM 0x0002 +/-Bottom. Tabs appear at the bottom of the control instead of the top.
TCS_RIGHT 0x0002 Tabs appear vertically on the right side of controls that use the TCS_VERTICAL style.
TCS_MULTISELECT 0x0004 Multiple tabs can be selected by holding down CTRL when clicking. This style must be used with the TCS_BUTTONS style.
TCS_FLATBUTTONS 0x0008 Selected tabs appear as being indented into the background while other tabs appear as being on the same plane as the background. This style only affects tab controls with the TCS_BUTTONS style.
TCS_FORCEICONLEFT 0x0010 Icons are aligned with the left edge of each fixed-width tab. This style can only be used with the TCS_FIXEDWIDTH style.
TCS_FORCELABELLEFT 0x0020 Labels are aligned with the left edge of each fixed-width tab; that is, the label is displayed immediately to the right of the icon instead of being centered. This style can only be used with the TCS_FIXEDWIDTH style, and it implies the TCS_FORCEICONLEFT style.
TCS_HOTTRACK 0x0040 Items under the pointer are automatically highlighted
TCS_VERTICAL 0x0080 +/-Left or +/-Right. Tabs appear at the left side of the control, with tab text displayed vertically. This style is valid only when used with the TCS_MULTILINE style. To make tabs appear on the right side of the control, also use the TCS_RIGHT style. This style might not function correctly on Windows XP and beyond if a visual theme is in effect. A possible workaround to also specify the "buttons" style; or use "Gui, -theme" prior to adding the tab control, and "Gui, +theme" afterward.

This style will not correctly display the tabs if a custom background color or text color is in effect. To workaround this, specify -Background and/or cDefault in the tab control's options.

TCS_BUTTONS 0x0100 +/-Buttons. Tabs appear as buttons, and no border is drawn around the display area.
TCS_SINGLELINE 0x0000 +/-Wrap. Only one row of tabs is displayed. The user can scroll to see more tabs, if necessary. This style is the default.
TCS_MULTILINE 0x0200 +/-Wrap. Multiple rows of tabs are displayed, if necessary, so all tabs are visible at once.
TCS_RIGHTJUSTIFY 0x0000 The width of each tab is increased, if necessary, so that each row of tabs fills the entire width of the tab control. This window style is ignored unless the TCS_MULTILINE style is also specified.
TCS_FIXEDWIDTH 0x0400 All tabs are the same width. This style cannot be combined with the TCS_RIGHTJUSTIFY style.
TCS_RAGGEDRIGHT 0x0800 Rows of tabs will not be stretched to fill the entire width of the control. This style is the default.
TCS_FOCUSONBUTTONDOWN 0x1000 The tab control receives the input focus when clicked.
TCS_OWNERDRAWFIXED 0x2000 The parent window is responsible for drawing tabs.
TCS_TOOLTIPS 0x4000 The tab control has a tooltip control associated with it.
TCS_FOCUSNEVER 0x8000 The tab control does not receive the input focus when clicked.

StatusBar[編集]

名前 説明
default SBARS_TOOLTIPS and SBARS_SIZEGRIP (the latter only if the window is resizable).
forced なし。
SBARS_TOOLTIPS 0x800 Displays a tooltip when the mouse hovers over a part of the status bar that: 1) has too much text to be fully displayed; or 2) has an icon but no text.

The text of the ToolTip can be set via:

Gui +LastFound
SendMessage, 0x410, 0, "Text to display", msctls_statusbar321

The bold 0 above is the zero-based part number. To use a part other than the first, specify 1 for second, 2 for the third, etc. NOTE: The ToolTip might never appear on certain OS versions.

SBARS_SIZEGRIP 0x100 Includes a sizing grip at the right end of the status bar. A sizing grip is similar to a sizing border; it is a rectangular area that the user can click and drag to resize the parent window.

拡張ウィンドウスタイル[編集]

ExStyle[編集]

名前 説明
WS_EX_DLGMODALFRAME 0x00000001 二重の境界線を持つウィンドウを作成します。
WS_EX_NOPARENTNOTIFY 0x00000004 このスタイルで作成された子ウィンドウが作成されたり破棄されたりするときに、その親ウィンドウに WM_PARENTNOTIFY メッセージを送らないように指定します。
WS_EX_TOPMOST 0x00000008 最前面ウィンドウを作成します。ウィンドウが非アクティブな状態でも、ほかのウィンドウの前面に表示されます。
SetWindowPos 関数を使用すると、非最前面ウィンドウに変更できます。
WS_EX_ACCEPTFILES 0x00000010 ドラッグアンドドロップで、ファイルを受け入れます。
WS_EX_TRANSPARENT 0x00000020 透過ウィンドウを作成します。このウィンドウの下にあるどのようなウィンドウも、遮られることなく表示されます。
WS_EX_MDICHILD 0x00000040 MDI 子ウィンドウを作成します。
WS_EX_TOOLWINDOW 0x00000080 ツールウィンドウを作成します。ツールウィンドウは通常のタイトルバーより小さいタイトルバーを持ちます。
タスクバーには表示されません。ユーザーが[Alt]キーと[Tab]キーを同時に押すと現れるダイアログ内にも、表示されません。
WS_EX_WINDOWEDGE 0x00000100 ウィンドウが盛り上がった縁の境界線を持つように指定します。
WS_EX_CLIENTEDGE 0x00000200 縁が沈んで見える境界線を持つウィンドウを指定します。
WS_EX_CONTEXTHELP 0x00000400 ダイアログボックスのタイトルバーに[?]ボタンを追加します。
ユーザーがこのボタンをクリックすると、マウスポインタに疑問符が付きます。
その後、ユーザーがダイアログボックス内のコントロールをクリックすると、コントロールは WM_HELP メッセージを受け取ります。コントロールはダイアログの処理にそのメッセージを送ります。
WS_EX_RIGHT 0x00001000 右揃えされたプロパティを持つウィンドウを作成します。
ヘブライ語やアラビア語をサポートしているシステムで有効です。他の言語でこのスタイルを指定するとエラーになります。
WS_EX_LEFT 0x00000000 左揃えされたプロパティを持つウィンドウを作成します。(デフォルト)
WS_EX_RTLREADING 0x00002000 右から左への読み取り順序を持つプロパティを持ったウィンドウを作成します。
ヘブライ語やアラビア語をサポートしているシステムで有効です。他の言語でこのスタイルを指定するとエラーになります。
WS_EX_LTRREADING 0x00000000 左から右への読み取り順序を持つプロパティを持ったウィンドウを作成します。(デフォルト)
WS_EX_LEFTSCROLLBAR 0x00004000 垂直スクロールバーがクライアント領域の左側に置かれます。
ヘブライ語やアラビア語をサポートしているシステムで有効です。他の言語でこのスタイルを指定するとエラーになります。
WS_EX_RIGHTSCROLLBAR 0x00000000 垂直スクロールバーがクライアント領域の右側に置かれます。(デフォルト)
WS_EX_CONTROLPARENT 0x00010000 ユーザーが[Tab]キーを使って子ウィンドウ間を移動できるようにします。
WS_EX_STATICEDGE 0x00020000 ユーザーの入力を受け付けない項目用の、立体的に見える境界スタイルを持つウィンドウを作成します。
WS_EX_APPWINDOW 0x00040000 ウィンドウが最小化されると、トップレベルウィンドウがタスクバー上に置かれます。
WS_EX_OVERLAPPEDWINDOW 0x00000300 WS_EX_WINDOWEDGE と WS_EX_CLIENTEDGE の組み合わせです。
WS_EX_PALETTEWINDOW 0x00000188 WS_EX_WINDOWEDGE と WS_EX_TOOLWINDOW と WS_EX_TOPMOST の組み合わせです。
WS_EX_LAYERED 0x00080000 ...