Reputation: 61
i am very new to win32 API coding. Currently i am facing a problem :
I am using turboc++ 4.5 editor.
thanks in advance.
Upvotes: 3
Views: 3357
Reputation: 61
Thanks, problem solved:
LRESULT CALLBACK _export ChildProc( HWND hChild, UINT iMessage, WPARAM wParam,LPARAM lParam )
{
HWND Edit1;
HINSTANCE hInstance1;
PAINTSTRUCT ps;
int nWidth,nHeight;
switch (iMessage)
{
case WM_CREATE :
case WM_SIZE: ''''''mentioned by Jerry Coffin
hInstance1 = GetWindowWord(hChild,GWW_HINSTANCE);
Edit1 = CreateWindow("EDIT","",WS_CHILD|WS_VISIBLE|ES_AUTOHSCROLL|ES_AUTOVSCROLL|ES_MULTILINE|ES_READONLY| WS_VSCROLL|WS_HSCROLL| WS_BORDER,0,0,1000,500,hChild,100,hInstance1,NULL);
nWidth = LOWORD(lParam); /* width */
nHeight = HIWORD(lParam); /* height */
MoveWindow (Edit1,0,0,nWidth,nHeight,1);
ShowWindow(Edit1,SW_SHOWNORMAL);
break;
default :
return DefWindowProc( hChild, iMessage, wParam, lParam );
}
return 0;
}
Upvotes: 3
Reputation: 490128
You'll need to handle the WM_SIZE
message in the MDI child window. When you receive it, you'll want to use MoveWindow
on the text box to resize it to fill the MDI child window.
As an aside: Turbo C++ 4.5? Really? That's...pretty old, to put it mildly. Much more modern tools are freely available.
Upvotes: 2