on Wed, 26 Sep
> 2007 15:16:42 -0700
>
> > Not quite true. All of the interesting creation code is in notebook.c.
> > Start with CfgDlgProc(). The trivial part is in mainwnd.c. It is just
>
> I now know what I am doing wrong. The "Presentation Manager Programming Guide
> and Reference" and the sample code I found on the internet lead me in the wrong
> direction. Both the sample code and the programming guide use WinCreateWindow
> to create the notebook window. I could not make it work and I guess it will
> not work without a lot of extra code. So I will change my code to use a dialog.
>
>
See my previous post first. That was my original question.
If you are going to create the notebook using WinCreateWindow, you probably should look into WinSubclassWindow. All of the events that are handled for you when in a dialog box, you would need to handle on your own if you place it on the client window.
The reason why the notebook didn't repaint is because the WM_PAINT message in your WindowProc from the WinCreateWindow call wasn't passing the message to the default handler for the notebook control.
You could in your WM_PAINT message of the WindowProc, take the window handle of the notebook returned from WinCreateWindow, and just before you return FALSE, do a WinDefWindowProc() call with the handle of the notebook control.
But you should also have to do that with your WM_CONTROL, WM_COMMAND, WM_SIZE and any other message that you handle in your WindowProc that doesn't get handled by WM_DEFAULT.
Oh you should also put a WinDefWindowProc() with the handle of the notebook control in the WM_DEFAULT message also. You would need some type of statement to weed out the messages of the client window, so both messages don't end up getting passed to the notebook control. Something like in the WM_DEFAULT message:
WM_DEFAULT:
WinDefWindowProc(hWnd, iMsg, mp1, mp2);
if (hWnd == hWndNotebook)
WinDefWindowProc(hWndNotebook, iMsg, mp1, mp2);
break;
But, if you subclass the notebook control as in, your WM_INIT message of the WindowProc that you defined in the WinCreateWindow, call WinSubclassWindow(handle of notebook control, MyNotebookControlProc).
Then
HWND MyNotebookControlProc(HWND hWnd, int iMsg, ULONG mp1, ULONG mp2)
{
select (iMSG)
{
case WM_DEFAULT:
WinDefWindowProc(hWnd, iMsg, mp1, mp2);
break;
}
return FALSE;
}
That should take care of most of the default functions of notebook and it should act like it was in a dialog box except that it is now placed on the client window.
Nathan
=====================================================
To unsubscribe from this list, send an email message
to "steward@scoug.com". In the body of the message,
put the command "unsubscribe scoug-programming".
For problems, contact the list owner at
"postmaster@scoug.com".
=====================================================
<< Previous Message <<
>> Next Message >>
Return to [ 27 |
September |
2007 ]
The Southern California OS/2 User Group
P.O. Box 26904
Santa Ana, CA 92799-6904, USA
Copyright 2001 the Southern California OS/2 User Group. ALL RIGHTS
RESERVED.
SCOUG, Warp Expo West, and Warpfest are trademarks of the Southern California OS/2 User Group.
OS/2, Workplace Shell, and IBM are registered trademarks of International
Business Machines Corporation.
All other trademarks remain the property of their respective owners.