Click here to Skip to main content
15,887,135 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
SuggestionRe: Multiple selection on Tree Control Pin
David Crow21-Apr-14 5:10
David Crow21-Apr-14 5:10 
GeneralRe: Multiple selection on Tree Control Pin
dliviu21-Apr-14 23:53
dliviu21-Apr-14 23:53 
GeneralRe: Multiple selection on Tree Control Pin
dliviu22-Apr-14 1:28
dliviu22-Apr-14 1:28 
GeneralRe: Multiple selection on Tree Control Pin
Mohsin Munawar22-Apr-14 23:34
Mohsin Munawar22-Apr-14 23:34 
GeneralRe: Multiple selection on Tree Control Pin
dliviu23-Apr-14 1:09
dliviu23-Apr-14 1:09 
GeneralRe: Multiple selection on Tree Control Pin
dliviu6-May-14 1:08
dliviu6-May-14 1:08 
GeneralRe: Multiple selection on Tree Control Pin
Mohsin Munawar6-May-14 17:35
Mohsin Munawar6-May-14 17:35 
QuestionHow to write registry after log in windows with mfc? Pin
cedricvictor17-Apr-14 22:48
cedricvictor17-Apr-14 22: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 22:57
professionalJochen Arndt17-Apr-14 22:57 
GeneralRe: How to write registry after log in windows with mfc? Pin
cedricvictor17-Apr-14 23:45
cedricvictor17-Apr-14 23:45 
QuestionRe: How to write registry after log in windows with mfc? Pin
David Crow18-Apr-14 3:15
David Crow18-Apr-14 3:15 
AnswerRe: How to write registry after log in windows with mfc? Pin
cedricvictor18-Apr-14 5:34
cedricvictor18-Apr-14 5:34 
GeneralRe: How to write registry after log in windows with mfc? Pin
David Crow18-Apr-14 6:47
David Crow18-Apr-14 6:47 
GeneralRe: How to write registry after log in windows with mfc? Pin
Heng Xiangzhong21-Apr-14 15:10
Heng Xiangzhong21-Apr-14 15:10 
GeneralRe: How to write registry after log in windows with mfc? Pin
David Crow21-Apr-14 17:01
David Crow21-Apr-14 17:01 
GeneralRe: How to write registry after log in windows with mfc? Pin
Heng Xiangzhong21-Apr-14 17:10
Heng Xiangzhong21-Apr-14 17:10 
QuestionCMap oject copy operation Pin
econy17-Apr-14 4:58
econy17-Apr-14 4:58 
SuggestionRe: CMap oject copy operation Pin
Richard MacCutchan17-Apr-14 5:32
mveRichard MacCutchan17-Apr-14 5:32 
AnswerRe: CMap oject copy operation Pin
CPallini17-Apr-14 7:06
mveCPallini17-Apr-14 7:06 
QuestionWhat are these files in folders of this os? Pin
johan1111117-Apr-14 0:54
johan1111117-Apr-14 0:54 
QuestionRe: What are these files in folders of this os? Pin
Richard MacCutchan17-Apr-14 5:30
mveRichard MacCutchan17-Apr-14 5:30 
AnswerRe: What are these files in folders of this os? Pin
johan1111117-Apr-14 7:03
johan1111117-Apr-14 7:03 
QuestionBuffer overrun at _CRT_DEBUGGER_HOOK in dbghook.c (using log4cxx) Pin
Dropkicked Murphy16-Apr-14 2:59
Dropkicked Murphy16-Apr-14 2:59 
SuggestionRe: Buffer overrun at _CRT_DEBUGGER_HOOK in dbghook.c (using log4cxx) Pin
Richard MacCutchan16-Apr-14 5:33
mveRichard MacCutchan16-Apr-14 5:33 
GeneralRe: Buffer overrun at _CRT_DEBUGGER_HOOK in dbghook.c (using log4cxx) Pin
Dropkicked Murphy16-Apr-14 8:51
Dropkicked Murphy16-Apr-14 8: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.