Skip to content
This repository has been archived by the owner on May 17, 2020. It is now read-only.

Commit

Permalink
fix random crash when driver had no admin rights
Browse files Browse the repository at this point in the history
  • Loading branch information
yutamago committed Aug 30, 2018
1 parent ccf7ba2 commit f8ac429
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions Huion Tablet/HuionTalbet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -131,14 +131,18 @@ private void checkForegroundWindowTick(object sender, EventArgs e)
}

Process process = Process.GetProcessById(processId);
string processFileName = Path.GetFileName(process.MainModule.FileName);
if (!processFileName.Equals(lastForegroundApplication))
try
{
lastForegroundApplication = processFileName;
string processFileName = Path.GetFileName(process.MainModule.FileName);
if (!processFileName.Equals(lastForegroundApplication))
{
lastForegroundApplication = processFileName;

HuionLog.printLog("FocusChanged", processFileName.ToLower());
handleFocusChange(processFileName.ToLower());
HuionLog.printLog("FocusChanged", processFileName.ToLower());
handleFocusChange(processFileName.ToLower());
}
}
catch (Win32Exception) { }
}

private void handleFocusChange(string processFileName)
Expand Down

0 comments on commit f8ac429

Please sign in to comment.