Click here to Skip to main content
15,891,136 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: socket api's recv and UTF-8 Pin
markkuk12-Jul-09 6:41
markkuk12-Jul-09 6:41 
QuestionCreating MODAL Dialog? Pin
dipuks11-Jul-09 8:54
dipuks11-Jul-09 8:54 
GeneralRe: Creating MODAL Dialog? Pin
josda100011-Jul-09 9:02
josda100011-Jul-09 9:02 
AnswerRe: Creating MODAL Dialog? Pin
Stuart Dootson11-Jul-09 9:12
professionalStuart Dootson11-Jul-09 9:12 
AnswerCMFCRibbonStatusBarPane [geeze] Pin
Ed K11-Jul-09 7:58
Ed K11-Jul-09 7:58 
QuestionGet Default shell command Pin
vikrant kpr11-Jul-09 6:18
vikrant kpr11-Jul-09 6:18 
AnswerRe: Get Default shell command Pin
Stuart Dootson11-Jul-09 6:37
professionalStuart Dootson11-Jul-09 6:37 
AnswerRe: Get Default shell command Pin
«_Superman_»11-Jul-09 16:34
professional«_Superman_»11-Jul-09 16:34 
As Stuart said, you probably just want to execute the file using ShellExecute.

The command for the default operation is stored in the registry.
You should be able to read it for most of the file types.
There is no guarantee that all file types have this information.
Here goes -

Open the HKEY_CLASSES_ROOT registry key.
This hive will have a subkey with the extension of a file like .txt or .cpl
The default value of this key will contain another value like txtfile for .txt files and cplfile for .cpl files.
The HKEY_CLASSES_ROOT key also has subkeys with these values like txtfiles and cplfiles.
These subkeys in-turn will have a subkey called shell.
The subkeys of shell contain the names of the supported commands like Open, Runas etc.
Each of these keys contain a subkey called command whose default value is the actual command that is executed.

«_Superman
I love work. It gives me something to do between weekends.

GeneralRe: Get Default shell command Pin
vikrant kpr11-Jul-09 17:10
vikrant kpr11-Jul-09 17:10 
GeneralRe: Get Default shell command Pin
«_Superman_»11-Jul-09 17:16
professional«_Superman_»11-Jul-09 17:16 
GeneralRe: Get Default shell command Pin
vikrant kpr11-Jul-09 20:07
vikrant kpr11-Jul-09 20:07 
GeneralRe: Get Default shell command Pin
«_Superman_»11-Jul-09 20:10
professional«_Superman_»11-Jul-09 20:10 
GeneralRe: Get Default shell command Pin
vikrant kpr11-Jul-09 20:22
vikrant kpr11-Jul-09 20:22 
GeneralRe: Get Default shell command Pin
vikrant kpr11-Jul-09 20:24
vikrant kpr11-Jul-09 20:24 
GeneralRe: Get Default shell command Pin
Rozis11-Jul-09 23:20
Rozis11-Jul-09 23:20 
GeneralRe: Get Default shell command Pin
vikrant kpr13-Jul-09 1:24
vikrant kpr13-Jul-09 1:24 
QuestionShellExecute function? Pin
dipuks11-Jul-09 5:54
dipuks11-Jul-09 5:54 
AnswerRe: ShellExecute function? Pin
Stuart Dootson11-Jul-09 6:06
professionalStuart Dootson11-Jul-09 6:06 
QuestionMFC Exceptions Pin
rrrado11-Jul-09 5:22
rrrado11-Jul-09 5:22 
AnswerRe: MFC Exceptions Pin
Stuart Dootson11-Jul-09 5:36
professionalStuart Dootson11-Jul-09 5:36 
GeneralRe: MFC Exceptions Pin
rrrado11-Jul-09 6:23
rrrado11-Jul-09 6:23 
GeneralRe: MFC Exceptions Pin
Stuart Dootson11-Jul-09 7:20
professionalStuart Dootson11-Jul-09 7:20 
GeneralRe: MFC Exceptions Pin
rrrado11-Jul-09 8:05
rrrado11-Jul-09 8:05 
GeneralRe: MFC Exceptions Pin
rrrado11-Jul-09 9:34
rrrado11-Jul-09 9:34 
GeneralRe: MFC Exceptions Pin
Stuart Dootson11-Jul-09 9:43
professionalStuart Dootson11-Jul-09 9:43 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.