mirror of
https://github.com/cemu-project/DS4Windows.git
synced 2024-12-02 05:54:20 +01:00
47 lines
1.5 KiB
C#
47 lines
1.5 KiB
C#
|
using System;
|
|||
|
using System.Collections.Generic;
|
|||
|
using System.Linq;
|
|||
|
using System.Runtime.InteropServices;
|
|||
|
using System.Text;
|
|||
|
using System.Threading.Tasks;
|
|||
|
|
|||
|
namespace DS4Windows
|
|||
|
{
|
|||
|
class NativeMethods
|
|||
|
{
|
|||
|
[DllImport("msi.dll", CharSet = CharSet.Auto)]
|
|||
|
public static extern uint MsiGetShortcutTarget(string targetFile, StringBuilder productCode, StringBuilder featureID, StringBuilder componentCode);
|
|||
|
|
|||
|
[DllImport("msi.dll", CharSet = CharSet.Auto)]
|
|||
|
public static extern InstallState MsiGetComponentPath(string productCode, string componentCode, StringBuilder componentPath, ref int componentPathBufferSize);
|
|||
|
|
|||
|
public const int MaxFeatureLength = 38;
|
|||
|
public const int MaxGuidLength = 38;
|
|||
|
public const int MaxPathLength = 1024;
|
|||
|
|
|||
|
public enum InstallState
|
|||
|
{
|
|||
|
NotUsed = -7,
|
|||
|
BadConfig = -6,
|
|||
|
Incomplete = -5,
|
|||
|
SourceAbsent = -4,
|
|||
|
MoreData = -3,
|
|||
|
InvalidArg = -2,
|
|||
|
Unknown = -1,
|
|||
|
Broken = 0,
|
|||
|
Advertised = 1,
|
|||
|
Removed = 1,
|
|||
|
Absent = 2,
|
|||
|
Local = 3,
|
|||
|
Source = 4,
|
|||
|
Default = 5
|
|||
|
}
|
|||
|
public const int HWND_BROADCAST = 0xffff;
|
|||
|
public static readonly int WM_SHOWME = RegisterWindowMessage("WM_SHOWME");
|
|||
|
[DllImport("user32")]
|
|||
|
public static extern bool PostMessage(IntPtr hwnd, int msg, IntPtr wparam, IntPtr lparam);
|
|||
|
[DllImport("user32")]
|
|||
|
public static extern int RegisterWindowMessage(string message);
|
|||
|
}
|
|||
|
}
|