Using shortcut keys in property pages containg property pages | CodeGuru

Using shortcut keys in property pages containg property pages

 Download Source Code and Example Accessing a sub page within a property page with shortcut keys needs special treatment. I used Zafirs source from his article Using shortcut keys in property pages as a starting point. To make sure that a key stroke reaches any of the sub pages I am checking the key in […]

Written By
CodeGuru Staff
CodeGuru Staff
Apr 4, 1999
1 minute read
CodeGuru content and product recommendations are editorially independent. We may make money when you click on links to our partners. Learn More

 Download Source Code and Example

Accessing a sub page within a property page with shortcut keys needs special treatment. I used Zafirs source
from his article Using shortcut keys in property pages as a starting point. To
make sure that a key stroke reaches any of the sub pages I am checking the key in the PreTranslateMessage of the
Dialog first. If the key is not one of the upper pages I am sending the message to the sheet of the sub pages.
If the key is not found it is finally swollen by the IsDialogMessage function.

If a subpage has the focus and an ALT + key combination is pressed and the key belongs to an upper page the
sub page has to make sure that the key is send back by calling:

return(GetParent()->GetParent()->PreTranslateMessage(pMsg));

This expression assures that always another sheet or the dialog is reached. To directly change the main page
from a sub page (e.g. switching from subpage 2 of page 1 to page 2) the key passes the PreTranslateMessage of the
sub page is then passed to the PreTranslateMessage of the page, which contains the sub page, who finally sends it
to the PreTranslateMessage function of the Dialog where it is translated ! uff.. 😉

The code is not perfect but you will get my drift..

Last updated: 09/13/98

CodeGuru Logo

CodeGuru covers topics related to Microsoft-related software development, mobile development, database management, and web application programming. In addition to tutorials and how-tos that teach programmers how to code in Microsoft-related languages and frameworks like C# and .Net, we also publish articles on software development tools, the latest in developer news, and advice for project managers. Cloud services such as Microsoft Azure and database options including SQL Server and MSSQL are also frequently covered.

Property of TechnologyAdvice. © 2026 TechnologyAdvice. All Rights Reserved

Advertiser Disclosure: Some of the products that appear on this site are from companies from which TechnologyAdvice receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. TechnologyAdvice does not include all companies or all types of products available in the marketplace.