반응형
public void SetAssociationIcon(string fileExtention, string progid, string iconFullPath)
{
fileExtention = "." + fileExtention;
Registry.ClassesRoot.CreateSubKey(fileExtention).SetValue("", progid);
Registry.ClassesRoot.CreateSubKey(progid).CreateSubKey("DefaultIcon").SetValue("", iconFullPath);
IsNeedRefresh = true;
}
public void SetAssociationExe(string progid, string excuteProgramFullPath)
{
excuteProgramFullPath = excuteProgramFullPath + " \"%1\"";
Registry.ClassesRoot.CreateSubKey(progid).CreateSubKey("shell")
.CreateSubKey("open")
.CreateSubKey("command")
.SetValue("", excuteProgramFullPath);
}
반응형
'[====== Development ======] > C#' 카테고리의 다른 글
[Winform] textbox에 숫자만 입력 되도록 제한하는 코드 (0) | 2021.08.04 |
---|---|
전체 윈도우를 최소화하는 코드 (0) | 2021.08.04 |
[WPF] Application Hosting (0) | 2021.06.14 |
WPF Window Event 발생 순서 (0) | 2021.06.10 |
Registry에 등록된 ActiveX의 파일 경로 가져오기 (0) | 2021.06.07 |