当前位置: 首页>>代码示例>>C#>>正文


C# IntPtr.Equals方法代码示例

本文整理汇总了C#中System.IntPtr.Equals方法的典型用法代码示例。如果您正苦于以下问题:C# IntPtr.Equals方法的具体用法?C# IntPtr.Equals怎么用?C# IntPtr.Equals使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.IntPtr的用法示例。


在下文中一共展示了IntPtr.Equals方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: FromPointer

    internal static NativeSnapshotMetadataChange FromPointer(IntPtr pointer) {
        if (pointer.Equals(IntPtr.Zero)) {
            return null;
        }

        return new NativeSnapshotMetadataChange(pointer);
    }
开发者ID:MichaelLyon,项目名称:Ralphs-Revenge,代码行数:7,代码来源:NativeSnapshotMetadataChange.cs

示例2: Update

        // 子ハンドルのリスト更新
        public void Update()
        {
            hWndList.Clear();
            this.hWnd = GetWindowHandle(windowName);
            if (hWnd.Equals((IntPtr)0))
            {
                this.hWnd = GetWindowHandle(windowName+"*");
                if (hWnd.Equals((IntPtr)0))
                {

                    string str = "\"" + windowName + "\"は起動していません";
                    throw new ApplicationException(str);
                }
                this.windowName = windowName + "*";
            }
            GCHandle listHandle = GCHandle.Alloc(hWndList);
            try
            {
                EnumWindowProc childProc = new EnumWindowProc(EnumWindow);
                EnumChildWindows(hWnd, childProc, GCHandle.ToIntPtr(listHandle));
            }
            finally
            {
                if (listHandle.IsAllocated)
                {
                    listHandle.Free();
                }
            }
        }
开发者ID:blkcatman,项目名称:VoiceroidEx,代码行数:30,代码来源:WindowHandleSearch.cs

示例3: TrustItem

        internal TrustItem(IntPtr itemPtr)
        {
            if (itemPtr.Equals(IntPtr.Zero))
                throw new InvalidPtrException("An invalid trust item pointer has been supplied.");

            UpdateFromMem(itemPtr);
        }
开发者ID:anonghosteam,项目名称:outlook-privacy-plugin,代码行数:7,代码来源:TrustItem.cs

示例4: DocumentFromDOM

        public static IHTMLDocument2 DocumentFromDOM(IntPtr hWnd)
        {
            IHTMLDocument2 document = null;

            int lngMsg = 0;
            int lRes;

            Win32.EnumProc proc = new Win32.EnumProc(DOM.EnumWindows);

            Win32.EnumChildWindows(hWnd, proc, ref hWnd);
            if (!hWnd.Equals(IntPtr.Zero))
            {
                lngMsg = Win32.RegisterWindowMessage("WM_HTML_GETOBJECT");
                if (lngMsg != 0)
                {
                    Win32.SendMessageTimeout(hWnd, lngMsg, 0, 0, Win32.SMTO_ABORTIFHUNG, 1000, out lRes);
                    if (!(bool)(lRes == 0))
                    {
                        int hr = Win32.ObjectFromLresult(lRes, ref Win32.IID_IHTMLDocument2, 0, ref document);
                        if ((bool)(document == null))
                        {
                            //MessageBox.Show("No IHTMLDocument Found!", "Warning");
                            Console.WriteLine("No IHTMLDocument Found!");
                        }
                    }
                }
            }
            return document;
        }
开发者ID:alexhanh,项目名称:Botting-Library,代码行数:29,代码来源:DOM.cs

示例5: FromPointer

    internal static RealtimeRoomConfig FromPointer(IntPtr selfPointer) {
        if (selfPointer.Equals(IntPtr.Zero)) {
            return null;
        }

        return new RealtimeRoomConfig(selfPointer);
    }
开发者ID:MichaelLyon,项目名称:Ralphs-Revenge,代码行数:7,代码来源:RealtimeRoomConfig.cs

示例6: Make

        public bool Make()
        {
            bool flag = false;

                IntPtr ParenthWnd = new IntPtr(0);
                IntPtr EdithWnd = new IntPtr(0);
                // SendMessage(process.MainWindowHandle, 0x112, 0xf060, 0);
               // SendMessage(process.MainWindowHandle, 0x112, 0xf020, 0);
                ParenthWnd = FindWindow(null, "添加新任务");
                //ParenthWnd = FindWindow(null, "硕鼠 Nano v0.4.7.5 正式版");
                SendMessage(ParenthWnd, WM_SYSCOMMAND, SC_CLOSE, 0);
                if (!ParenthWnd.Equals(IntPtr.Zero))
                {
                    //SendMessage(ParenthWnd, WM_SYSCOMMAND, SC_CLOSE, 0);
                    EdithWnd = FindWindowEx(ParenthWnd, EdithWnd, null, "确定");   //获取button句柄
                    if (!EdithWnd.Equals(IntPtr.Zero))
                    {
                        MessageBox.Show("保存存在 ");
                       // SendMessage(EdithWnd, 0xf5, 0xf5, 0);
                        flag = true;
                    }
                    else
                    {
                       // MessageBox.Show("保存按扭不存在 ");
                    }
                }
                else
                {
                    //MessageBox.Show("主窗体不存在 ");

                }
            return flag;
        }
开发者ID:jxb505,项目名称:MyAPP_42508,代码行数:33,代码来源:Jxb2.cs

示例7: FromPointer

    internal static NativeRealTimeRoom FromPointer(IntPtr selfPointer) {
        if (selfPointer.Equals(IntPtr.Zero)) {
            return null;
        }

        return new NativeRealTimeRoom(selfPointer);
    }
开发者ID:JoshuaHassler,项目名称:PMG,代码行数:7,代码来源:NativeRealTimeRoom.cs

示例8: FromPointer

            internal static FetchForPlayerResponse FromPointer(IntPtr pointer)
            {
                if (pointer.Equals(IntPtr.Zero)) {
                    return null;
                }

                return new FetchForPlayerResponse(pointer);
            }
开发者ID:CodingDuff,项目名称:play-games-plugin-for-unity,代码行数:8,代码来源:StatsManager.cs

示例9: EventWaitHandle

 // Methods
 private EventWaitHandle(IntPtr aHandle)
 {
     if (aHandle.Equals(IntPtr.Zero))
     {
         throw new WaitHandleCannotBeOpenedException();
     }
     Handle = aHandle;
 }
开发者ID:slay22,项目名称:TrainstationAdvisor,代码行数:9,代码来源:EventWaitHandle.cs

示例10: FromPointer

 internal static NativeLeaderboard FromPointer(IntPtr pointer)
 {
     if (pointer.Equals(IntPtr.Zero))
     {
         return null;
     }
     return new NativeLeaderboard(pointer);
 }
开发者ID:CenzyGames,项目名称:The-Paper-Boat-SepScenes,代码行数:8,代码来源:NativeLeaderboard.cs

示例11: FromPointer

 internal static NativeScoreSummary FromPointer(IntPtr pointer)
 {
     if (pointer.Equals(IntPtr.Zero))
     {
         return null;
     }
     return new NativeScoreSummary(pointer);
 }
开发者ID:CenzyGames,项目名称:The-Paper-Boat-SepScenes,代码行数:8,代码来源:NativeScoreSummary.cs

示例12: FromPointer

        internal static NativeEndpointDetails FromPointer(IntPtr pointer)
        {
            if (pointer.Equals(IntPtr.Zero))
            {
                return null;
            }

            return new NativeEndpointDetails(pointer);
        }
开发者ID:CenzyGames,项目名称:The-Paper-Boat-SepScenes,代码行数:9,代码来源:NativeEndpointDetails.cs

示例13: Connect

 public bool Connect()
 {
     device = HidAPI.hid_open_path(path);
     if (!device.Equals(IntPtr.Zero))
     {
         DoConnected();
         return true;
     }
     return false;
 }
开发者ID:othane,项目名称:kowhai,代码行数:10,代码来源:Hid.cs

示例14: OutlookWin32Window

 public OutlookWin32Window(string caption, bool isWord)
 {
     _windowsHandle = FindWindow(isWord
         ? "OpusApp"
         : "rctrl_renwnd32", caption);
     if (!_windowsHandle.Equals(IntPtr.Zero) || !caption.EndsWith(" - Message")) return;
     caption = caption.Replace(" - Message", "");
     _windowsHandle = FindWindow(isWord
                                     ? "OpusApp"
                                     : "rctrl_renwnd32", caption);
 }
开发者ID:ProjectECS,项目名称:ECS,代码行数:11,代码来源:OutlookWin32Window.cs

示例15: MetafileCallback

        internal bool MetafileCallback(EmfPlusRecordType recordType, int flags, int dataSize, IntPtr data, PlayRecordCallback callbackData)
        {

            if (!data.Equals(IntPtr.Zero))
            {
                byte[] RecordData = new byte[dataSize];
                Marshal.Copy(data, RecordData, 0, dataSize);
                ProcessRecord(flags, recordType, RecordData);
            }
            return true;
        }
开发者ID:NelsonSantos,项目名称:fyiReporting-Android,代码行数:11,代码来源:EMF.cs


注:本文中的System.IntPtr.Equals方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。