Solved

CFileDialog derived problem with CK_RETURN : 2

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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Many modern programming languages support the concept of a property -- a class member that combines characteristics of both a data member and a method.  These are sometimes called "smart fields" because you can add logic that is applied automaticall…
Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …
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 learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

744 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now