Click here to Skip to main content
15,890,845 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: assigningn your application to a protocol Pin
David Crow25-Jul-06 3:03
David Crow25-Jul-06 3:03 
AnswerRe: assigningn your application to a protocol Pin
hell_admin26-Jul-06 3:02
hell_admin26-Jul-06 3:02 
You're not so far from the truth
here's result maybe someone needed:
bool SetMoniker()
{

CString url = _T("your protocol");
CString def = _T("URL:someproto"); //can change after URL:

TCHAR app_path[_MAX_PATH+1]=_T("\0");
GetModuleFileName(NULL,app_path,_MAX_PATH);

CString icon(app_path);
icon += _T(",0");
CString command(app_path);
command = _T("\"") + command + _T("\"");
command += _T(" \"%1\"");

HKEY key;
if (ERROR_SUCCESS == RegCreateKeyEx(HKEY_CLASSES_ROOT,_T("someproto"),0,0,REG_OPTION_NON_VOLATILE,KEY_WRITE,0,&key,0))
{
RegSetValueEx(key,_T("URL Protocol"),0,REG_SZ,(BYTE*)url.GetString(),(DWORD)( url.GetLength()*sizeof (TCHAR)) );
RegSetValueEx(key,NULL,0,REG_SZ,(BYTE*)def.GetString(),(DWORD)( def.GetLength()*sizeof (TCHAR)) );
HKEY icon_key;
if( ERROR_SUCCESS == RegCreateKeyEx(key,_T("DefaultIcon"),0,0,REG_OPTION_NON_VOLATILE,KEY_WRITE,0,&icon_key,0))
{
RegSetValueEx(icon_key,NULL,0,REG_SZ,(BYTE*)icon.GetString(),(DWORD)( icon.GetLength()*sizeof (TCHAR)) );
RegCloseKey(icon_key);
}

HKEY com;
if( ERROR_SUCCESS == RegCreateKeyEx(key,_T("shell\\open\\command"),0,0,REG_OPTION_NON_VOLATILE,KEY_WRITE,0,&com,0))
{
RegSetValueEx(com,NULL,0,REG_SZ,(BYTE*)command.GetString(),(DWORD)( command.GetLength()*sizeof (TCHAR)));
RegCloseKey(com);
}

RegCloseKey(key);
return true;
}
return false;
}
QuestionWMA To WAV Pin
yhl2ws24-Jul-06 23:53
yhl2ws24-Jul-06 23:53 
AnswerRe: WMA To WAV Pin
toxcct25-Jul-06 0:01
toxcct25-Jul-06 0:01 
GeneralRe: WMA To WAV Pin
ThatsAlok25-Jul-06 0:34
ThatsAlok25-Jul-06 0:34 
GeneralRe: WMA To WAV Pin
Hamid_RT25-Jul-06 2:35
Hamid_RT25-Jul-06 2:35 
GeneralRe: WMA To WAV Pin
toxcct25-Jul-06 2:40
toxcct25-Jul-06 2:40 
QuestionBlocking Pin
tanarnelinistit24-Jul-06 23:30
tanarnelinistit24-Jul-06 23:30 
AnswerRe: Blocking Pin
_AnsHUMAN_ 24-Jul-06 23:32
_AnsHUMAN_ 24-Jul-06 23:32 
GeneralRe: Blocking Pin
tanarnelinistit24-Jul-06 23:34
tanarnelinistit24-Jul-06 23:34 
GeneralRe: Blocking Pin
_AnsHUMAN_ 25-Jul-06 0:05
_AnsHUMAN_ 25-Jul-06 0:05 
AnswerRe: Blocking Pin
Eytukan25-Jul-06 0:30
Eytukan25-Jul-06 0:30 
GeneralRe: Blocking Pin
tanarnelinistit25-Jul-06 0:36
tanarnelinistit25-Jul-06 0:36 
GeneralRe: Blocking Pin
Eytukan25-Jul-06 1:05
Eytukan25-Jul-06 1:05 
QuestionRe: Blocking Pin
tanarnelinistit25-Jul-06 1:23
tanarnelinistit25-Jul-06 1:23 
AnswerRe: Blocking Pin
Eytukan25-Jul-06 1:28
Eytukan25-Jul-06 1:28 
QuestionRe: Blocking Pin
tanarnelinistit25-Jul-06 1:44
tanarnelinistit25-Jul-06 1:44 
AnswerRe: Blocking Pin
Eytukan25-Jul-06 3:44
Eytukan25-Jul-06 3:44 
GeneralRe: Blocking Pin
ThatsAlok25-Jul-06 1:26
ThatsAlok25-Jul-06 1:26 
AnswerRe: Blocking Pin
David Crow25-Jul-06 3:06
David Crow25-Jul-06 3:06 
AnswerRe: Blocking Pin
earl25-Jul-06 4:24
earl25-Jul-06 4:24 
QuestionImage Processing using visual c++ Pin
Cassiopeiaxy24-Jul-06 23:25
Cassiopeiaxy24-Jul-06 23:25 
AnswerRe: Image Processing using visual c++ Pin
ashwath200524-Jul-06 23:48
ashwath200524-Jul-06 23:48 
AnswerRe: Image Processing using visual c++ Pin
normanS25-Jul-06 0:50
normanS25-Jul-06 0:50 
AnswerRe: Image Processing using visual c++ Pin
Farhat Aisha25-Jul-06 3:33
Farhat Aisha25-Jul-06 3:33 

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.