本文整理汇总了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);
}
示例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();
}
}
}
示例3: TrustItem
internal TrustItem(IntPtr itemPtr)
{
if (itemPtr.Equals(IntPtr.Zero))
throw new InvalidPtrException("An invalid trust item pointer has been supplied.");
UpdateFromMem(itemPtr);
}
示例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;
}
示例5: FromPointer
internal static RealtimeRoomConfig FromPointer(IntPtr selfPointer) {
if (selfPointer.Equals(IntPtr.Zero)) {
return null;
}
return new RealtimeRoomConfig(selfPointer);
}
示例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;
}
示例7: FromPointer
internal static NativeRealTimeRoom FromPointer(IntPtr selfPointer) {
if (selfPointer.Equals(IntPtr.Zero)) {
return null;
}
return new NativeRealTimeRoom(selfPointer);
}
示例8: FromPointer
internal static FetchForPlayerResponse FromPointer(IntPtr pointer)
{
if (pointer.Equals(IntPtr.Zero)) {
return null;
}
return new FetchForPlayerResponse(pointer);
}
示例9: EventWaitHandle
// Methods
private EventWaitHandle(IntPtr aHandle)
{
if (aHandle.Equals(IntPtr.Zero))
{
throw new WaitHandleCannotBeOpenedException();
}
Handle = aHandle;
}
示例10: FromPointer
internal static NativeLeaderboard FromPointer(IntPtr pointer)
{
if (pointer.Equals(IntPtr.Zero))
{
return null;
}
return new NativeLeaderboard(pointer);
}
示例11: FromPointer
internal static NativeScoreSummary FromPointer(IntPtr pointer)
{
if (pointer.Equals(IntPtr.Zero))
{
return null;
}
return new NativeScoreSummary(pointer);
}
示例12: FromPointer
internal static NativeEndpointDetails FromPointer(IntPtr pointer)
{
if (pointer.Equals(IntPtr.Zero))
{
return null;
}
return new NativeEndpointDetails(pointer);
}
示例13: Connect
public bool Connect()
{
device = HidAPI.hid_open_path(path);
if (!device.Equals(IntPtr.Zero))
{
DoConnected();
return true;
}
return false;
}
示例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);
}
示例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;
}