Click here to Skip to main content
15,867,308 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Dear All,

I'm creating a windows application in c#, where automating windows. And I'm trying retrieve all/list of the pinned applications in the taskbar.

What I have tried:

I searched on internet, but I didn't get any suitable solution.

Can anyone please help me.


Thanks in advance.
Posted
Updated 23-May-17 21:49pm

1 solution

Try this:
C#
string path = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), 
                           @"Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar");
string[] files = Directory.GetFiles(path);
foreach (string file in files)
    {
    Console.WriteLine(Path.GetFileNameWithoutExtension(file));
    }
 
Share this answer
 
Comments
abdul subhan mohammed 25-May-17 3:36am    
Thanks OriginalGriff, one more thing, i want to get list of items of the start menu. Could plz help me. I have tried this so far:
string appDataFolder = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);
string startMenuPath = Environment.GetFolderPath(Environment.SpecialFolder.CommonStartMenu);
string startMenuPath1 = Environment.GetFolderPath(Environment.SpecialFolder.CommonStartup);
string startMenuPath3 = Environment.GetFolderPath(Environment.SpecialFolder.StartMenu);
string startMenuPath2 = Environment.GetFolderPath(Environment.SpecialFolder.Startup);

string[] filePaths = Directory.GetFiles(appDataFolder+ "\\Microsoft\\Internet Explorer\\Quick Launch\\User Pinned\\TaskBar", "*.lnk");
string[] csm = Directory.GetFiles(startMenuPath, "*.lnk");
string[] cs = Directory.GetFiles(startMenuPath1, "*.lnk");
string[] s = Directory.GetFiles(startMenuPath2, "*.lnk");
string[] sm = Directory.GetFiles(startMenuPath3 + "\\Programs", "*.lnk");

I'm using windows 8.1, as soon as i press win key: what are the items shows on the start menu.. i want to get that.

please help me.

Thanks once again.
OriginalGriff 25-May-17 3:40am    
Try Environment.GetFolderPath(Environment.SpecialFolder.StartMenu)
abdul subhan mohammed 25-May-17 4:16am    
When i pressed win key, i got the start screen, at the bottom we have one more button "downArrow" when I click this button, it shows all the items, these are showing in this code: Environment.GetFolderPath(Environment.SpecialFolder.StartMenu);

but i'm looking for those items which we get when we press only win key, but not downArrow button.

could please check.
OriginalGriff 25-May-17 4:19am    
I don't know any way to get that - it may be possible, but you will have to ask a separate question and see if anyone else can help you.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900