|
@@ -94,6 +94,29 @@ namespace PDF_Master.Helper
|
|
|
SHCNF_FLUSHNOWAIT = 0x2000
|
|
|
}
|
|
|
|
|
|
+ [Flags]
|
|
|
+ public enum FileMapProtection : uint
|
|
|
+ {
|
|
|
+ PageReadonly = 0x02,
|
|
|
+ PageReadWrite = 0x04,
|
|
|
+ PageWriteCopy = 0x08,
|
|
|
+ PageExecuteRead = 0x20,
|
|
|
+ PageExecuteReadWrite = 0x40,
|
|
|
+ SectionCommit = 0x8000000,
|
|
|
+ SectionImage = 0x1000000,
|
|
|
+ SectionNoCache = 0x10000000,
|
|
|
+ SectionReserve = 0x4000000,
|
|
|
+ }
|
|
|
+ [Flags]
|
|
|
+ public enum FileMapAccessType : uint
|
|
|
+ {
|
|
|
+ Copy = 0x01,
|
|
|
+ Write = 0x02,
|
|
|
+ Read = 0x04,
|
|
|
+ AllAccess = 0x08,
|
|
|
+ Execute = 0x20,
|
|
|
+ }
|
|
|
+
|
|
|
[DllImport("kernel32.dll", SetLastError = true, CharSet = CharSet.Auto)]
|
|
|
public static extern bool CreateProcess(string lpApplicationName, string lpCommandLine, ref SECURITY_ATTRIBUTES lpProcessAttributes, ref SECURITY_ATTRIBUTES lpThreadAttributes,
|
|
|
bool bInheritHandles, uint dwCreationFlags, IntPtr lpEnvironment, string lpCurrentDirectory, [In] ref STARTUPINFO lpStartupInfo, out PROCESS_INFORMATION lpProcessInformation);
|
|
@@ -107,6 +130,36 @@ namespace PDF_Master.Helper
|
|
|
[DllImport("kernel32.dll", SetLastError = true, CharSet = CharSet.Auto)]
|
|
|
public static extern UInt32 WaitForSingleObject(IntPtr hHandle, UInt32 dwMilliseconds);
|
|
|
|
|
|
+ [DllImport("User32.dll", SetLastError = true, CharSet = CharSet.Auto)]
|
|
|
+ public static extern uint RegisterWindowMessage(string lpString);
|
|
|
+
|
|
|
+ [DllImport("User32.dll", SetLastError = true, CharSet = CharSet.Auto)]
|
|
|
+ public static extern int PostMessage(IntPtr hWnd, uint msg, IntPtr wParam, IntPtr lParam);
|
|
|
+
|
|
|
+ [DllImport("kernel32.dll", SetLastError = true, CharSet = CharSet.Auto)]
|
|
|
+ public static extern bool SetEvent(IntPtr hEvent);
|
|
|
+
|
|
|
+ [DllImport("kernel32.dll", SetLastError = true, CharSet = CharSet.Auto)]
|
|
|
+ public static extern IntPtr CreateFileMapping(IntPtr hFile, IntPtr lpFileMappingAttributes, FileMapProtection flProtect, uint dwMaximumSizeHigh, uint dwMaximumSizeLow, [MarshalAs(UnmanagedType.LPStr)] string lpName);
|
|
|
+
|
|
|
+ [DllImport("kernel32.dll", SetLastError = true, CharSet = CharSet.Auto)]
|
|
|
+ public static extern IntPtr MapViewOfFileEx(IntPtr hFileMappingObject, FileMapAccessType dwDesiredAccess, uint dwFileOffsetHigh, uint dwFileOffsetLow, UIntPtr dwNumberOfBytesToMap, IntPtr lpBaseAddress);
|
|
|
+
|
|
|
+ [DllImport("Kernel32.dll", SetLastError = true, CharSet = CharSet.Auto)]
|
|
|
+ public static extern int UnmapViewOfFile(IntPtr lpBaseAddress);
|
|
|
+
|
|
|
+ [DllImport("Kernel32.dll", SetLastError = true, CharSet = CharSet.Auto)]
|
|
|
+ public static extern bool CloseHandle(IntPtr hObject);
|
|
|
+
|
|
|
+ [DllImport("Kernel32.dll", SetLastError = true, CharSet = CharSet.Auto)]
|
|
|
+ public static extern IntPtr OpenFileMapping(int dwDesiredAccess, int bInheritHandle, [MarshalAs(UnmanagedType.LPStr)] string lpName);
|
|
|
+
|
|
|
+ [DllImport("Kernel32.dll", SetLastError = true, CharSet = CharSet.Auto)]
|
|
|
+ public static extern IntPtr CreateEvent(IntPtr lpEventAttributes, bool bManualReset, bool bInitialState, string lpName);
|
|
|
+
|
|
|
+ [DllImport("Kernel32.dll", SetLastError = true, CharSet = CharSet.Auto)]
|
|
|
+ public static extern IntPtr OpenEvent(uint dwDesiredAccess, bool bInheritHandle, string lpName);
|
|
|
+
|
|
|
/// <summary>
|
|
|
/// 注册为默认PDF浏览器
|
|
|
/// </summary>
|