This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public async Task KillProcessNicely(uint pid, int delayInMs = 3*1000) | |
{ | |
// Ugh, this is gross - https://stackoverflow.com/questions/16653517/how-best-to-post-wm-quit-to-a-running-process | |
var tids = NativeMethods.GetAllTopLevelWindowsInZOrder() | |
.Select(hwnd => { | |
uint wndpid = 0; | |
var tid = NativeMethods.GetWindowThreadProcessId(hwnd, out wndpid); | |
if (wndpid != pid) { | |
return (uint)0; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* AutoArlo | |
* | |
* Created by Joe Beeson <jbeeson@gmail.com> | |
* | |
* This is free and unencumbered software released into the public domain. | |
* | |
* Anyone is free to copy, modify, publish, use, compile, sell, or | |
* distribute this software, either in source code form or as a compiled | |
* binary, for any purpose, commercial or non-commercial, and by any |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* jQuery.ajaxQueue - A queue for ajax requests | |
* | |
* (c) 2011 Corey Frang | |
* Dual licensed under the MIT and GPL licenses. | |
* | |
* Requires jQuery 1.5+ | |
*/ | |
(function(a){var b=a({});a.ajaxQueue=function(c){function g(b){d=a.ajax(c).done(e.resolve).fail(e.reject).then(b,b)}var d,e=a.Deferred(),f=e.promise();b.queue(g),f.abort=function(h){if(d)return d.abort(h);var i=b.queue(),j=a.inArray(g,i);j>-1&&i.splice(j,1),e.rejectWith(c.context||c,[f,h,""]);return f};return f}})(jQuery) |