Implemented some TODO's, fixed freezing the wrong processes, fixed retrieval of window icon for some windows and cleaned some code.

git-svn-id: http://svn.code.sf.net/p/greenshot/code/trunk@1831 7dccd23d-a4a3-4e1f-8c07-b4c1b4018ab4
This commit is contained in:
RKrom 2012-05-04 09:58:18 +00:00
commit 6905a353c1
9 changed files with 136 additions and 40 deletions

View file

@ -20,6 +20,7 @@
*/
using System;
using System.Runtime.InteropServices;
using System.Text;
namespace GreenshotPlugin.UnmanagedHelpers {
[Flags]
@ -48,11 +49,28 @@ namespace GreenshotPlugin.UnmanagedHelpers {
[return: MarshalAs(UnmanagedType.Bool)]
public static extern bool AllocConsole();
[DllImport("kernel32")]
[DllImport("kernel32", SetLastError = true)]
public static extern IntPtr OpenThread(ThreadAccess dwDesiredAccess, bool bInheritHandle, uint dwThreadId);
[DllImport("kernel32")]
[DllImport("kernel32", SetLastError = true)]
public static extern uint SuspendThread(IntPtr hThread);
[DllImport("kernel32")]
[DllImport("kernel32", SetLastError = true)]
public static extern int ResumeThread(IntPtr hThread);
[DllImport("kernel32", SetLastError = true)]
public static extern IntPtr OpenProcess(ProcessAccessFlags dwDesiredAccess, bool bInheritHandle, uint dwProcessId);
[DllImport("kernel32", SetLastError = true)]
public static extern bool QueryFullProcessImageName(IntPtr hProcess, uint dwFlags, StringBuilder lpExeName, ref uint lpdwSize);
[DllImport("kernel32", SetLastError = true)]
public static extern uint QueryDosDevice(string lpDeviceName, StringBuilder lpTargetPath, uint uuchMax);
[DllImport("kernel32", SetLastError = true)]
public static extern IntPtr GetModuleHandle(string lpModuleName);
[DllImport("kernel32", SetLastError = true)]
public static extern bool CloseHandle(IntPtr hObject);
// TODO: Move to PSAPI.cs ??
[DllImport("psapi", SetLastError = true)]
public static extern uint GetModuleFileNameEx(IntPtr hProcess, IntPtr hModule, StringBuilder lpFilename, uint nSize);
[DllImport("psapi", SetLastError = true)]
public static extern uint GetProcessImageFileName(IntPtr hProcess, StringBuilder lpImageFileName, uint nSize);
}
}