|
InitInstance( HINSTANCE hInstance, int nCmdShow )
{
HWND hWnd;
h2000 = CreateSolidBrush( RGB( 58,109,165 ) ); // ウインドウの背景色
hInst = hInstance; // グローバル変数にインスタンス ハンドルを保存します
hWnd = CreateWindow(
szWindowClass
,szTitle
,WS_OVERLAPPEDWINDOW
,CW_USEDEFAULT
,0
,CW_USEDEFAULT
,0
,NULL
,NULL
,hInstance
,NULL);
if ( !hWnd ) {
return FALSE;
}
DWORD style;
style =
WS_CHILD |
WS_VISIBLE |
WS_BORDER |
WS_VSCROLL |
WS_HSCROLL |
ES_MULTILINE |
ES_WANTRETURN |
ES_AUTOHSCROLL;
GetClientRect( hWnd, (LPRECT)&rt);
hMedit = CreateWindow( "edit"
,NULL
,style
,0
,0
,rt.right-rt.left
,rt.bottom-rt.top-20
,hWnd
,(HMENU)1
,hInst
,NULL);
if ( !hMedit ) {
DestroyWindow( hWnd );
return FALSE;
}
ShowWindow( hWnd, nCmdShow );
UpdateWindow( hWnd );
return TRUE;
}
| |