? Reading icon from (EXE/DLL) file and displaying in list control

    Hi,

    I've got a list control and some filenames.  The filenames refer to EXEs
and DLLs.  I need to extract an/the main icon from the file and display it
in the list control.  Unfortunately this is beyond what I have done so far.
I'm hoping someone can help me out with some code.

    Can anyone help?

    Thanks a lot.

--
Alec S.
alec <@> synetech <.> cjb <.> net



0
Alec
9/17/2004 8:05:59 PM
vc.mfc 33608 articles. 0 followers. Follow

5 Replies
678 Views

Similar Articles

[PageSpeed] 3

You can open the exe/dll in resource editor. It allows you to open these
modules. From there you can extract whatever resources you want.

--
Ajay Kalra [MVP - VC++]
ajaykalra@yahoo.com


"Alec S." <a@a.com> wrote in message
news:eRS$7GPnEHA.2764@TK2MSFTNGP10.phx.gbl...
>     Hi,
>
>     I've got a list control and some filenames.  The filenames refer to
EXEs
> and DLLs.  I need to extract an/the main icon from the file and display it
> in the list control.  Unfortunately this is beyond what I have done so
far.
> I'm hoping someone can help me out with some code.
>
>     Can anyone help?
>
>     Thanks a lot.
>
> --
> Alec S.
> alec <@> synetech <.> cjb <.> net
>
>
>


0
ajaykalra (6841)
9/18/2004 5:37:52 AM
Hi Alec,

If you want to retrieve the icon from EXE/DLL file in your program, you can 
use the ExtractIcon function:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/WinUI
/WindowsUserInterface/Resources/Icons/IconReference/IconFunctions/ExtractIco
n.asp

By the way the following newsgroup threads have some code snippet on this 
issue:
http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&c2coff=1&threadm=3c31df1b
_1%40dnews&rnum=5&prev=/groups%3Fq%3DExtractIcon%26hl%3Den%26lr%3D%26ie%3DUT
F-8%26c2coff%3D1%26selm%3D3c31df1b_1%2540dnews%26rnum%3D5

http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&c2coff=1&threadm=343CF207
.D5979E34%40ced.tuc.gr&rnum=31&prev=/groups%3Fq%3DExtractIcon%26hl%3Den%26lr
%3D%26ie%3DUTF-8%26c2coff%3D1%26start%3D30%26sa%3DN


Wish it helps!

Best regards,

Gary Chang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------

0
v-garych (605)
9/18/2004 6:46:58 AM
    I checked it out and I can get one of the file icons into the list
control but all of the items in it have the same one icon.  I can't seem to
find any helpful information on the proper setup and use of imagelists with
list controls.


--
Alec S.
alec <@> synetech <.> cjb <.> net


""Gary Chang"" <v-garych@online.microsoft.com> wrote in message
news:G6UbStUnEHA.3212@cpmsftngxa06.phx.gbl...
> If you want to retrieve the icon from EXE/DLL file in your program, you
can
> use the ExtractIcon function:
>
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/WinUI
>
/WindowsUserInterface/Resources/Icons/IconReference/IconFunctions/ExtractIco
> n.asp


0
Alec
9/18/2004 8:16:12 AM
Hi Alec,

When you have a valid imagelist attached to your list control, you can 
specify the different images for each item:
LVITEM lvi;
...
lvi.iImage = imageIdx;     // specify the image index for the new item
...
m_cListCtrl.InsertItem(&lvi);
...

please refer to the following sample program link:
http://www.codeproject.com/listctrl/listctrldemo.asp


Thanks!

Best regards,

Gary Chang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------

0
v-garych (605)
9/18/2004 9:28:54 AM
    AHA!  I knew you had to actually do something with the list control,
that you can't just use SetImageList.  In all the examples they just use
SetImageList and that's it, so it looks automatic.  It works now thanks.

    Now the only thing I need to do is to find a way to convert binary data
read from the registry into an icon...



--
Alec S.
alec <@> synetech <.> cjb <.> net


""Gary Chang"" <v-garych@online.microsoft.com> wrote in message
news:s9B7tHWnEHA.740@cpmsftngxa06.phx.gbl...
> When you have a valid imagelist attached to your list control, you can
> specify the different images for each item:
> LVITEM lvi;
> ..
> lvi.iImage = imageIdx;     // specify the image index for the new item
> ..
> m_cListCtrl.InsertItem(&lvi);
> ..
>
> please refer to the following sample program link:
> http://www.codeproject.com/listctrl/listctrldemo.asp


0
Alec
9/18/2004 6:01:50 PM
Reply:

Similar Artilces:

Inserting text from a .txt file
I'm trying really hard to jump on the bandwagon and migrate from Outlook Express to Outlook, but the more I try, the more frustrated I get. Anyway, here is my question: How do I insert the text from a text file into my e-mail document. I am using the rtf editor. thank you, ~alan copy/paste? "~~Alan~~" <alan.shepro_NOSPAM@verizon.net> wrote in message news:%23%23AwZrIKEHA.1264@TK2MSFTNGP12.phx.gbl... > I'm trying really hard to jump on the bandwagon and migrate from Outlook > Express to Outlook, but the more I try, the more frustrated I get. > > Anywa...

Reading .wks file
Greetings...according to the Excel "help" file, as well as the file extension listing, I *should* be able to read an *.wks file, but Excel insists that it cannot. I am pretty sure the file was created in Microsoft Works. Is there a converter somewhere that I can download/install? Cheers - S2 Excel can read Works 2.0, not later. You have to save them in Works as excel files or Works 2.0 or get a commercial converter. -- Regards, Peo Sjoblom "Skip Stocks" <anonymous@discussions.microsoft.com> wrote in message news:AFC110E0-641D-4D87-9464-B930CC41CF02@microsoft....

xml config file...
hello, I ve a Windowsapplication with a configuration file app.config... (it's in xml) code app.config: <?xml version="1.0" encoding="utf-8" ?> <configuration> <configSections> <section name = "MyNameValueSection" type="System.Configuration.NameValueSectionHandler" /> </configSections> <MyNameValueSection> <add key="MyKey" value="MyValue" /> </MyNameValueSection> <appSettings> <add key="test" value="MeinInhalt" /> </appSettings> </configurati...

Different spaces between bullet points in same bullet list
I have a bullet list with some bullet items. Some of the items have different spaces between the bullets. Meaning the line spacing between the bullets are not all the same. Some are wider. I have formatting marks showing and I don't see anything unusual. At the end of each line, there's the carriage return mark. No extra carriage returns or white space between the bullets. The font used across is the same. I adjusted the line spacing for the whole list. I removed and reinitialized the list. Same problem. Any ideas show to fix this? Does the style include "Don'...

path of .pst file
Hello everyone, I want to develop a stand alone application to send and recieve mails through MS Outlook.how can i retrieve the path of .pst file from .net application. actually i am thinking of reading the pst file of MS Outlook. is it possible? Thanks in Advance jyoti The pst file is stored in the profile path of the MSOUTLOK Since the path of the pst can be varied by the user, as can its name, ie it neednt be in the install default path, your app would first have to search for the pst, then you would have to figure out if it/which was the current pst. There are alleged to be third ...

Weird files
Just noticed I've got a ton of weird files with names like 2BE48300. The normal files seem to be ok. Any idea what might be producing all these extra files? -- For a list of all the ways technology has failed to improve the quality of life, please press three. ....Alice Kahn Not sure. Perhaps cleaning up your hard drive will help. http://www.officearticles.com/misc/how_to_clean_up_your_hard_drive.htm Are they Excel files? **************************** Hope it helps! Anne Troy www.OfficeArticles.com **************************** "Steve" <teu@qprc.inv> wrote in message...

"File access denied" to PST file
I have gone from Windows 2000 running Outlook 2000 to Windows XP Pro running Outlook 2003. When I try opening my saved .pst file in the new Outlook I get a message saying "File access denied. You do not have permission required to access to file mailbox.pst" I am logged on as Administrator, as I was on the old install. How do I open my saved mailbox.pst or archive.pst? TIA How did you try opening it? is this a local .pst file? If it is not on your C: drive, is it marked Read-Only? --� Milly Staples [MVP - Outlook] Post all replies to the group to keep the discussion int...

File won't open as read only
I have a file that is in use, but another person opens it and it doeasn't display the "file is in use" message. Is there a setting or fix? Hi have you shared this file? -- Regards Frank Kabel Frankfurt, Germany John wrote: > I have a file that is in use, but another person opens it > and it doeasn't display the "file is in use" message. Is > there a setting or fix? The file is on a network share. The share has all the appropriate permissions. >-----Original Message----- >Hi >have you shared this file? > >-- >Regards >Frank Ka...

Clear/reset the Font dropdown list
Win98se / OfficeXP /Outlook 2002. When replying to e-mails and wanting to select a given font, I must sort through about 12 undesired fonts which populate the Font Dropdown list. How may I clear or reset that list ? Thanks Are these fonts that you previously used or the alphabetical list of fonts? The MRU list can be deleted - it's somewhere in the registry, probably under Word keys. -- Diane Poremsky [MVP - Outlook] Author, Teach Yourself Outlook 2003 in 24 Hours Coauthor, OneNote 2003 for Windows (Visual QuickStart Guide) Need Help with Common Tasks? http://www.outlook-tips.net/...

Delete oldest file first
All, I am looking for some code that deletes the oldest files first in a directory. Any help would be great. Thanks in advance. "karibbean" <sharp_mind@REMOVE.this.email.msn.dotcom> wrote in message news:uJZArpxvFHA.2132@TK2MSFTNGP15.phx.gbl... > I am looking for some code that deletes the oldest files first in a > directory. Any help would be great. Thanks in advance. See FindFirstFile, FindNextFile, FindClose, DeleteFile -- With best wishes, Igor Tandetnik With sufficient thrust, pigs fly just fine. However, this is not necessarily a good idea. It is ...

How to give other users read-only access to Calendar
I want to allow the group Everyone to have read-only access to a calendar in a certain mailbox. I can do this by granting the permission 'Full mailbox access' (under 'Mailbox rights', under 'Exchange Advanced', for the particular user). However this also allows people to to do everything (ie: they become read-write users). I notice that every mailbox in the system has 'Read permissions' granted to group Everyone. This does not allow other people to open items in the mailbox, but as I understand it, permits Exchange Server and Outlook to do shared meetin...

scrambled excel file
Hi AGAIN. I'm trying to open a file that was deleted and later retrieved through GetData Back. It has an .xls extension, but when I try to open it, it's just symbols. Is there some way I can retrieve the proper info. from that file? Do I have to save it as something else? I really need this file back - l mean life & death!! I will attach the file to see if someone can figure this out for me. Thanks again for your help. Your advice last time was great. Sandy Attachment filename: wolf_info liz.xls Download attachment: http://www.excelforum.com/attachment.ph...

Money 2003
Trying to open money 2003 (Windows XP) and when I try to type the password w/ the first key stroke it says error occurred loading the component report.dll. Need to re-install money. I have tried to reinstall w/ the system disks that came w/ my computer and it seems to only let me do a full system restore. I can not find the option to just install one program. Is there any place I can download that file or reinstall from online? Thank you in advance. Do a search on Google. You can find several DLL libraries out there. I just did one and found the "report.dll" file here: ...

Make excel 2003 default to open files
I have Excel 2003 running alongside 2007. Double clicking an excel file causes it to open in 2007; how do I force 2003 to open the files instead? Sandy You most likely have to reset your file association from 2007 to 2003. Close Excel first and On the Windows Taskbar 1) Start>Run "excel.exe /unregserver"(no quotes)>OK. 2) Start>Run "excel.exe /regserver"(no quotes)>OK. See the space between exe and /regserver You might have to designate a full path to excel.exe for Office 2003 In that case Start>Run "C:\your path to\office11\excel.exe" ...

using list or combo boxes
Hello, I have a form with several fields: ID Number, LName, Fname, Employer, Employer1 Depts and Employer2 Depts. I want to enter data in first 3 fields (text) which will be inserted to table 1. I want to select a value from a lookup table for employer. Based on the Employer chosen, either Emp1 depts OR Emp2 depts drop down will become active. Finally, select a dept from the active dropdown. Am I thinking correctly in the following: For the OnChange event when the employer is selected from the dropdown, I want to do this: IF employer = EMP1 then 1.1 enable cboEMP1 ...

Read mail arn't marked as read anymore
After an SP upgrade of my Office 2000 the priviewed mail doesnt get marked as read anymore. I have tried to change the time (Tools->Options->Priview pane) from 2 -> 3 -> 4 seconds but nothing works. The only way to mark a mail as read is either to open it or right click it and chose Mark as read. Since I only use the priview pane this is very anoying for me. Is this a bug or has some setting changed with the SP? ...

reading confirmation
Good day, I have a problem with outlook. When they send a message to me that demands the shipment of a reading confirmation, even if I accept, the reading confirmation does not come received from the sender. Someone knows from what depends and in which way I can resolve the problem? Thanks for the eventual answers. Niki In news:eht7fo$251$1@fata.cs.interbusiness.it, Niki <nicola.pantaleo@yahoo.it> typed: > Good day, > > I have a problem with outlook. When they send a message to me that > demands the shipment of a reading confirmation, even if I accept, the > read...

"Unblock" feature should be optional when reading e-mail in CRM
When viewing e-mail messages in CRM, a line appears saying "Unblock" to allow the full message content to be read. Can this be made a configurable server or security setting? We are trying to reduce "clicks" as much as possible. ---------------- This post is a suggestion for Microsoft, and Microsoft responds to the suggestions with the most votes. To vote for this suggestion, click the "I Agree" button in the message pane. If you do not see the button, follow this link to open the suggestion in the Microsoft Web-based Newsreader and then click "I Agre...

Cannot delete xml file - file based event scheduling
Hi, I have a report scheduled with File based event scheduling in CR XI Server version 11.5. The report is created with XML file as its datasource. The report will be triggered if the event of xml file is created in the source directory. As per the schedule, it will look for the event to occur every 1 minute. Since I need to enerate this report everytime the file comes into the directory, I have to delete the file after he report is generated, so that, next time the file comes in, the report will be generated again. After the report is run for the first time successfuly as the event occurs...

Store.exe #4
Hi All: I have win2k with Ex2k. My exchange is to slow. The store.exe service is utilizing around 700 K. My Priv1.edb is 2.2 gb, Priv.stm is 5.3 gb and Pub1.edb&stm 80, 80 mb. Can i reduce my memory usage. Or there is any other solution . James . Thanks "James" <sudhir.kashyap@pervasiveone.com> wrote in news:elsqRuGKEHA.808 @tk2msftngp13.phx.gbl: > I have win2k with Ex2k. My exchange is to slow. > The store.exe service is utilizing around 700 K. > My Priv1.edb is 2.2 gb, Priv.stm is 5.3 gb > and Pub1.edb&stm 80, 80 mb. Exchange by design will use all...

Previously used file option GONE? help please
Win98SE 'Office XP Pro' In Excel I am unable to find how to enable "open previosly used files" or words to that effect. I have checked in "options" but cannot see it there. When I used it previouly I was able to select the number of files last used, which would be available for me to select when starting EXCEL. TIA Hi do you mean the option in the 'File' menu (at the bottom)? -- Regards Frank Kabel Frankfurt, Germany Terry wrote: > Win98SE > 'Office XP Pro' > > In Excel I am unable to find how to enable "open previosly used...

Utility to list size of attachments
Office 2007 SP2 Windows XP SP3 My goal is to find and delete large attachments from my Outlook.pst file so the pst does not become too large. Is there a utility which will scan through the Outlook.pst file and display a sorted list of attachments by size. I could then delete the emails which have very large attachments. Thanks in advance. A simple google search on the term "Outlook attachments" will result in a wide variety of available 3rd party options. Whether any do exactly what you're asking about in terms of a sorted list is something that you would ...

The memory could not be "read".
I'm at work yesterday afternoon responding to e-mail on my desktop, and Adobe pops up from the toolbar with a notice that there is an update available for Acrobat. I accept the download, keep plugging away at my e-mail, and install it when it's done. It runs through the install, tells me that I should restart, but I ignore it and keep working. It's near the end of the day and I'm going to be going home soon anyways. I forgot to turn it off when I left. Came in this morning, restarted it through the Start menu, and rebooted. Upon reaching the "Ctrl+Alt+Del" ...

Attachments appear as icon
Attachments which I send, appear as an icon within my message area. They used to appear in an attachment bar. What have I changed and how do I reset it Please use "Reply to group" only when replying to this post Thanks Sam I believe that when you attach an item to a new message, it appears as an icon within the message area. However if it is a fwd or reply to a message and you attach something it appears in the attachment bar. Mine has always been that way so I thought that was just the way it was. Good luck :-) >-----Original Message----- >Attachments which I se...

open excel 2007 refresh query from batch file
Hello all, I have a simple script saved as "C:\refresh_excel.vbs" that opens an Excel file, and does a refresh for a query on Sheet 1. I created a scheduled task to run this every day. It worked fine for previous versions of Excel, but since I have upgraded to Excel 2007 it doesn't work. Any help it helping me figure this out would be appreciated. /*contents of refresh_excel.vbs*/ Set objExcel = CreateObject("Excel.Application") objExcel.Visible = True Set objWorkBook = objExcel.Workbooks.Open("C:\reports\UPS.xls") objWorkbook.Sheets("...