Win32libEx -- Richedit, common controls and MDI
- Posted by Matthew Lewis <MatthewL at KAPCOUSA.COM> Jul 31, 2000
- 419 views
First, some old business: I have a little bug fix (thanks to Lee West). The find/replace dialog won't find multiple instances of text when you click on the find next button. There's a simple fix: you need to change a line in getIndex(): msg = fetch( CR, CHARRANGE_cpMin ) + 1 should be: msg = fetch( CR, CHARRANGE_cpMax ) + 1 This will, of course, be fixed in my next release, but it's pretty simple. Lee also asked about giving the dialog focus. Just remove the setFocus() call in the demo, and focus will automatically be given to the find/replace dialog. Now, some new: I've been trying to wrap other common controls (month calendar and rebar), but am having problems in creating them. CreateWindowEx won't create them properly. I've checked my version of the dll, and it seems to be fine, and I should be using the proper flags in InitCommonControls, but I can't get the darn things to show up! Does anyone have any ideas? I've looked at MSDN to see if there are some special things you need to do, but can't find anything that should have such an effect. I don't know if anyone's worked with any of these, but if anyone has any ideas, I'd really appreciate it! Also, I'd be interested if anyone can shed some light on this: I've been looking into MDI (multiple document interface) apps. First, some of the differences with SDI (single DI): Windows uses DefFrameProc and DefMDIChildProc instead of DefWinProc. It also adds some calls in the main event loop. I found that the order of params listed in the win32 help file was incorrect for DefFrameProc. They were listed: hWnd, hMDIChild, uMsg, wParam, lParam. But hMDIChild and uMsg should be reversed. Furthermore, DefFrameProc wouldn't return TRUE when WM_NCCREATE was sent. I short circuited this in FrameProc(), and it creates the window all right, but then doesn't paint anything. I have no idea why any of this happens the way it does, although I suspect that the paint issue may be in my handling of the client window. I don't think I have that quite right, so that may resolve itself. I haven't tried to manually paint anything, so I really don't know where the problem is on this one. We'll see... Matt Lewis PS Keep the feedback coming!