Date: | March 9, 2010 / year-entry #78 |
Tags: | code |
Orig Link: | https://blogs.msdn.microsoft.com/oldnewthing/20100309-00/?p=14673 |
Comments: | 7 |
Summary: | Dialog boxes and property sheets are similar in that most of the time, you use them modally. You call DialogBox or PropertySheet, and the function doesn't return until the user closes the dialog box or property sheet. But you can also use dialog boxes and property sheets modelessly, using CreateDialog or by including the PSH_MODELESS... |
Dialog boxes and property sheets are similar in that most of the time, you use them modally. You call One of the more common problems people have when managing a modeless property sheet is finding that keyboard navigation doesn't work. The reason is the same as with modeless dialog boxes: You forgot to process dialog messages. But if you use the wrong function to process the dialog messages, then you don't get the right behavior. If you get confused and use The other mix-up I've seen is sending the This is simply another case of keeping track of what you're doing and using the mechanism appropriate for what you have. You're already used to doing this in real life: If you travel to Canada and want to buy something from a vending machine, you have to put in Canadian money, not Turkish lira. |
Comments (7)
Comments are closed. |
Unless at some point in time Turkish lira were minted with the same dimensions as a Canadian coin and people began to rely on that implementation detail. then we get stuck having to keep Canadian vending machines backwards compatible with Turkish lira forever…
Keyboard navigation problems or no, I’m still not using any application that has modal dialogs.
@Bob Jones:
Really, you won’t use any application that uses the standard File Open/Save dialog?
Good luck with your development there, buddy!
US coins do usually work in Canadian vending machines… and I’d guess the vendors rely on that compatibility hack to generate a little extra money.
Why doesn’t my property sheet extension work under Vista even though it registers successfully from an elevated cmd prompt?
I’m confused. What happens when you open a property sheet from a modal dialog?
If only the active window got to see all keyboard messages too then you could add the TranslateAccelerator processing to your window procedure, DefDlgProc would call IsDialogMessage, and the property sheet window procedure would call its equivalent, and we wouldn’t have to pollute the message loop. But I guess that’s a baked-in design flaw.
Joseph Bongaarts, we’ve been there, sort of. When you fed a TL1 coin to some vending machines they recognized it as €2 – but it’s only worth about €0.40. Unsurprisingly, backwards compatibility was not maintained.