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

Ready for Review - [Mouse Without Borders] - refactoring "Common" classes (Part 4) - #35155 #37579

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Prev Previous commit
Next Next commit
[MouseWithoutBorders] - moving Common.Launch.cs -> Core\Launch.cs - #…
  • Loading branch information
mikeclayton committed Feb 21, 2025
commit e4288d08059abd0ae682426e032356c133967978
6 changes: 3 additions & 3 deletions src/modules/MouseWithoutBorders/App/Class/Common.Clipboard.cs
Original file line number Diff line number Diff line change
@@ -153,7 +153,7 @@ internal static bool CheckClipboardEx(ByteArrayOrString data, bool isFilePath)

string filePath = stringData;

_ = Common.ImpersonateLoggedOnUserAndDoSomething(() =>
_ = Launch.ImpersonateLoggedOnUserAndDoSomething(() =>
{
if (File.Exists(filePath) || Directory.Exists(filePath))
{
@@ -579,7 +579,7 @@ internal static void ReceiveAndProcessClipboardData(string remoteMachine, Socket
{
if (postAct.Equals("desktop", StringComparison.OrdinalIgnoreCase))
{
_ = ImpersonateLoggedOnUserAndDoSomething(() =>
_ = Launch.ImpersonateLoggedOnUserAndDoSomething(() =>
{
savingFolder = Environment.GetFolderPath(Environment.SpecialFolder.Desktop) + "\\MouseWithoutBorders\\";

@@ -696,7 +696,7 @@ internal static void ReceiveAndProcessClipboardData(string remoteMachine, Socket
Path.GetFileName(fileName),
remoteMachine);

_ = ImpersonateLoggedOnUserAndDoSomething(() =>
_ = Launch.ImpersonateLoggedOnUserAndDoSomething(() =>
{
ProcessStartInfo startInfo = new();
startInfo.UseShellExecute = true;
4 changes: 2 additions & 2 deletions src/modules/MouseWithoutBorders/App/Class/Common.Helper.cs
Original file line number Diff line number Diff line change
@@ -310,7 +310,7 @@ internal static void RunDDHelper(bool cleanUp = false)

if (h.ToInt32() <= 0)
{
_ = Common.CreateProcessInInputDesktopSession(
_ = Launch.CreateProcessInInputDesktopSession(
$"\"{Path.GetDirectoryName(Application.ExecutablePath)}\\{HelperProcessName}.exe\"",
string.Empty,
Common.GetInputDesktop(),
@@ -442,7 +442,7 @@ internal static bool GetUserName()
{
if (Program.User.Contains("system", StringComparison.CurrentCultureIgnoreCase))
{
_ = Common.ImpersonateLoggedOnUserAndDoSomething(() =>
_ = Launch.ImpersonateLoggedOnUserAndDoSomething(() =>
{
// See: https://stackoverflow.com/questions/19487541/how-to-get-windows-user-name-from-sessionid
static string GetUsernameBySessionId(int sessionId)
314 changes: 0 additions & 314 deletions src/modules/MouseWithoutBorders/App/Class/Common.Launch.cs

This file was deleted.

4 changes: 2 additions & 2 deletions src/modules/MouseWithoutBorders/App/Class/Common.cs
Original file line number Diff line number Diff line change
@@ -700,7 +700,7 @@ internal static void OpenImage(string file)
// {
// Process.Start("explorer", "\"" + file + "\"");
// });
_ = CreateProcessInInputDesktopSession(
_ = Launch.CreateProcessInInputDesktopSession(
"\"" + Environment.ExpandEnvironmentVariables(@"%SystemRoot%\System32\Mspaint.exe") +
"\"",
"\"" + file + "\"",
@@ -1316,7 +1316,7 @@ private static string GetMyStorageDir()
}
else
{
_ = ImpersonateLoggedOnUserAndDoSomething(() =>
_ = Launch.ImpersonateLoggedOnUserAndDoSomething(() =>
{
st = Environment.GetFolderPath(Environment.SpecialFolder.Desktop) + @"\" + Common.BinaryName;
if (!Directory.Exists(st))
Loading
Oops, something went wrong.