i am very new to win32 API coding. Currently i am facing a problem :
I am using turboc++ 4.5 editor.
thanks in advance.
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;
}
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With