When the WM_PAINT messages is passed through the DefWindowProc of my child window, The child window closes. I can't draw on the window my self! Any Idea's what the problem could be?
Thanx in advance!
This is a discussion on WM_PAINT through DefWindowProc within the Windows Programming forums, part of the Platform Specific Boards category; When the WM_PAINT messages is passed through the DefWindowProc of my child window, The child window closes. I can't draw ...
When the WM_PAINT messages is passed through the DefWindowProc of my child window, The child window closes. I can't draw on the window my self! Any Idea's what the problem could be?
Thanx in advance!
after using some messageboxes I have found out that my child window resieves infinite number of WM_PAINT messages.
I don't know if I created the window correctly but I think I did. I have a window at the top lwith the minimize etc.. And it has a child window in that child window there is another childwindow. This childwindow is the one that gets infinit of wm_PAINT messages.
Any Idea's will be greatly apreciated.
Thanx in advance!
I created a dll. If I create windows from the dll it doesn't work. But I took all of it and transfered it all to an exe project. Now it works.
Can a dll create a window? If so what changes should I make?
Thanx in advance!
ok heres code
This is for the first child window:
.classex is the wndclassex which gets registered after and class.dwstyle and class.exstyle are for the createwindowex parameters. I spend a while clearing only the inrevelent:
This next piece is for the child window inside the child window above.Code:Class.ClassEx.cbSize = sizeof(WNDCLASSEX); Class.ClassEx.hInstance = g_ins; #ifdef _UNICODE Class.ClassEx.lpszClassName = L"CodeCTRLBASE"; #else Class.ClassEx.lpszClassName = "CodeCTRLBASE"; #endif Class.ClassEx.hbrBackground = NULL; Class.ExStyle = 0; Class.dwStyle = WS_BORDER|WS_CHILD |WS_VISIBLE|WS_CLIPCHILDREN; Class.ClassEx.cbWndExtra = 0; Class.ClassEx.cbClsExtra = 0; Class.ClassEx.hIconSm = 0; Class.ClassEx.lpszMenuName = NULL; Class.ClassEx.style = CS_DBLCLKS; Class.ClassEx.lpfnWndProc = &BasicProc; Class.ClassEx.hIcon = NULL; Class.ClassEx.hCursor = 0;
I did my best in clearing whats not relevent to the creation of the window. Any help would be greatly apreciated.Code:memset(&Class,0, sizeof(CodeClass)); Class.ClassEx.cbSize = sizeof(WNDCLASSEX); Class.ClassEx.hInstance = g_ins; Class.ClassEx.hbrBackground = 0; Class.ExStyle = 0; Class.ClassEx.hCursor = LoadCursor(NULL, RESOURCE(IDC_ARROW)); Class.ClassEx.cbWndExtra = 0; Class.ClassEx.cbClsExtra = 0; Class.ClassEx.hIconSm = 0; Class.ClassEx.lpszMenuName = NULL; Class.ClassEx.style = CS_DBLCLKS; Class.ClassEx.lpfnWndProc = &BasicProc; Class.ClassEx.hIcon = NULL; Class.ClassEx.lpfnWndProc = CodePROC; Class.ClassEx.hbrBackground = 0; #ifdef _UNICODE Class.ClassEx.lpszClassName = L"CodeCTRLFRONT"; #else Class.ClassEx.lpszClassName = "CodeCTRLFRONT"; #endif Class.dwStyle = WS_CHILD| WS_VISIBLE | WS_VSCROLL | WS_HSCROLL; Class.ClassEx.cbSize = sizeof(WNDCLASSEX);
EDIT:
I found out that bitblt or setpixel or other image api's don't work. But the only api that works is TextOut.
Thanx in advance!
Last edited by Benzakhar; 03-07-2004 at 08:15 AM.