では本題に。
コード: 全て選択
'-----------------------------------------------------------------------------
' イベント プロシージャ
'-----------------------------------------------------------------------------
' このファイルには、ウィンドウ [MainWnd] に関するイベントをコーディングします。
' ウィンドウ ハンドル: hMainWnd
' TODO: この位置にグローバルな変数、構造体、定数、関数を定義します。
Declare Function DefFrameProc Lib "user32" Alias "DefFrameProcA"(hWnd As DWord, hWndMDIClient As DWord, uMsg As DWord, wParam As DWord, lParam As DWord) As DWord
Declare Function CreateMDIWindow Lib "user32" Alias "CreateMDIWindowA"(lpClassName As BytePtr,lpWindowName As BytePtr,dwStyle As DWord,X As Long,Y As Long,nWidth As Long,nHeight As Long,hWndParent As HWND,hInstance As HINSTANCE,lParam As LPARAM) As HWND
Dim hClient As DWord
Dim hStatusWnd As DWord
Dim StatusHight As DWord
Dim rect As RECT
Type CLIENTCREATESTRUCT
hWindowMenu As DWord
idFirstChild As DWord
End Type
Const ID_STATUS = 71
'-----------------------------------------------------------------------------
' ウィンドウメッセージを処理するためのコールバック関数
Function MainWndProc(hWnd As HWND, dwMsg As DWord, wParam As WPARAM, lParam As LPARAM) As DWord
' TODO: この位置にウィンドウメッセージを処理するためのコードを記述します。
' イベントプロシージャの呼び出しを行います。
MainWndProc=EventCall_MainWnd(hWnd,dwMsg,wParam,lParam)
End Function
'-----------------------------------------------------------------------------
' ここから下は、イベントプロシージャを記述するための領域になります。
Sub MainWnd_Destroy()
DestroyWindow(hClient)
Client_DestroyObjects()
PostQuitMessage(0)
End Sub
Sub MainWnd_Create(ByRef CreateStruct As CREATESTRUCT)
Dim ccs As CLIENTCREATESTRUCT
Dim Statusbar_Sizes[2] As Long
Dim lpdwp As DWord
Dim lpdfp As DWord
'Clientウィンドウを作成
ccs.hWindowMenu=GetSubMenu(GetMenu(hMainWnd),1)
ccs.idFirstChild=2000
hClient = CreateWindowEx(0,"MDICLIENT",NULL, _
WS_CHILD or WS_VISIBLE or WS_CLIPCHILDREN or _
WS_HSCROLL or WS_VSCROLL, _
0,0,0,0, _
hMainWnd, CreateStruct.hMenu, GetModuleHandle(0),VarPtr(ccs))
'If hClient Then
' MessageBox(hMainWnd,"Client OK!"+Str$(hClient),"",MB_OK)
'End If
'ステータスバーを作成
hStatusWnd = CreateStatusWindow(WS_CHILD or WS_VISIBLE or CCS_BOTTOM or SBARS_SIZEGRIP, _
NULL, hMainWnd, ID_STATUS)
'ステータスバーサイズ(横幅)を設定
Statusbar_Sizes[0]=500
Statusbar_Sizes[1]=200
Statusbar_Sizes[2]= -1
SendMessage(hStatusWnd,SB_SETPARTS,3,Statusbar_Sizes)
Dim mdic As MDICREATESTRUCT
mdic.szClass = hright
mdic.szTitle = "title"
mdic.x = mdic.y = mdic.cx = mdic.cy = CW_USEDEFAULT
mdic.style = mdic.lParam = 0
SendMessage(hClient,WM_MDICREATE , 0 , mdic.lParam)
End Sub
Sub MainWnd_Resize(SizeType As Long, cx As Integer, cy As Integer)
Dim buf[20] As Byte
'ステータスバーの大きさを取得
GetWindowRect(hStatusWnd,rect)
StatusHight=rect.bottom-rect.top
'Client Window のサイズ調整
MoveWindow(hClient,0,0,cx,cy-StatusHight,TRUE)
'ステータスバーにサイズ変更情報を送る
SendMessage(hStatusWnd,WM_SIZE,cx,cy)
End Sub
ここまで、ActiveBasicFanさんのと、プラスしてやってたんですがどうしても、子ウインドウが出ません。
どうしてでしょうか?教えてください!
一応、私が役立てているサイトを載せておきます。私が役立てているサイト
-----------------------
AB Ver 4.24