示例#1
0
        /// <summary>
        /// Converts the IntPtr to a hexadecimal string in the native pointer size of the processor.
        /// </summary>
        /// <param name="pointer">The pointer.</param>
        /// <returns></returns>
        public static string ToHexString(this System.IntPtr pointer)
        {
            if (System.IntPtr.Size == 8)
            {
                return(pointer.ToString("X16"));
            }

            return(pointer.ToString("X8"));
        }
    static internal bool PostMessage(System.IntPtr hWnd, int Msg, int wParam, long lParam)
    {
        System.Diagnostics.Debug.WriteLine(hWnd.ToString("X16") + " : " + Msg.ToString("X16") + " : " + wParam.ToString("X16") + " : " + lParam.ToString("X16"));
        x = x + 1;
        if (x == 30)
        {
            System.Diagnostics.Debug.WriteLine("---------");
        }
        bool result = false;

        try
        {
            result = UnSafeNativeMethods.PostMessage(hWnd, (uint)Msg, wParam, lParam);
        }
        catch (System.Exception ex)
        {
            OnWin32Error(ex);
            result = false;
        }
        return(result);
    }
示例#3
0
 public static void WriteOffset(string name, System.IntPtr offset, bool netvar = false)
 {
     WriteSuccess($"  \t{name}\t0x{offset.ToString("X").PadLeft(netvar ? 4 : 8, '0')}", offset != System.IntPtr.Zero);
 }
 public override string ToString()
 {
     return(m_HServerListRequest.ToString());
 }
示例#5
0
 public static void WriteOffset(string name, System.IntPtr offset)
 {
     WriteSuccess($"  \t{name}\t0x{offset.ToString("X").PadLeft(8, '0')}", offset != System.IntPtr.Zero);
 }
 private static void TestCallback(System.IntPtr p)
 {
     System.Console.Error.WriteLine("From TestCallback");
     System.Console.Error.WriteLine(System.String.Format("p: {0}", p.ToString()));
 }
 public override string ToString() => ListRequest.ToString();