listing all the runnable exes

I want to create a menu (much like the start menu) which lists all the registered exes on the computer (and stores the execution path), together with their icons.  It will operate much like a custom start menu.  So i need a bit of code to pull out all the icons, exenames and executable paths for all the registered programs from wherever it all live in the registry.
Who is Participating?
rwilson032697Connect With a Mentor Commented:
You can read the list of registered EXEs from HKEY_LOCAL_MACHINE/software/microsoft/windows/current version/app paths

Each entry is the EXE name, with a default key holding the path and exename and a key 'path' holding just the path to the exe.

You can get the icon from the EXEs like this:

procedure LoadIconFromEXE( ExeName : string; IconIndex: integer);
 var pExeName: pchar;
  // first, make a the EXE name a pchar:
 pExeName := pChar( ExeName );
  // the index of the first icon is 0, so lower iconindex by one.
 IconIndex := IconIndex -1;
  // now extract it.
 Image1.Picture.Icon.Handle := ExtractIcon( HInstance, pExeName, IconIndex);


HeapsterAuthor Commented:
ok that looks fine - thanks raymond.  
HeapsterAuthor Commented:
ok that looks fine - thanks raymond.  
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.