Hello I'm making a cd player for windows and I have the option to set it as the default cd player. It works ok when I Click on the CDRom Drive it opens up my cd player. I'm using vista and I want to associate my cd player with the cda extension so when I explorer my cdrom drive I want to see my icon with the cda and beable to click on the cda file and it open with my player. Can someone help me with this. here is my code I am trying to use:
BOOL CALLBACK DlgDefault::OnCommand(int NotifyCode, int ControlID, HWND hWndControl)
{
switch(ControlID) {
case RB_CHAMELEON:
EnableControl(EB_OTHER, FALSE);
break;
case RB_OTHER:
EnableControl(EB_OTHER, TRUE);
break;
case BT_SETDEFAULT:
{
int ret;
if(IsButtonChecked(RB_CHAMELEON) == 1) {
ret = MessageBox(Handle, "Set Creative CD As The Default CD Player ?",
"Set Creative CD As The Default CD Player ?",MB_YESNO | MB_ICONQUESTION);
}
else
ret = MessageBox(Handle, "Set This As The Default CD Player ?",
"Set This As The Default CD Player ?",MB_YESNO | MB_ICONQUESTION);
1. Use code tags. http://www.cplusplus.com/articles/z13hAqkS/
2. It doesn't matter how much code you see out there that uses HKEY_CLASSES_ROOT. It is incorrect. This is a hive deprecated since Windows 95! It is kept for compatiblity with OLD software. NEW software MUST write to the NEW locations: If you want per-user registration, use HKEY_CURRENT_USER\SOFTWARE\Classes instead of HKEY_CLASSES_ROOT; if you want per-machine registration then use HKEY_LOCAL_MACHINE\SOFTWARE\Classes instead of HKEY_CLASSES_ROOT. Note that per-machine registration requires elevation.
3. Objects 'reg' and 'reg2' point to the same registry key. Seems double work.
4. What is the problem, exactly? You say it works, so where do you need help????
I am not sure what you mean by "an example" because I'm not sure what is wrong. You said in your original post that it works. So I guess that is not true from what you are saying now. So I'll start from the fact that the above registration is not working for you. But let me ask you this: Is the registration not working, or is the code above not writing the correct registration?
Show the desired registration keys so I can try to figure out if the code above is producing it or not.
Also note that I don't know the class WRegKey, so I don't think I can write code using it.
Currently busy learning Raw Input from mouse and trying to use it in .Net C#, so I don't think I have the time to check out your project. However, if you post the registry keys that you want to write and show exactly what they need to look like including key values, I can probably tell you if the code above produces it or not.
Also note that I am no expert in file registration. Are you certain that your desired keys would work OK 100%? Have you set the keys manually using the registry editor to verify this?
It would also be good if you verified the keys by comparison. Install some other CD player and see the registration this other CD player injects in the system, and then perform a similar registration yourself.
Hi When I register my cd player using cdrun which is another cdplayer for windows which has a register another player as default option it works. I'll pay you $20.00 if you can help me.
I'm new to forums and don't know how to attach files but I can send you a download link.