Click here to Skip to main content
15,850,103 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
SuggestionRe: Multiple selection on Tree Control Pin
David Crow21-Apr-14 6:10
David Crow21-Apr-14 6:10 
GeneralRe: Multiple selection on Tree Control Pin
dliviu22-Apr-14 0:53
dliviu22-Apr-14 0:53 
GeneralRe: Multiple selection on Tree Control Pin
dliviu22-Apr-14 2:28
dliviu22-Apr-14 2:28 
GeneralRe: Multiple selection on Tree Control Pin
Mohsin Munawar23-Apr-14 0:34
Mohsin Munawar23-Apr-14 0:34 
GeneralRe: Multiple selection on Tree Control Pin
dliviu23-Apr-14 2:09
dliviu23-Apr-14 2:09 
GeneralRe: Multiple selection on Tree Control Pin
dliviu6-May-14 2:08
dliviu6-May-14 2:08 
GeneralRe: Multiple selection on Tree Control Pin
Mohsin Munawar6-May-14 18:35
Mohsin Munawar6-May-14 18:35 
QuestionHow to write registry after log in windows with mfc? Pin
cedricvictor17-Apr-14 23:48
cedricvictor17-Apr-14 23:48 
Dear all:

I implement a application, when I log in windows, the application will auto

start, and write registry in HKEY_CURRENT_USER,

SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run.

The context of registry is a wav file path.

I put the wav file and the application in the same folder.

My code show as below:

C++
HKEY hKey = HKEY_CURRENT_USER;

TCHAR filePath[MAX_PATH];
TCHAR dirPath[MAX_PATH];

GetCurrentDirectory(MAX_PATH, dirPath);

StringTruncate(filePath, dirPath, "\\Default.wav");

//For ex: filePath may equal C:\abc\123\Default.wav, if my folder path
//is C:\abc\123.

WriteReg(hKey, _T("SOFTWARE\\Microsoft\\Windows\\CurrentVersion"), _T("Sound"), filePath);


My question is:

when I log in windows, the registry value always equal to C:\Windows\system32\Default.wav, Not my folder path.

How can I write the right wav file path after windows log in?

Thanks for your help, Victor.
SuggestionRe: How to write registry after log in windows with mfc? Pin
Jochen Arndt17-Apr-14 23:57
professionalJochen Arndt17-Apr-14 23:57 
GeneralRe: How to write registry after log in windows with mfc? Pin
cedricvictor18-Apr-14 0:45
cedricvictor18-Apr-14 0:45 
QuestionRe: How to write registry after log in windows with mfc? Pin
David Crow18-Apr-14 4:15
David Crow18-Apr-14 4:15 
AnswerRe: How to write registry after log in windows with mfc? Pin
cedricvictor18-Apr-14 6:34
cedricvictor18-Apr-14 6:34 
GeneralRe: How to write registry after log in windows with mfc? Pin
David Crow18-Apr-14 7:47
David Crow18-Apr-14 7:47 
GeneralRe: How to write registry after log in windows with mfc? Pin
Heng Xiangzhong21-Apr-14 16:10
Heng Xiangzhong21-Apr-14 16:10 
GeneralRe: How to write registry after log in windows with mfc? Pin
David Crow21-Apr-14 18:01
David Crow21-Apr-14 18:01 
GeneralRe: How to write registry after log in windows with mfc? Pin
Heng Xiangzhong21-Apr-14 18:10
Heng Xiangzhong21-Apr-14 18:10 
QuestionCMap oject copy operation Pin
econy17-Apr-14 5:58
econy17-Apr-14 5:58 
SuggestionRe: CMap oject copy operation Pin
Richard MacCutchan17-Apr-14 6:32
mveRichard MacCutchan17-Apr-14 6:32 
AnswerRe: CMap oject copy operation Pin
CPallini17-Apr-14 8:06
mveCPallini17-Apr-14 8:06 
QuestionWhat are these files in folders of this os? Pin
johan1111117-Apr-14 1:54
johan1111117-Apr-14 1:54 
QuestionRe: What are these files in folders of this os? Pin
Richard MacCutchan17-Apr-14 6:30
mveRichard MacCutchan17-Apr-14 6:30 
AnswerRe: What are these files in folders of this os? Pin
johan1111117-Apr-14 8:03
johan1111117-Apr-14 8:03 
QuestionBuffer overrun at _CRT_DEBUGGER_HOOK in dbghook.c (using log4cxx) Pin
Dropkicked Murphy16-Apr-14 3:59
Dropkicked Murphy16-Apr-14 3:59 
SuggestionRe: Buffer overrun at _CRT_DEBUGGER_HOOK in dbghook.c (using log4cxx) Pin
Richard MacCutchan16-Apr-14 6:33
mveRichard MacCutchan16-Apr-14 6:33 
GeneralRe: Buffer overrun at _CRT_DEBUGGER_HOOK in dbghook.c (using log4cxx) Pin
Dropkicked Murphy16-Apr-14 9:51
Dropkicked Murphy16-Apr-14 9:51 

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.