internal static extern IntPtr CreateDIBSection(
     IntPtr hdc,
     ref NativeStructs.BITMAPINFO pbmi,
     uint iUsage,
     out IntPtr ppvBits,
     IntPtr hSection,
     uint dwOffset);
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
		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);
        }
Ejemplo n.º 6
0
 public static extern uint SendInput(uint nInputs, ref NativeStructs.INPUT pInputs, int cbSize);
Ejemplo n.º 7
0
 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);
Ejemplo n.º 8
0
 public static extern IntPtr GetWindowRect(IntPtr hWnd, ref NativeStructs.RECT rect);
Ejemplo n.º 9
0
 public static extern bool ScreenToClient(IntPtr hWnd, ref NativeStructs.Point point);
Ejemplo n.º 10
0
 internal static extern bool SetupDiEnumDeviceInfo(
     IntPtr DeviceInfoSet,
     uint MemberIndex,
     ref NativeStructs.SP_DEVINFO_DATA DeviceInfoData);
Ejemplo n.º 11
0
 internal static extern bool GlobalMemoryStatusEx(ref NativeStructs.MEMORYSTATUSEX lpBuffer);
Ejemplo n.º 12
0
 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);
Ejemplo n.º 18
0
 public static extern bool SystemParametersInfo(NativeConstants.SPI uiAction, int uiParam, ref NativeStructs.RECT pvParam, int fWinIni);
Ejemplo n.º 19
0
 public static extern bool GetCaretPos(ref NativeStructs.POINT point);
Ejemplo n.º 20
0
 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);
Ejemplo n.º 23
0
 internal static extern bool ShellExecuteExW(ref NativeStructs.SHELLEXECUTEINFO lpExecInfo);
 internal static extern bool WinHttpGetIEProxyConfigForCurrentUser(ref NativeStructs.WINHTTP_CURRENT_USER_IE_PROXY_CONFIG pProxyConfig);
Ejemplo n.º 25
0
 internal static extern void GetNativeSystemInfo(ref NativeStructs.SYSTEM_INFO lpSystemInfo);
Ejemplo n.º 26
0
        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;
        }
Ejemplo n.º 27
0
 internal static extern bool SetupDiGetDeviceInstanceIdW(
     IntPtr DeviceInfoSet,
     ref NativeStructs.SP_DEVINFO_DATA DeviceInfoData,
     IntPtr DeviceInstanceId,
     uint DeviceInstanceIdSize,
     out uint RequiredSize);
Ejemplo n.º 28
0
 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));
     }
 }
Ejemplo n.º 29
0
		internal static extern int WinVerifyTrust(
			IntPtr hWnd,
			ref Guid pgActionID,
			ref NativeStructs.WINTRUST_DATA pWinTrustData
			);
Ejemplo n.º 30
0
 public static extern IntPtr GetClientRect(IntPtr hWnd, ref NativeStructs.RECT rect);