static internal extern /*SQLRETURN*/ODBC32.RetCode SQLBindCol( /*SQLHSTMT*/OdbcStatementHandle StatementHandle, /*SQLUSMALLINT*/UInt16 ColumnNumber, /*SQLSMALLINT*/ODBC32.SQL_C TargetType, /*SQLPOINTER*/HandleRef TargetValue, /*SQLLEN*/IntPtr BufferLength, /*SQLLEN* */IntPtr StrLen_or_Ind);
protected ChipmunkObject(IntPtr ptr, bool refcount = true) { Handle = new HandleRef (this, ptr); this.refcount = refcount; if (refcount) AddRef (this, ptr); }
internal CompilationMutex(String name, String comment) { #if !FEATURE_PAL // No unmanaged aspnet_isapi mutex in Coriolis // Attempt to get the mutex string from the registry (VSWhidbey 415795) string mutexRandomName = (string) Misc.GetAspNetRegValue("CompilationMutexName", null /*valueName*/, null /*defaultValue*/); if (mutexRandomName != null) { // If we were able to use the registry value, use it. Also, we need to prepend "Global\" // to the mutex name, to make sure it can be shared between a terminal server session // and IIS (VSWhidbey 307523). _name += @"Global\" + name + "-" + mutexRandomName; } else { // If we couldn't get the reg value, don't use it, and prepend "Local\" to the mutex // name to make it local to the session (and hence prevent hijacking) _name += @"Local\" + name; } _comment = comment; Debug.Trace("Mutex", "Creating Mutex " + MutexDebugName); _mutexHandle = new HandleRef(this, UnsafeNativeMethods.InstrumentedMutexCreate(_name)); if (_mutexHandle.Handle == IntPtr.Zero) { Debug.Trace("Mutex", "Failed to create Mutex " + MutexDebugName); throw new InvalidOperationException(SR.GetString(SR.CompilationMutex_Create)); } Debug.Trace("Mutex", "Successfully created Mutex " + MutexDebugName); #endif // !FEATURE_PAL }
public static IntPtr GetWindowLong(HandleRef hWnd, Win32Native.WindowLongType index) { if (IntPtr.Size == 4) return Win32Native.GetWindowLong32(hWnd, index); else return Win32Native.GetWindowLong64(hWnd, index); }
internal static extern void TurnBasedMultiplayerManager_ShowPlayerSelectUI( HandleRef self, /* from(uint32_t) */ uint minimum_players, /* from(uint32_t) */ uint maximum_players, [MarshalAs(UnmanagedType.I1)] /* from(bool) */ bool allow_automatch, /* from(TurnBasedMultiplayerManager_PlayerSelectUICallback_t) */ PlayerSelectUICallback callback, /* from(void *) */ IntPtr callback_arg);
internal static void Register(HandleRef unmanaged) { lock (Instance) { Instance.RegisterImpl(unmanaged); } }
internal static extern void LeaderboardManager_FetchScorePage( HandleRef self, /* from(DataSource_t) */ Types.DataSource data_source, /* from(ScorePage_ScorePageToken_t) */ IntPtr token, /* from(uint32_t) */ uint max_results, /* from(LeaderboardManager_FetchScorePageCallback_t) */ FetchScorePageCallback callback, /* from(void *) */ IntPtr callback_arg);
protected override HandleRef BuildWindowCore(HandleRef hwndParent) { DestroyHost(); _host = new WinFormsAvaloniaControlHost {Content = _content}; UnmanagedMethods.SetParent(_host.Handle, hwndParent.Handle); return new HandleRef(this, _host.Handle); }
internal static extern void RealTimeMultiplayerManager_SendUnreliableMessage( HandleRef self, /* from(RealTimeRoom_t) */IntPtr room, /* from(MultiplayerParticipant_t const *) */IntPtr[] participants, /* from(size_t) */UIntPtr participants_size, /* from(uint8_t const *) */byte[] data, /* from(size_t) */UIntPtr data_size);
public static extern int SHGetFolderLocation( HandleRef hwndOwner, int nFolder, IntPtr hToken, int dwReserved, out IntPtr ppidl );
public RazorBitmapFormAntiparents() { InitializeComponent(); this.SetStyle(ControlStyles.DoubleBuffer, false); this.SetStyle(ControlStyles.UserPaint, true); this.SetStyle(ControlStyles.AllPaintingInWmPaint, true); this.SetStyle(ControlStyles.Opaque, true); SimpleParticlesWorld.Size = this.ClientSize; this.task = Task.Factory.StartNew(() => { using (Graphics graphics = this.CreateGraphics()) { IntPtr hdc = IntPtr.Zero; try { hdc = graphics.GetHdc(); HandleRef handleRef = new HandleRef(graphics, hdc); while (!this.IsTerminate) { this.commonStopwatch.Restart(); this.updateStopwatch.Restart(); SimpleParticlesWorld.Update(); this.updateTime = this.updateStopwatch.ElapsedMilliseconds; this.renderStopwatch.Restart(); Array.Clear(this.array, 0, this.array.Length); SimpleParticle particle; int pointBase; for (int i = SimpleParticlesWorld.Particles.Count - 1; i >= 0; --i) { particle = SimpleParticlesWorld.Particles[i]; //foreach (SimpleParticle particle in SimpleParticlesWorld.Particles) //{ pointBase = (this.size.Height - (int)particle.y) * this.size.Width + (int)particle.x; if (0 <= pointBase && pointBase < this.array.Length) { this.array[pointBase] = particle.c; } } SetDIBitsToDevice(handleRef, 0, 0, this.size.Width, this.size.Height, 0, 0, 0, this.size.Height, ref this.array[0], ref this.bitmapInfo, 0); this.renderTime = this.renderStopwatch.ElapsedMilliseconds; this.commonTime = this.commonStopwatch.ElapsedMilliseconds; } } finally { if (hdc != IntPtr.Zero) { graphics.ReleaseHdc(hdc); } } } }); }
/// <summary> /// コントロール作成 /// </summary> /// <param name="hwndParent">親ウィンドウ</param> /// <returns> /// 作成されたコントロールの HandleRef /// </returns> protected override HandleRef BuildWindowCore(HandleRef hwndParent) { Dispatcher.ShutdownStarted += DispatcherOnShutdownStarted; return new HandleRef(this, _wnd.CreateWindow(hwndParent.Handle) ); }
//private static readonly int CDINDEX_ID_LEN = 28; //private static readonly int ID_LEN = 36; public Client() { handle = new HandleRef(this, mb_New()); UseUtf8 = true; AutoSetProxy(); }
protected override HandleRef BuildWindowCore(HandleRef hwndParent) { // Let our base class create the standard window. We will simply // use it as the parent of our HwndSource. // HandleRef hwndChild = base.BuildWindowCore(hwndParent); HwndSourceParameters? optCreationParameters = CreationParameters; if (_thread != null) { // Asynchronously create the HwndSource on the worker thread. _thread.Dispatcher.BeginInvoke((Action)delegate { _hwndSource = CreateHwndSource(optCreationParameters, hwndParent.Handle); }); } else { // Synchronously create the HwndSource on the UI thread. _hwndSource = CreateHwndSource(optCreationParameters, hwndParent.Handle); } UpdateRootVisual(Source); return new HandleRef(this,_hwndSource.Handle); }
public Font( Type font ) { IntPtr fontHandle; switch( font ) { case Type.Small: fontHandle = GDImport.gdFontGetSmall(); break; case Type.Large: fontHandle = GDImport.gdFontGetLarge(); break; case Type.MediumBold: fontHandle = GDImport.gdFontGetMediumBold(); break; case Type.Giant: fontHandle = GDImport.gdFontGetGiant(); break; case Type.Tiny: fontHandle = GDImport.gdFontGetTiny(); break; default: throw new ApplicationException( font + " is no valid font." ); } if( fontHandle == IntPtr.Zero ) throw new ApplicationException( "The font retrieval failed." ); this.handle = new HandleRef( this, fontHandle ); }
public static void SendStopMessage(this Process process) { Debug.Assert(process != null); try { if (!process.HasExited) { var processId = process.Id; for (var ptr = NativeMethods.GetTopWindow(IntPtr.Zero); ptr != IntPtr.Zero; ptr = NativeMethods.GetWindow(ptr, 2)) { uint num; NativeMethods.GetWindowThreadProcessId(ptr, out num); if (processId == num) { var hWnd = new HandleRef(null, ptr); NativeMethods.PostMessage(hWnd, 0x12, IntPtr.Zero, IntPtr.Zero); return; } } } } catch (InvalidOperationException) { } catch (ArgumentException) { } }
/// Drawing methods. /// <devdoc> /// </devdoc> public void DrawPie(WindowsPen pen, Rectangle bounds, float startAngle, float sweepAngle) { HandleRef hdc = new HandleRef( this.dc, this.dc.Hdc); if( pen != null ) { // 1. Select the pen in the DC IntUnsafeNativeMethods.SelectObject(hdc, new HandleRef(pen, pen.HPen)); } // 2. call the functions // we first draw a path that goes : // from center of pie, draw arc (this draw the line to the beginning of the arc // then, draw the closing line. // paint the path with the pen int sideLength = Math.Min(bounds.Width, bounds.Height); Point p = new Point(bounds.X+sideLength/2, bounds.Y+sideLength/2); int radius = sideLength/2; IntUnsafeNativeMethods.BeginPath(hdc); IntUnsafeNativeMethods.MoveToEx(hdc, p.X, p.Y, null); IntUnsafeNativeMethods.AngleArc(hdc, p.X, p.Y, radius, startAngle, sweepAngle); IntUnsafeNativeMethods.LineTo(hdc, p.X, p.Y); IntUnsafeNativeMethods.EndPath(hdc); IntUnsafeNativeMethods.StrokePath(hdc); }
protected override HandleRef BuildWindowCore(HandleRef hwndParent) { m_msgMng.m_hwndGLParent = IntPtr.Zero; m_msgMng.m_hwndGLParent = CreateWindowEx( 0, "static", "", WS_CHILD | WS_VISIBLE, 0, 0, m_hostWidth, m_hostHeight, hwndParent.Handle, (IntPtr)HOST_ID, IntPtr.Zero, 0); string strRunMode; if (MainWindow.s_pW.m_isDebug) { strRunMode = "true"; } else { strRunMode = "false"; } m_process = System.Diagnostics.Process.Start( MainWindow.s_pW.m_pathGlApp, m_hostWidth.ToString() + " " + m_hostHeight.ToString() + " " + m_msgMng.m_hwndGLParent.ToString() + " " + strRunMode); return new HandleRef(this, m_msgMng.m_hwndGLParent); }
internal static void Unregister(HandleRef unmanaged) { lock (Instance) { Instance.UnregisterImpl(unmanaged.Handle); } }
//�ΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡξ����ȡ���� public static IntPtr GetDesktopHandle(DesktopLayer layer,Form targetForm) { //hWnd = new HandleRef(); HandleRef hWnd; IntPtr m_ptDesktop = new IntPtr(); switch (layer) { case DesktopLayer.Progman: m_ptDesktop = EmbedFormApi.FindWindow(m_stProgman, null);//��һ������ break; case DesktopLayer.SHELLDLL: m_ptDesktop = EmbedFormApi.FindWindow(m_stProgman, null);//��һ������ hWnd = new HandleRef(targetForm, m_ptDesktop); m_ptDesktop = EmbedFormApi.GetWindow(hWnd, GW_CHILD);//��2������ break; case DesktopLayer.FolderView: m_ptDesktop = EmbedFormApi.FindWindow(m_stProgman, null);//��һ������ hWnd = new HandleRef(targetForm, m_ptDesktop); m_ptDesktop = EmbedFormApi.GetWindow(hWnd, GW_CHILD);//��2������ hWnd = new HandleRef(targetForm, m_ptDesktop); m_ptDesktop = EmbedFormApi.GetWindow(hWnd, GW_CHILD);//��3������ break; } return m_ptDesktop; }
internal static extern void SnapshotManager_Open( HandleRef self, /* from(DataSource_t) */ Types.DataSource data_source, /* from(char const *) */ string file_name, /* from(SnapshotConflictPolicy_t) */ Types.SnapshotConflictPolicy conflict_policy, /* from(SnapshotManager_OpenCallback_t) */ OpenCallback callback, /* from(void *) */ IntPtr callback_arg);
protected void HideCheckBox(TV_ITEM tv_item) { if (tv_item.ItemHandle != IntPtr.Zero) { // get TreeNode-object, that corresponds to TV_ITEM-object TreeNode currentTN = TreeNode.FromHandle(this, tv_item.ItemHandle); HiddenCheckBoxTreeNode hiddenCheckBoxTreeNode = currentTN as HiddenCheckBoxTreeNode; // check if it's HiddenCheckBoxTreeNode and // if its checkbox already has been hidden if (hiddenCheckBoxTreeNode != null) { HandleRef treeHandleRef = new HandleRef(this, Handle); // check if checkbox already has been hidden TV_ITEM currentTvItem = new TV_ITEM(); currentTvItem.ItemHandle = tv_item.ItemHandle; currentTvItem.StateMask = TVIS_STATEIMAGEMASK; currentTvItem.State = 0; IntPtr res = SendMessage(treeHandleRef, TVM_GETITEM, 0, ref currentTvItem); bool needToHide = res.ToInt32() > 0 && currentTvItem.State != 0; if (needToHide) { // specify attributes to update TV_ITEM updatedTvItem = new TV_ITEM(); updatedTvItem.ItemHandle = tv_item.ItemHandle; updatedTvItem.Mask = TVIF_STATE; updatedTvItem.StateMask = TVIS_STATEIMAGEMASK; updatedTvItem.State = 0; // send TVM_SETITEM message SendMessage(treeHandleRef, TVM_SETITEM, 0, ref updatedTvItem); } } } }
public static IntPtr SetWindowLong(HandleRef hwnd, Win32Native.WindowLongType index, IntPtr wndProcPtr) { if (IntPtr.Size == 4) return Win32Native.SetWindowLong32(hwnd, index, wndProcPtr); else return Win32Native.SetWindowLongPtr64(hwnd, index, wndProcPtr); }
// impersonate a given token protected void ImpersonateToken(HandleRef token) { try { // first revert _savedToken = new HandleRef(this, GetCurrentToken()); if (_savedToken.Handle != IntPtr.Zero) { if (UnsafeNativeMethods.RevertToSelf() != 0) { _reverted = true; } } // impersonate token if not zero if (token.Handle != IntPtr.Zero) { if (UnsafeNativeMethods.SetThreadToken(IntPtr.Zero, token.Handle) == 0) { throw new HttpException(SR.GetString(SR.Cannot_impersonate)); } _impersonating = true; } } catch { RestoreImpersonation(); throw; } }
protected override HandleRef BuildWindowCore(HandleRef hwndParent) { if (m_classAtom == 0) { WNDCLASS wind_class = new WNDCLASS { lpszClassName = ClassName, lpfnWndProc = WndProcPtr, }; m_classAtom = Import.RegisterClassW(ref wind_class); } // create window Hwnd = Import.CreateWindowExW( 0, // ex flag ClassName, "EmptyHwndTitle", WS.WS_CHILD, Import.CW_USEDEFAULT, Import.CW_USEDEFAULT, Import.CW_USEDEFAULT, Import.CW_USEDEFAULT, hwndParent.Handle, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero ); LostMouseCapture += EmptyHwnd_LostMouseCapture; return new HandleRef(this, Hwnd); }
public Profile(string path) { Handle = new HandleRef (this, NativeMethods.CmsOpenProfileFromFile (path, "r")); if (Handle.Handle == IntPtr.Zero) throw new CmsException ("Error opening ICC profile in file " + path); }
// This static method is required because legacy OSes do not support // SetWindowLongPtr internal static IntPtr SetWindowLongPtr(HandleRef hWnd, int nIndex, IntPtr dwNewLong) { if (IntPtr.Size == 8) return SetWindowLongPtr64(hWnd, nIndex, dwNewLong); else return new IntPtr(SetWindowLong32(hWnd, nIndex, dwNewLong.ToInt32())); }
protected override HandleRef BuildWindowCore(HandleRef hwndParent) { HwndListBox = IntPtr.Zero; _hwndHost = IntPtr.Zero; _hwndHost = CreateWindowEx(0, "static", "", WsChild | WsVisible, 0, 0, _hostHeight, _hostWidth, hwndParent.Handle, (IntPtr) HostId, IntPtr.Zero, 0); HwndListBox = CreateWindowEx(0, "listbox", "", WsChild | WsVisible | LbsNotify | WsVscroll | WsBorder, 0, 0, _hostHeight, _hostWidth, _hwndHost, (IntPtr) ListboxId, IntPtr.Zero, 0); return new HandleRef(this, _hwndHost); }
public TesseractEngine(string datapath, string language, EngineMode engineMode = EngineMode.Default) { DefaultPageSegMode = PageSegMode.Auto; handle = new HandleRef(this, Interop.TessApi.BaseApiCreate()); Initialise(datapath, language, engineMode); }
private void Dispose(bool disposing) { if (_savedToken.Handle != IntPtr.Zero) { try {} finally { UnsafeNativeMethods.CloseHandle(_savedToken.Handle); _savedToken = new HandleRef(this, IntPtr.Zero); } } }
protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr) { Interop.Touch.DeleteTouch(swigCPtr); }
protected virtual void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr) { Interop.FlexLayout.DeleteFlexLayout(swigCPtr); }
protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr) { Interop.VideoView.delete_VideoView(swigCPtr); }
protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr) { Interop.TableView.delete_TableView_CellPosition(swigCPtr); }
protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr) { Interop.CameraView.DeleteCameraView(swigCPtr); }
public static unsafe void RichTextBox_SetScrollPos(HWND handle, int x, int y) { Win32.POINT point = new Win32.POINT(x, y); Win32.SendMessage(handle, Win32.EM_SETSCROLLPOS, new IntPtr(0), new IntPtr(&point)); }
protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr) { Interop.ScrollBar.DeleteScrollBar(swigCPtr); }
protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr) { Interop.PropertyNotification.DeletePropertyNotification(swigCPtr); }
protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr) { Interop.CubeTransitionFoldEffect.DeleteCubeTransitionFoldEffect(swigCPtr); }
protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr) { Interop.Image.delete_Image(swigCPtr); }
protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr) { delete_SlotObserver(swigCPtr); }
/// This will not be public opened. protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr) { Interop.Window.DeleteWindow(swigCPtr); }
public static extern bool SetScrollPos(HWND hWnd, int nBar, int nPos, int bRedraw);
protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr) { Interop.KeyboardEventSignalType.DeleteKeyboardEventSignalType(swigCPtr); }
public static extern void DestroyWindow(HWND hwnd);
protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr) { //throw new global::System.MethodAccessException("C++ destructor does not have public access"); }
public static extern IntPtr SendMessage(HWND hWnd, uint Msg, int wParam, int lParam);
protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr) { }
protected override void DestroyWindowCore(System.Runtime.InteropServices.HandleRef hwnd) { }
public static extern int PostMessage(HWND hwnd, uint wMsg, IntPtr wParam, IntPtr lParam);
protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr) { Interop.GaussianBlurView.DeleteGaussianBlurView(swigCPtr); }
public static extern bool ShowWindow(HWND hwnd, int cmd);
protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr) { Interop.Adaptor.delete_Adaptor(swigCPtr); }
public static extern int LockWindowUpdate(HWND hwnd);
public static extern bool GetScrollRange(HWND hWnd, int nBar, out int lpMinPos, out int lpMaxPos);
public static extern int GetScrollPos(HWND hWnd, int nBar);
protected override System.Runtime.InteropServices.HandleRef BuildWindowCore(System.Runtime.InteropServices.HandleRef hwndParent) { _wpfContentHost = new HwndSource(new HwndSourceParameters() { ParentWindow = hwndParent.Handle, WindowStyle = Win32Helper.WS_CHILD | Win32Helper.WS_VISIBLE | Win32Helper.WS_CLIPSIBLINGS | Win32Helper.WS_CLIPCHILDREN, Width = 1, Height = 1 }); _rootPresenter = new Border() { Child = new AdornerDecorator() { Child = Content }, Focusable = true }; _rootPresenter.SetBinding(Border.BackgroundProperty, new Binding("Background") { Source = _owner }); _wpfContentHost.RootVisual = _rootPresenter; _wpfContentHost.SizeToContent = SizeToContent.Manual; _manager = _owner.Model.Root.Manager; ((ILogicalChildrenContainer)_manager).InternalAddLogicalChild(_rootPresenter); return(new HandleRef(this, _wpfContentHost.Handle)); }
public static extern int GetScrollInfo(HWND hWnd, int nBar, ref SCROLLINFO lpsi);
/// <summary> /// Dispose /// </summary> /// <since_tizen> 3 </since_tizen> protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr) { Interop.ActivatedSignalType.DeleteActivatedSignalType(swigCPtr); }
protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr) { Interop.ObjectRegistry.DeleteObjectRegistry(swigCPtr); }