about path
-
i can use the following get the notepad icon from other program,and draw the icon on my view. (1)if( :: SHGetFileInfo(_T("c:\\windows\\notepad.exe"),0, &stFileInfo,sizeof(stFileInfo),SHGFI_ICON)) {pDC ->DrawIcon(10,10,stFileInfo.hIcon); } but i want to use GetWindowsDirectory() first windows directory "c:\\windows" ,then i combine the windows path with "notepad.exe",by using the string operator "+",now i get str,if in console ,use cout<
-
i can use the following get the notepad icon from other program,and draw the icon on my view. (1)if( :: SHGetFileInfo(_T("c:\\windows\\notepad.exe"),0, &stFileInfo,sizeof(stFileInfo),SHGFI_ICON)) {pDC ->DrawIcon(10,10,stFileInfo.hIcon); } but i want to use GetWindowsDirectory() first windows directory "c:\\windows" ,then i combine the windows path with "notepad.exe",by using the string operator "+",now i get str,if in console ,use cout<
vividtang wrote: ...but i want to use GetWindowsDirectory() first windows directory "c:\\windows" ,then i combine the windows path with "notepad.exe Read the second part of my response here. It's not a good idea to assume that notepad.exe resides in any directory, or even exists for that matter. Without knowing more of what you are doing, I'm inclined to think that
FindExecutable()
(orAssocQueryString()
) might be a better choice for what you want.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
-
vividtang wrote: ...but i want to use GetWindowsDirectory() first windows directory "c:\\windows" ,then i combine the windows path with "notepad.exe Read the second part of my response here. It's not a good idea to assume that notepad.exe resides in any directory, or even exists for that matter. Without knowing more of what you are doing, I'm inclined to think that
FindExecutable()
(orAssocQueryString()
) might be a better choice for what you want.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
DavidCrow wrote: Without knowing more of what you are doing, I'm inclined to think that FindExecutable() (or AssocQueryString()) might be a better choice for what you want. oh, nice, I learned something today ... !!!! Thanks ...
Maximilien Lincourt Your Head A Splode - Strong Bad