[CODE=c]
HWND gEditBox;
int APIENTRY WinMain(....)
{
HWND hWnd;
...
...
...
WNDCLASSEX wcex;
wcex.style = CS_HREDRAW | CS_VREDRAW;
..
..
..
// Main Window
hWnd = CreateWindow(sz WindowClass, szTitle, WS_OVERLAPPEDWI NDOW,CW_USEDEFA ULT, 0, CW_USEDEFAULT, 0, NULL, NULL, hInstance, NULL);
..
..
}
LRESULT CALLBACK WinProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
switch(msg)
{
case WM_CREATE:
RECT rect;
GetClientRect(h Wnd, &rect);
// Creating Edit Box
gEditBox = CreateWindow("E DIT", NULL, WS_CHILD | WS_HSCROLL |
WS_VSCROLL | WS_VISIBLE | ES_AUTOHSCROLL | ES_AUTOVSCROLL | ES_WANTRETURN | ES_MULTILINE | ES_LEFT | ES_NOHIDESEL, 0, 0, rect.right, rect.bottom, hWnd, (HMENU)IDC_TEXT PAD, ((LPCREATESTRUC T)lParam)->hInstance, NULL);
beak;
case WM_COMMAND:
wmId = LOWORD(wParam);
wmEvent = HIWORD(wParam);
switch(wmId)
{
...
...
..
}
}
[/CODE]
I have created an Edit box through Createwindow() as the WinProc recieves the WM_CREATE message
Now everything is working fine but except that when i maximise my parent window or resize it the edit box fails to do so though it is declared a child window.
How could i fix this?
if my problem is not understood should i post the entire code here for better analysis...
HWND gEditBox;
int APIENTRY WinMain(....)
{
HWND hWnd;
...
...
...
WNDCLASSEX wcex;
wcex.style = CS_HREDRAW | CS_VREDRAW;
..
..
..
// Main Window
hWnd = CreateWindow(sz WindowClass, szTitle, WS_OVERLAPPEDWI NDOW,CW_USEDEFA ULT, 0, CW_USEDEFAULT, 0, NULL, NULL, hInstance, NULL);
..
..
}
LRESULT CALLBACK WinProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
switch(msg)
{
case WM_CREATE:
RECT rect;
GetClientRect(h Wnd, &rect);
// Creating Edit Box
gEditBox = CreateWindow("E DIT", NULL, WS_CHILD | WS_HSCROLL |
WS_VSCROLL | WS_VISIBLE | ES_AUTOHSCROLL | ES_AUTOVSCROLL | ES_WANTRETURN | ES_MULTILINE | ES_LEFT | ES_NOHIDESEL, 0, 0, rect.right, rect.bottom, hWnd, (HMENU)IDC_TEXT PAD, ((LPCREATESTRUC T)lParam)->hInstance, NULL);
beak;
case WM_COMMAND:
wmId = LOWORD(wParam);
wmEvent = HIWORD(wParam);
switch(wmId)
{
...
...
..
}
}
[/CODE]
I have created an Edit box through Createwindow() as the WinProc recieves the WM_CREATE message
Now everything is working fine but except that when i maximise my parent window or resize it the edit box fails to do so though it is declared a child window.
How could i fix this?
if my problem is not understood should i post the entire code here for better analysis...
Comment