2

I know how to build JumpList for my application. But now I want to show JumpList for specific '.exe' file. I have a path to '.exe' file and I need to show JumpList for this application. JumpList window is shown when user click right mouse button over application icon on taskbar, but I need to show this window programmatically.

treetey
  • 829
  • 1
  • 6
  • 16
  • 3
    I don't believe you can. However you can get the MRU files (and perhaps the tasks or custom destinations) and show them to the user in your own ui. – Kate Gregory Jul 13 '11 at 16:56

5 Answers5

3

From the little research I did, it can be done by opening and reading the content of the files in %AppData%\Microsoft\Windows\Recent\AutomaticDestinations

The files there contain the extensions of the jump list files, by reading these files, you can find the file that contains the jump lists of the application you want by checking for repeatedly occurring file extensions. By knowing the file extensions for the applications you want to retrieve, you can thus find its jumplist file. And of course you can find applications' file extensions using the registry.

Edit: just read your post the second time: Forgive me, taught you were writing an application to replace the windows taskbar. Well, your question seems tough sorta. These steps might work:

  1. Take a screenshot of the desktop and find the part that matches the icon of the application you're looking for (which is retrievable programmatically)
  2. Subtract or match the image from your screenshot to get the location on the screen
  3. Invoke a mouse right-click at that location on the screen.

ps: The api code pack for windows 7 might also prove useful.

MarkKB
  • 3
  • 2
Chibueze Opata
  • 9,856
  • 7
  • 42
  • 65
2

You might be able to use Window Messages to do it. You can use a tool like Spy++ to find out how the taskbar structures its children windows etc. Once you understand how it works, you will most probably need to SetFocus and send messages like WM_MOUSECLICK to it.

If each button isn't a real button (just a painted 'virtual' button) you will need to use some math to figure out the co-ordinates for WM_MOUSECLICK (you may need to experiment with WM_MOUSEDOWN and WM_MOUSEUP). Keep in mind that the taskbar can be anchored to different edges of the desktop, as well as be sized to 16px buttons.

If it sounds like it hack, it is, I remember Microsoft specifically saying that they wouldn't give developers this level of control with the new taskbar.

You might find PInvoke Wiki useful for getting DllImport definitions.

I have hacked the taskbar before in XP (custom start menu), so this should be possible under Windows 7.

Community
  • 1
  • 1
Jonathan Dickinson
  • 9,050
  • 1
  • 37
  • 60
1

You can use the library "Teststack.White" (simple Nuget) and then use this

var desktop = Desktop.Instance;
var taskList = desktop.Get<ToolStrip>(SearchCriteria.ByClassName("MSTaskListWClass"));
var button = taskList.Get<Button>(SearchCriteria.ByText(Text));
button.RightClick();
pinckerman
  • 4,115
  • 6
  • 33
  • 42
0

Jump lists are part of the secure ui you can add options to the list but showing the list itself has to be user initiated much like context menus do and mouse clicks

Chris McGrath
  • 1,727
  • 3
  • 19
  • 45
0

To be honest, I have not spent much time with JumpLists.

Did you see this example on Code Project? It's got lots of good info in it.

http://www.codeproject.com/KB/WPF/MefFX.aspx

The article is a few years old, but the information is still good.