Fixed a interop call signature error, which might cause issues on 64 bit. (these have not be seen!)

git-svn-id: http://svn.code.sf.net/p/greenshot/code/trunk@2552 7dccd23d-a4a3-4e1f-8c07-b4c1b4018ab4
This commit is contained in:
RKrom 2013-04-04 12:49:34 +00:00
parent 28346d2eab
commit c8b1481a18
2 changed files with 9 additions and 9 deletions

View file

@ -331,19 +331,19 @@ namespace GreenshotPlugin.Core {
/// <param name="hwnd"></param> /// <param name="hwnd"></param>
/// <returns></returns> /// <returns></returns>
private static Icon GetAppIcon(IntPtr hwnd) { private static Icon GetAppIcon(IntPtr hwnd) {
const int ICON_SMALL = 0; IntPtr ICON_SMALL = IntPtr.Zero;
const int ICON_BIG = 1; IntPtr ICON_BIG = new IntPtr(1);
const int ICON_SMALL2 = 2; IntPtr ICON_SMALL2 = new IntPtr(2);
IntPtr iconHandle = User32.SendMessage(hwnd, (int)WindowsMessages.WM_GETICON, ICON_SMALL2, 0); IntPtr iconHandle = User32.SendMessage(hwnd, (int)WindowsMessages.WM_GETICON, ICON_SMALL2, IntPtr.Zero);
if (iconHandle == IntPtr.Zero) { if (iconHandle == IntPtr.Zero) {
iconHandle = User32.SendMessage(hwnd, (int)WindowsMessages.WM_GETICON, ICON_SMALL, 0); iconHandle = User32.SendMessage(hwnd, (int)WindowsMessages.WM_GETICON, ICON_SMALL, IntPtr.Zero);
} }
if (iconHandle == IntPtr.Zero) { if (iconHandle == IntPtr.Zero) {
iconHandle = User32.GetClassLongWrapper(hwnd, (int)ClassLongIndex.GCL_HICONSM); iconHandle = User32.GetClassLongWrapper(hwnd, (int)ClassLongIndex.GCL_HICONSM);
} }
if (iconHandle == IntPtr.Zero) { if (iconHandle == IntPtr.Zero) {
iconHandle = User32.SendMessage(hwnd, (int)WindowsMessages.WM_GETICON, ICON_BIG, 0); iconHandle = User32.SendMessage(hwnd, (int)WindowsMessages.WM_GETICON, ICON_BIG, IntPtr.Zero);
} }
if (iconHandle == IntPtr.Zero) { if (iconHandle == IntPtr.Zero) {
iconHandle = User32.GetClassLongWrapper(hwnd, (int)ClassLongIndex.GCL_HICON); iconHandle = User32.GetClassLongWrapper(hwnd, (int)ClassLongIndex.GCL_HICON);

View file

@ -107,9 +107,9 @@ namespace GreenshotPlugin.UnmanagedHelpers {
[return: MarshalAs(UnmanagedType.Bool)] [return: MarshalAs(UnmanagedType.Bool)]
public static extern bool PrintWindow(IntPtr hwnd, IntPtr hDC, uint nFlags); public static extern bool PrintWindow(IntPtr hwnd, IntPtr hDC, uint nFlags);
[DllImport("user32", SetLastError=true)] [DllImport("user32", SetLastError=true)]
public extern static int SendMessage(IntPtr hWnd, int wMsg, IntPtr wParam, IntPtr lParam); public extern static IntPtr SendMessage(IntPtr hWnd, uint wMsg, IntPtr wParam, IntPtr lParam);
[DllImport("user32", SetLastError=true, EntryPoint = "SendMessageA")] [DllImport("user32", SetLastError = true)]
public static extern IntPtr SendMessage(IntPtr hWnd, int msg, int wParam, int lParam); public extern static IntPtr SendMessage(IntPtr hWnd, uint wMsg, IntPtr wParam, [MarshalAs(UnmanagedType.LPWStr)] string lParam);
[DllImport("user32", SetLastError = true)] [DllImport("user32", SetLastError = true)]
public extern static uint GetWindowLong(IntPtr hwnd, int index); public extern static uint GetWindowLong(IntPtr hwnd, int index);
[DllImport("user32", SetLastError = true)] [DllImport("user32", SetLastError = true)]