|
-
Oct 20th, 2007, 05:56 PM
#1
Thread Starter
New Member
Icon of currently running programs
Hello,
I am creating a program and would like so somehow be able to get the Icons of all the currently running programs and then place them into an image control that i created in my program.
I can get the name and everything else of all the currently running programs but i am not able to find a way of how to get that icons.
Thanks alot for anyhelp
-
Oct 20th, 2007, 06:03 PM
#2
Re: Icon of currently running programs
Have you tried to use SendMessage API with the WM_GETICON message?
Edited: Another option, probably more in line with what you are asking for.
1. Get the module name that started the process (GetModuleFileNameEx)
2. Then use ExtractAssociatedIcon.
WM_GETICON obviously won't work if there is no window to get an icon from.
Last edited by LaVolpe; Oct 20th, 2007 at 06:55 PM.
-
Oct 21st, 2007, 02:52 PM
#3
Thread Starter
New Member
Re: Icon of currently running programs
Thanks alot for the help, would it be possible to find the file or the file name of the running program?
-
Oct 21st, 2007, 03:42 PM
#4
Re: Icon of currently running programs
You said you have the name for all running programs? If so, then ExtractAssociatedIcon is what you want. If you have the process IDs of all current processes, then use GetModuleFileNameEx to get that name.
-
Oct 27th, 2007, 04:47 PM
#5
Thread Starter
New Member
Re: Icon of currently running programs
Hello, sorry again but im getting quite confused with all these numbers i get, i am able to get the handle to the window, like hwnd, and then i am able to get that process ID using GetWindowThreadProcessId, but GetModuleFileNameEx calls for a handle to the process and a handle to the module, maybe im just missing something but i am getting confused with all the different numbers, maybe i just dont understand it with all the different handles, thanks alot for the help!
-
Oct 27th, 2007, 06:31 PM
#6
Thread Starter
New Member
Re: Icon of currently running programs
Hello, ok sorry about the last post, i finally figured it out, i got it im not sure how but i did, now the only thing is that GetModuleFileNameEx returns a number, the length of the string of the file name, so how could i get the actually file name into a string, so the string would equaly C:/Program Files/ whatever and so on
-
Oct 27th, 2007, 06:33 PM
#7
Re: Icon of currently running programs
Can you share what you are using to get "the names of all the currently running programs"? Your quote from post#1. I assume the icon is the one you want that is associated with the main app (i.e., the one you would see in Explorer for an exe for example). FYI: Not all processes have windows.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|