Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

CFileDialog derived problem with CK_RETURN : 2

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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Often, when implementing a feature, you won't know how certain events should be handled at the point where they occur and you'd rather defer to the user of your function or class. For example, a XML parser will extract a tag from the source code, wh…
C++ Properties One feature missing from standard C++ that you will find in many other Object Oriented Programming languages is something called a Property (http://www.experts-exchange.com/Programming/Languages/CPP/A_3912-Object-Properties-in-C.ht…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

722 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