mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-12-18 20:49:46 +01:00
Fix for PWAs and command prompt not showing up as the first result (#4020)
* Added code which increments the score for the app without any arguments * Removed magic number and added var
This commit is contained in:
@@ -102,6 +102,8 @@ namespace Microsoft.Plugin.Program.Programs
|
||||
// To initialize the app description
|
||||
public String description = String.Empty;
|
||||
|
||||
// Sets to true if the program takes in arguments
|
||||
public bool hasArguments = false;
|
||||
|
||||
// Retrieve the target path using Shell Link
|
||||
public string retrieveTargetPath(string path)
|
||||
@@ -125,6 +127,15 @@ namespace Microsoft.Plugin.Program.Programs
|
||||
buffer = new StringBuilder(MAX_PATH);
|
||||
((IShellLinkW)link).GetDescription(buffer, MAX_PATH);
|
||||
description = buffer.ToString();
|
||||
|
||||
StringBuilder argumentBuffer = new StringBuilder(MAX_PATH);
|
||||
((IShellLinkW)link).GetArguments(argumentBuffer, argumentBuffer.Capacity);
|
||||
|
||||
// Set variable to true if the program takes in any arguments
|
||||
if (argumentBuffer.Length != 0)
|
||||
{
|
||||
hasArguments = true;
|
||||
}
|
||||
}
|
||||
return target;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user