Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

CFileDialog derived problem with CK_RETURN : 2

Posted on 1998-04-22
5
Medium Priority
?
252 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
  • 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 200 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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 clear a vector as well as how to detect empty vectors in C++.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

782 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