Solved

CFileDialog derived problem with CK_RETURN : 2

Posted on 1998-04-22
5
243 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 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering 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

Suggested Solutions

Errors will happen. It is a fact of life for the programmer. How and when errors are detected have a great impact on quality and cost of a product. It is better to detect errors at compile time, when possible and practical. Errors that make their wa…
This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
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.

828 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