internal static extern IntPtr CreateDIBSection( IntPtr hdc, ref NativeStructs.BITMAPINFO pbmi, uint iUsage, out IntPtr ppvBits, IntPtr hSection, uint dwOffset);
public Direct3DDevice9Ex CreateDeviceEx(uint Adapter, int DeviceType, IntPtr hFocusWindow, int BehaviorFlags, NativeStructs.D3DPRESENT_PARAMETERS pPresentationParameters, NativeStructs.D3DDISPLAYMODEEX pFullscreenDisplayMode) { ComInterface.IDirect3DDevice9Ex obj = null; int result = this.createDeviceEx(this.comObject, Adapter, DeviceType, hFocusWindow, BehaviorFlags, pPresentationParameters, pFullscreenDisplayMode, out obj); Marshal.ThrowExceptionForHR(result); return new Direct3DDevice9Ex(obj); }
public static extern bool CreateProcessWithTokenW( IntPtr hToken, uint dwLogonFlags, IntPtr lpApplicationName, IntPtr lpCommandLine, uint dwCreationFlags, IntPtr lpEnvironment, IntPtr lpCurrentDirectory, IntPtr lpStartupInfo, out NativeStructs.PROCESS_INFORMATION lpProcessInfo);
public void Save(Window rpWindow, NativeStructs.WINDOWPLACEMENT rpData) { var rPreference = new WindowPreference() { Name = rpWindow.GetType().FullName, Left = rpData.rcNormalPosition.Left, Top = rpData.rcNormalPosition.Top, Width = rpData.rcNormalPosition.Right - rpData.rcNormalPosition.Left, Height = rpData.rcNormalPosition.Bottom - rpData.rcNormalPosition.Top, State = rpWindow.WindowState, }; Preference.Current.Windows.Landscape[rPreference.Name] = rPreference; }
public void Save(Window rpWindow, NativeStructs.WINDOWPLACEMENT rpData) { var rPreference = new WindowPreference() { Name = rpWindow.GetType().FullName, Left = rpData.rcNormalPosition.Left, Top = rpData.rcNormalPosition.Top, Width = rpData.rcNormalPosition.Right - rpData.rcNormalPosition.Left, Height = rpData.rcNormalPosition.Bottom - rpData.rcNormalPosition.Top, State = rpWindow.WindowState, }; Preference.Instance.Windows.SavePlacement(rPreference); }
public static extern uint SendInput(uint nInputs, ref NativeStructs.INPUT pInputs, int cbSize);
public static extern bool UpdateLayeredWindow(IntPtr hwnd, IntPtr hdcDst, ref NativeStructs.POINT pptDst, ref NativeStructs.SIZE psize, IntPtr hdcSrc, ref NativeStructs.POINT pprSrc, Int32 crKey, ref NativeStructs.BLENDFUNCTION pblend, Int32 dwFlags);
public static extern IntPtr GetWindowRect(IntPtr hWnd, ref NativeStructs.RECT rect);
public static extern bool ScreenToClient(IntPtr hWnd, ref NativeStructs.Point point);
internal static extern bool SetupDiEnumDeviceInfo( IntPtr DeviceInfoSet, uint MemberIndex, ref NativeStructs.SP_DEVINFO_DATA DeviceInfoData);
internal static extern bool GlobalMemoryStatusEx(ref NativeStructs.MEMORYSTATUSEX lpBuffer);
internal static extern bool VerifyVersionInfo( ref NativeStructs.OSVERSIONINFOEX lpVersionInfo, uint dwTypeMask, ulong dwlConditionMask);
internal static extern bool GetVersionEx(ref NativeStructs.OSVERSIONINFOEX lpVersionInfo);
internal static unsafe extern uint GetRegionData( IntPtr hRgn, uint dwCount, NativeStructs.RGNDATA *lpRgnData);
internal static extern int FillRect( IntPtr hDC, ref NativeStructs.RECT lprc, IntPtr hbr);
internal static extern void DrawThemeBackground( IntPtr hTheme, IntPtr hdc, int iPartId, int iStateId, ref NativeStructs.RECT pRect, ref NativeStructs.RECT pClipRect);
internal static extern int DrawTextW( IntPtr hdc, string lpString, int nCount, ref NativeStructs.RECT lpRect, uint uFormat);
public static extern bool SystemParametersInfo(NativeConstants.SPI uiAction, int uiParam, ref NativeStructs.RECT pvParam, int fWinIni);
public static extern bool GetCaretPos(ref NativeStructs.POINT point);
public static extern void DwmExtendFrameIntoClientArea(IntPtr hWnd, ref NativeStructs.MARGINS pMarInset);
internal static extern uint SendInput(uint nInputs, ref NativeStructs.Input pInputs, int cbSize);
internal static extern bool MoveToEx( IntPtr hdc, int X, int Y, out NativeStructs.POINT lpPoint);
internal static extern bool ShellExecuteExW(ref NativeStructs.SHELLEXECUTEINFO lpExecInfo);
internal static extern bool WinHttpGetIEProxyConfigForCurrentUser(ref NativeStructs.WINHTTP_CURRENT_USER_IE_PROXY_CONFIG pProxyConfig);
internal static extern void GetNativeSystemInfo(ref NativeStructs.SYSTEM_INFO lpSystemInfo);
private static Polygon gpc_polygon_ToPolygon(NativeStructs.gpc_polygon gpc_polygon) { Polygon polygon = new Polygon(); polygon.NofContours = gpc_polygon.num_contours; polygon.ContourIsHole = new bool[polygon.NofContours]; polygon.Contour = new VertexList[polygon.NofContours]; short[] holeShort = new short[polygon.NofContours]; IntPtr ptr = gpc_polygon.hole; if (polygon.NofContours > 0) { Marshal.Copy(gpc_polygon.hole, holeShort, 0, polygon.NofContours); } for (int i = 0; i < polygon.NofContours; i++) polygon.ContourIsHole[i] = (holeShort[i] != 0); ptr = gpc_polygon.contour; for (int i = 0; i < polygon.NofContours; i++) { NativeStructs.gpc_vertex_list gpc_vtx_list = (NativeStructs.gpc_vertex_list)Marshal.PtrToStructure(ptr, typeof(NativeStructs.gpc_vertex_list)); polygon.Contour[i] = new VertexList(); polygon.Contour[i].NofVertices = gpc_vtx_list.num_vertices; polygon.Contour[i].Vertex = new Vertex[polygon.Contour[i].NofVertices]; IntPtr ptr2 = gpc_vtx_list.vertex; for (int j = 0; j < polygon.Contour[i].NofVertices; j++) { NativeStructs.gpc_vertex gpc_vtx = (NativeStructs.gpc_vertex)Marshal.PtrToStructure(ptr2, typeof(NativeStructs.gpc_vertex)); polygon.Contour[i].Vertex[j].X = gpc_vtx.x; polygon.Contour[i].Vertex[j].Y = gpc_vtx.y; ptr2 = (IntPtr)(((int)ptr2) + Marshal.SizeOf(gpc_vtx)); } ptr = (IntPtr)(((int)ptr) + Marshal.SizeOf(gpc_vtx_list)); } return polygon; }
internal static extern bool SetupDiGetDeviceInstanceIdW( IntPtr DeviceInfoSet, ref NativeStructs.SP_DEVINFO_DATA DeviceInfoData, IntPtr DeviceInstanceId, uint DeviceInstanceIdSize, out uint RequiredSize);
private static void Free_gpc_polygon(NativeStructs.gpc_polygon gpc_pol) { Marshal.FreeCoTaskMem(gpc_pol.hole); IntPtr ptr = gpc_pol.contour; for (int i = 0; i < gpc_pol.num_contours; i++) { NativeStructs.gpc_vertex_list gpc_vtx_list = (NativeStructs.gpc_vertex_list)Marshal.PtrToStructure(ptr, typeof(NativeStructs.gpc_vertex_list)); Marshal.FreeCoTaskMem(gpc_vtx_list.vertex); ptr = (IntPtr)(((int)ptr) + Marshal.SizeOf(gpc_vtx_list)); } }
internal static extern int WinVerifyTrust( IntPtr hWnd, ref Guid pgActionID, ref NativeStructs.WINTRUST_DATA pWinTrustData );
public static extern IntPtr GetClientRect(IntPtr hWnd, ref NativeStructs.RECT rect);