Click here to Skip to main content
16,012,468 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Edit box string Pin
Ravi Bhavnani26-Aug-03 3:11
professionalRavi Bhavnani26-Aug-03 3:11 
GeneralRe: Edit box string Pin
Andrew Walker26-Aug-03 3:12
Andrew Walker26-Aug-03 3:12 
GeneralRe: Edit box string Pin
Jay Hova26-Aug-03 3:16
Jay Hova26-Aug-03 3:16 
GeneralRe: Edit box string Pin
vcplusplus26-Aug-03 3:28
vcplusplus26-Aug-03 3:28 
GeneralRe: Edit box string Pin
Jay Hova26-Aug-03 3:35
Jay Hova26-Aug-03 3:35 
GeneralRe: Edit box string Pin
vcplusplus26-Aug-03 7:37
vcplusplus26-Aug-03 7:37 
GeneralRe: Edit box string Pin
David Crow26-Aug-03 7:13
David Crow26-Aug-03 7:13 
GeneralHelp me! Please! Pin
Member 50856726-Aug-03 2:55
Member 50856726-Aug-03 2:55 
I want get a associated icon from a file system (for example c:\test.doc") using SHGetFileInfo function and save it in a file (for ex "C:\myicon.ico").
But GlobalSize and GlobalLock returns 0 (invalid value!!!).
I've read an IconPro example (in vs6example.exe) but I didn't found a good solution!
Please give me a good idea!
Tnk you

/******MY CODE*****/

CString nomefile = "c:\\test.doc";
HICON hGen32Icon;
HIMAGELIST hSysImageList;
SHFILEINFO shfi;
int fh;
UINT uiSize;
DWORD dwSize;
LPVOID lpGMem;
OFSTRUCT of;

hSysImageList = (HIMAGELIST)SHGetFileInfo
(nomefile,
0,
&shfi,
sizeof (SHFILEINFO),
SHGFI_SYSICONINDEX | SHGFI_SMALLICON);

hGen32Icon = ImageList_GetIcon (hSysImageList,
shfi.iIcon,
ILD_NORMAL);


dwSize = GlobalSize(hGen32Icon); /*Don't work*/
lpGMem = GlobalLock(hGen32Icon); /*Don't work*/

fh = OpenFile ("c:\\myicon.ico", &of, OF_WRITE | OF_CREATE);
if (fh == -1) // If NOT opened successfully.
{
MessageBox("Unable to create file", NULL, MB_OK );
}

uiSize = _lwrite(fh, (LPSTR)lpGMem, (UINT)dwSize);
_lclose(fh);


QuestionHow to run a script (.vbs) in VC++, Please help .... Pin
Atif Bashir26-Aug-03 2:40
Atif Bashir26-Aug-03 2:40 
AnswerRe: How to run a script (.vbs) in VC++, Please help .... Pin
David Crow26-Aug-03 2:55
David Crow26-Aug-03 2:55 
Generaledit boxs in userdrawn list box control Pin
Chanda.com26-Aug-03 2:16
Chanda.com26-Aug-03 2:16 
QuestionIs is possible to make TransparentBlt without flickering ? Pin
vgrigor26-Aug-03 2:11
vgrigor26-Aug-03 2:11 
AnswerRe: Is is possible to make TransparentBlt without flickering ? Pin
roel_26-Aug-03 3:57
roel_26-Aug-03 3:57 
GeneralRe: Is is possible to make TransparentBlt without flickering ? Pin
vgrigor26-Aug-03 4:42
vgrigor26-Aug-03 4:42 
GeneralRe: Is is possible to make TransparentBlt without flickering ? Pin
l a u r e n26-Aug-03 14:20
l a u r e n26-Aug-03 14:20 
GeneralHelp Saving a drawing piece by piece in XML Pin
lxxrya00126-Aug-03 1:40
lxxrya00126-Aug-03 1:40 
GeneralRe: Help Saving a drawing piece by piece in XML Pin
roel_26-Aug-03 4:00
roel_26-Aug-03 4:00 
QuestionWhat is order of colors in bitmap pixel array? Pin
vgrigor26-Aug-03 1:03
vgrigor26-Aug-03 1:03 
AnswerRe: What is order of colors in bitmap pixel array? Pin
Babayan Hovhannes26-Aug-03 2:06
Babayan Hovhannes26-Aug-03 2:06 
GeneralRe: What is order of colors in bitmap pixel array? Pin
vgrigor26-Aug-03 2:12
vgrigor26-Aug-03 2:12 
GeneralRe: What is order of colors in bitmap pixel array? Pin
Babayan Hovhannes26-Aug-03 2:45
Babayan Hovhannes26-Aug-03 2:45 
GeneralRe: What is order of colors in bitmap pixel array? Pin
roel_26-Aug-03 3:59
roel_26-Aug-03 3:59 
GeneralRe: What is order of colors in bitmap pixel array? Pin
vgrigor26-Aug-03 5:04
vgrigor26-Aug-03 5:04 
GeneralRe: What is order of colors in bitmap pixel array? Pin
roel_26-Aug-03 6:12
roel_26-Aug-03 6:12 
GeneralSimple questions for the experts Pin
NewHSKid26-Aug-03 1:00
NewHSKid26-Aug-03 1:00 

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.