Menu

[r782]: / trunk / GoogleContactsSync / NativeMethods.cs  Maximize  Restore  History

Download this file

33 lines (25 with data), 1.3 kB

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
using System;
using System.Runtime.InteropServices;
namespace GoContactSyncMod
{
internal class NativeMethods
{
#region API Constants
public const int HWND_BROADCAST = 0xffff;
public static readonly int WM_GCSM_SHOWME = RegisterWindowMessage("WM_GCSM_SHOWME");
//public const int VER_NT_WORKSTATION = 0x0000001;
// Fix for WinXP and older systems, that do not continue with shutdown until all programs have closed
// FormClosing would hold system shutdown, when it sets the cancel to true
public const int WM_QUERYENDSESSION = 0x11;
#endregion
#region Extern Functions Declaration
[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("user32", SetLastError = true, CharSet = CharSet.Unicode)]
public static extern bool PostMessage(IntPtr hwnd, int msg, IntPtr wparam, IntPtr lparam);
[DllImport("user32", SetLastError = true, CharSet = CharSet.Unicode)]
public static extern int RegisterWindowMessage(string message);
[DllImport("ole32.dll")]
public static extern int CoRegisterMessageFilter(IOleMessageFilter newFilter, out IOleMessageFilter oldFilter);
#endregion
}
}
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.