#include "stdafx.h" using namespace ActiveBasic::IDE; using namespace ActiveBasic::IDE::WindowComponents; LRESULT CALLBACK WindowFunc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam); void SetupWindow(HWND hwnd); void ResetTextEditFont(HWND hwnd); ::LRESULT MainFrame::OnCreate( ::UINT msg, ::WPARAM wParam, ::LPARAM lParam, ::BOOL& handled ) { // ウィンドウエリアマネージャに親ウィンドウを登録 wam.SetParentWnd( m_hWnd ); RECT rect; GetClientRect( &rect ); // MDIベースを作成 mdiWindow = new MdiWindow(); mdiWindow->Create( m_hWnd, rect, NULL, WS_CHILD ); wam.AddMdiWindow( mdiWindow ); extern HWND hOwner; hOwner = m_hWnd; extern WNDPROC oldMainFrameWndProc; oldMainFrameWndProc = (WNDPROC)::GetWindowLong( hOwner, GWL_WNDPROC ); ::SetWindowLong( hOwner, GWL_WNDPROC, (LONG)WindowFunc ); SetupWindow(hOwner); //テキストエディタフォント設定 ResetTextEditFont(hOwner); return 0; } void MainFrame::OnSize(UINT nType, CSize size) { //mdiWindow->MoveWindow( 0, 0, size.cx, size.cy ); } ::LRESULT MainFrame::OnClose( ::UINT msg, ::WPARAM wParam, ::LPARAM lParam, ::BOOL& handled ) { DestroyWindow(); return 0; } ::LRESULT MainFrame::OnDestroy( ::UINT msg, ::WPARAM wParam, ::LPARAM lParam, ::BOOL& handled ) { mdiWindow->DestroyWindow(); delete mdiWindow; ::PostQuitMessage( 0 ); return 0; }