Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows Support #9

Open
2 of 3 tasks
Exidex opened this issue Mar 16, 2024 · 2 comments
Open
2 of 3 tasks

Windows Support #9

Exidex opened this issue Mar 16, 2024 · 2 comments
Labels
kind: help wanted Extra attention is needed kind: umbrella Issue lists various things to do type: feature Issue or PR related to new feature work: chaotic Describes the kind of work involved, using the Cynefin framework. Cause and effect are unclear

Comments

@Exidex
Copy link
Member

Exidex commented Mar 16, 2024

  • Build & Run
  • Package
  • Applications Plugin. Looks like it requires considerable amount of unsafe Rust code because there are no safe wrappers for the SHGetKnownFolderItem & Co APIs
@Exidex
Copy link
Member Author

Exidex commented Aug 18, 2024

Gave an attempt at implementing Application plugin for Windows, unfortunately couldn't make it work. Application plugin does 2 things: collects list of applications and launches one of those when use selects the item. I was able to successfully collect applications via SHGetKnownFolderItem on FOLDERID_AppsFolder and iterating over children of that folder where each child is an application. This does work but unfortunately I couldn't find a way to launch an application that would work for different types of those applications.

  • ShellExecuteExW seems to work only for url links and exe, but only if PIDL doesn't contain KnownFolder GUID.
  • IApplicationActivationManager::ActivateApplication only seems to work for AUMIDs (e.g. Microsoft.WindowsFeedbackHub_8wekyb3d8bbwe!App).
  • IContextMenu::InvokeCommand just fails for unknown reason.

Here is a list of different types of PIDLs that I have found in AppsFolder:

  • Microsoft.WindowsFeedbackHub_8wekyb3d8bbwe!App
  • {F38BF404-1D43-42F2-9305-67DE0B28FC23}\\regedit.exe
  • {7C5A40EF-A0FB-4BFC-874A-C0F2E0B9FA8E}\\Windows Kits\\10\\Shortcuts\\WindowsStoreAppDevCenterToolsDocumentation.url
  • {1AC14E77-02E7-4E5D-B744-2EB1AE5198B7}\\WF.msc
  • {1AC14E77-02E7-4E5D-B744-2EB1AE5198B7}\\appverif.chm
  • MSEdge
  • VisualStudio.f7b86bd3
  • Microsoft.Windows.RemoteDesktop
  • Microsoft.AutoGenerated.{C804BBA7-FA5F-CBF7-8B55-2096E5F972CB} - Resource Monitor
  • https://nodejs.org/ - Node.js website

Application needs to be able to launch each of those, either in generic way or by handling each of those separately, but then arises the challenge of being able to reliably tell which of those types the PIDL is.

See a60fc0f for code

@Exidex Exidex added the kind: help wanted Extra attention is needed label Aug 18, 2024
@Exidex Exidex added kind: umbrella Issue lists various things to do type: feature Issue or PR related to new feature work: chaotic Describes the kind of work involved, using the Cynefin framework. Cause and effect are unclear labels Aug 26, 2024
@Exidex
Copy link
Member Author

Exidex commented Oct 16, 2024

After investigation, the proper way (which is used by PowerToys Run) seems to be to collect files with following extensions .lnk, .url, .exe and .appref-ms in following folders: FOLDERID_Desktop, FOLDERID_PublicDesktop, FOLDERID_StartMenu, FOLDERID_CommonStartMenu. Then extract icon using one of ExtractIconExW, ExtractAssociatedIconExW, SHGetFileInfoW (there is probably more) as close to ~40px as possible and convert to png. Not yet sure about actually executing.

See for some of that

But windows api is testing my sanity so I'll leave it for another time

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: help wanted Extra attention is needed kind: umbrella Issue lists various things to do type: feature Issue or PR related to new feature work: chaotic Describes the kind of work involved, using the Cynefin framework. Cause and effect are unclear
Projects
None yet
Development

No branches or pull requests

1 participant