Solved

CFileDialog derived problem with CK_RETURN : 2

Posted on 1998-04-22
5
244 Views
Last Modified: 2010-04-10
I have created a class derived from CFileDialog with the OFN_EXPLORER style. This class help me to organise some url shortcut like IE does.
My template has some buttons like "&Move", "&Delete", ...

All works fine but when one of these buttons has the focus
the enter key doesn't call the message handler of the button. However the space key works and the message handler is called.

I don't think that it's due to a default button problem... I already tried. I also tried to handle the WM_GETDLGCODE  message in my buttons and return DLGC_UNDEFPUSHBUTTON but this doesn't work.
 
Can someone  help me !

Thanks a lot.
0
Comment
Question by:gosselin
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 10

Expert Comment

by:RONSLOW
ID: 1163178
What DOES the enter key do then?

0
 

Author Comment

by:gosselin
ID: 1163179
The ENTER key does nothing !
0
 
LVL 10

Accepted Solution

by:
RONSLOW earned 100 total points
ID: 1163180
The enter key is NOT SUPPOED to press a button.  Only the space key.

The UI design guidlines say "In addition, you can use the TAB key and arrow keys to support user navigation to or between command buttons. The SPACEBAR activates a command button if the user moves the input focus to the button."

Also...

"A default push button, on the other hand, is typically used to indicate the most common or default choice. It is a button that the user can select by simply pressing enter when a dialog box has the input focus."



0
 

Author Comment

by:gosselin
ID: 1163181
Alright, but when I move the Focus between my buttons template the only one which has the focus already has on it the default push button style. Even in this way, the enter Key doesn't work.

I would like my CFileDialog derived class owns the same behaviour than The organise favourites under Internet Explorer.
Have a look on it !

Thanks for your help !

0
 
LVL 10

Expert Comment

by:RONSLOW
ID: 1163182
I thought you said you'd turned off the default button handling?

Perhaps you can set BS_NOTIFY style and trap focus changes and when you get a SetFocus for a button, change its style to be the default button (after un-defaulting the previous default button).

But if you haven't stuffed about with the default-button handling, then it seems odd that the enter key doesn't work for the common dialog's standard default button.

0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article is the first in a series of articles about the C/C++ Visual Studio Express debugger.  It provides a quick start guide in using the debugger. Part 2 focuses on additional topics in breakpoints.  Lastly, Part 3 focuses on th…
This article will show you some of the more useful Standard Template Library (STL) algorithms through the use of working examples.  You will learn about how these algorithms fit into the STL architecture, how they work with STL containers, and why t…
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

738 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question