Migrate files from Wox to PowerLauncher#5014
Conversation
| { | ||
| var key = result.ToString(); | ||
| if (records.TryGetValue(key, out int value)) | ||
| if(result != null) |
There was a problem hiding this comment.
@somil55 In what cases are we expecting result to be null? If we don't know this should probably be a nullargexception, otherwise we should add a comment on what cases it's expected to be null and why we guard against it.
There was a problem hiding this comment.
@ryanbodrug-microsoft All calls to Add are preceded by null check. So in our codebase, it would ever be null. I will update this to throw nullargexception.
| [DllImport("user32.dll")] | ||
| internal static extern uint SendInput(uint nInputs, INPUT[] pInputs, int cbSize); | ||
|
|
||
| [DllImport("user32.dll", SetLastError = true)] | ||
| internal static extern int GetWindowLong(IntPtr hWnd, int nIndex); | ||
|
|
||
| [DllImport("user32.dll")] | ||
| internal static extern int SetWindowLong(IntPtr hWnd, int nIndex, int dwNewLong); | ||
|
|
||
| [DllImport("user32.dll")] | ||
| internal static extern IntPtr GetForegroundWindow(); | ||
|
|
||
| [DllImport("user32.dll")] | ||
| internal static extern IntPtr GetDesktopWindow(); | ||
|
|
||
| [DllImport("user32.dll")] | ||
| internal static extern IntPtr GetShellWindow(); | ||
|
|
||
| [DllImport("user32.dll", SetLastError = true)] | ||
| internal static extern int GetWindowRect(IntPtr hwnd, out RECT rc); | ||
|
|
||
| [DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Unicode)] | ||
| internal static extern int GetClassName(IntPtr hWnd, StringBuilder lpClassName, int nMaxCount); | ||
|
|
||
| [DllImport("user32.DLL", CharSet = CharSet.Unicode)] | ||
| internal static extern IntPtr FindWindowEx(IntPtr hwndParent, IntPtr hwndChildAfter, string lpszClass, string lpszWindow); |
There was a problem hiding this comment.
@somil55 Can you help me understand why these need to be added? Where they moved from somewhere?
There was a problem hiding this comment.
They were moved from WindowsInteropHelper.cs. This was to fix CA1060 error, which requires all native methods in a namespace to be moved to a static nativemethod class.
Summary of the Pull Request
This PR removes
Woxproject and migrates all class intoPowerLauncherproject.PR Checklist
Detailed Description of the Pull Request / Additional comments
This PR makes the following changes :
WoxtoPowerLauncherproject.Following static analysis errors have been suppressed in
MainViewModel.cs:We currently convert all strings to lowercase across all plugins. This would require updating all plugins and projects to use
ToUpperfunction for string normalization. It would be better to make this change as part of seperate PR.This error asks to use more specific exception type in catch block. Since this is an interop code, it is not very clear which specific exception should be used.
Validation Steps Performed
Manually verified that all plugins function correctly and MSI is built without any errors.