Click here to Skip to main content
15,919,931 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Semi Solved Pin
Hamid_RT4-Oct-06 7:56
Hamid_RT4-Oct-06 7:56 
GeneralRe: Semi Solved Pin
Kharfax4-Oct-06 8:00
Kharfax4-Oct-06 8:00 
AnswerRe: How to get en exe default icon Pin
Nisamudheen3-Oct-06 20:26
Nisamudheen3-Oct-06 20:26 
GeneralRe: How to get en exe default icon Pin
Kharfax4-Oct-06 8:04
Kharfax4-Oct-06 8:04 
AnswerRe: How to get en exe default icon Pin
Mark Salsbery4-Oct-06 10:08
Mark Salsbery4-Oct-06 10:08 
AnswerRe: How to get en exe default icon Pin
Mark Salsbery4-Oct-06 10:11
Mark Salsbery4-Oct-06 10:11 
GeneralRe: How to get en exe default icon Pin
Mark Salsbery4-Oct-06 10:12
Mark Salsbery4-Oct-06 10:12 
GeneralRe: How to get en exe default icon Pin
Kharfax5-Oct-06 5:08
Kharfax5-Oct-06 5:08 
Thanks mate, and no problem about the double post.

Yeap that works but I don't know why i have a lot of apps wich fail loading the icon Frown | :(

I post my code, maybe someone sees what im doing wrong

do {<br />
<br />
					imageIndex = 0;<br />
<br />
					keyNameLenght = 256;<br />
<br />
					res = RegEnumKeyEx(phkResult,<br />
									  dwIndex,<br />
									  keyName,<br />
									  &keyNameLenght,<br />
									  NULL,<br />
									  NULL,<br />
									  NULL,<br />
									  NULL);<br />
<br />
					if(res == ERROR_SUCCESS) {<br />
<br />
						// Tomo icono<br />
						// Busco Path en registro<br />
				<br />
						sprintf(lpSubKey2,"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\App Paths\\%s\\", keyName);<br />
  			<br />
						result = RegOpenKeyEx(HKEY_LOCAL_MACHINE,lpSubKey2,NULL,KEY_ALL_ACCESS,&phkResult2);<br />
<br />
						if (ERROR_SUCCESS == result)<br />
						{<br />
							//Levanto Path<br />
							if (ERROR_SUCCESS == RegQueryValue(phkResult2, NULL, path, &largoBuffer)) {<br />
								<br />
								<br />
									CString tup = path;<br />
									HICON temp = NULL;<br />
									HMODULE hMod = NULL;<br />
									int res = 0;<br />
									WORD pis = 0;<br />
<br />
									tup.Remove('"');<br />
<br />
									SHFILEINFO shfi;<br />
									memset(&shfi, 0, sizeof(shfi));<br />
									if (SHGetFileInfo(tup,FILE_ATTRIBUTE_NORMAL,&shfi,sizeof(shfi),SHGFI_ICON | SHGFI_SMALLICON))<br />
									{<br />
										temp = shfi.hIcon;<br />
										imageIndex = m_imageList.Add(temp);<br />
									}<br />
									else {<br />
<br />
										LPTSTR pszExtension = PathFindExtension(tup);<br />
										CString DummyFileName;<br />
										DummyFileName = _T("dummyfile");<br />
<br />
										if (pszExtension[0] == _T('.'))<br />
											DummyFileName += pszExtension;<br />
										else<br />
											DummyFileName += _T(".");<br />
<br />
		<br />
										SHFILEINFO shfi;<br />
										memset(&shfi, 0, sizeof(shfi));<br />
<br />
										if (SHGetFileInfo(keyName,FILE_ATTRIBUTE_NORMAL,&shfi,sizeof(shfi),SHGFI_ICON | SHGFI_SMALLICON | SHGFI_USEFILEATTRIBUTES))<br />
										{<br />
											temp = shfi.hIcon;<br />
										}<br />
<br />
										if(temp != NULL) {<br />
<br />
											imageIndex = m_imageList.Add(temp);<br />
<br />
										}<br />
										else {<br />
<br />
											imageIndex = 0;<br />
<br />
										}<br />
	<br />
									}<br />
																						<br />
							}<br />
<br />
							//Agregar Elemento<br />
<br />
							lvi.mask = LVIF_TEXT | LVIF_IMAGE;<br />
							lvi.iItem = 0;<br />
							lvi.iSubItem = 0;<br />
							lvi.pszText = keyName;<br />
							lvi.iImage = imageIndex;<br />
							m_listOrigin.InsertItem(&lvi);<br />
					<br />
							m_listOrigin.SetItem(&lvi);<br />
							<br />
<br />
						}<br />
<br />
					}<br />
<br />
					dwIndex++;<br />
<br />
				}while(res != ERROR_NO_MORE_ITEMS);

GeneralRe: How to get en exe default icon Pin
Mark Salsbery5-Oct-06 7:16
Mark Salsbery5-Oct-06 7:16 
GeneralRe: How to get en exe default icon Pin
Mark Salsbery5-Oct-06 7:18
Mark Salsbery5-Oct-06 7:18 
GeneralSolved at last :D Pin
Kharfax5-Oct-06 7:43
Kharfax5-Oct-06 7:43 
GeneralRe: Solved at last :D Pin
Mark Salsbery5-Oct-06 8:03
Mark Salsbery5-Oct-06 8:03 
GeneralRe: Solved at last :D Pin
Kharfax5-Oct-06 8:28
Kharfax5-Oct-06 8:28 
QuestionContext help message loop Pin
Vlasta_3-Oct-06 4:36
Vlasta_3-Oct-06 4:36 
AnswerRe: Context help message loop Pin
PJ Arends3-Oct-06 7:55
professionalPJ Arends3-Oct-06 7:55 
GeneralRe: Context help message loop Pin
Vlasta_3-Oct-06 23:14
Vlasta_3-Oct-06 23:14 
Questionsimple question! Pin
orion45003-Oct-06 4:28
orion45003-Oct-06 4:28 
AnswerRe: simple question! Pin
James R. Twine3-Oct-06 6:48
James R. Twine3-Oct-06 6:48 
QuestionRe: simple question! Pin
David Crow3-Oct-06 6:54
David Crow3-Oct-06 6:54 
AnswerRe: simple question! Pin
Hamid_RT4-Oct-06 7:38
Hamid_RT4-Oct-06 7:38 
QuestionDifficult computer science problem Pin
Semion_N3-Oct-06 4:28
Semion_N3-Oct-06 4:28 
AnswerRe: Difficult computer science problem Pin
Chris Losinger3-Oct-06 4:37
professionalChris Losinger3-Oct-06 4:37 
AnswerRe: Difficult computer science problem Pin
toxcct3-Oct-06 4:37
toxcct3-Oct-06 4:37 
QuestionRe: Difficult computer science problem Pin
David Crow3-Oct-06 4:55
David Crow3-Oct-06 4:55 
GeneralRe: Difficult computer science problem Pin
Chris Losinger3-Oct-06 4:38
professionalChris Losinger3-Oct-06 4:38 

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.