Пример #1
0
        private unsafe void button51_Click(object sender, EventArgs e)
        {
            StringBuilder        sb        = new StringBuilder(100);
            int                  count     = Win32API.GetClassName(this.Handle, sb, 100);
            WndClassFromUnmanged wc        = new WndClassFromUnmanged();
            bool                 result    = Win32API.GetClassInfo(Program.hInstance, sb.ToString(), ref wc);
            Delegate             d         = Marshal.GetDelegateForFunctionPointer(wc.lpfnWndProc, typeof(WndProc));
            string               className = Marshal.PtrToStringAuto(wc.lpszClassName);
            string               menuName  = Marshal.PtrToStringAuto(wc.lpszMenuName);

            Console.WriteLine(result);
        }
Пример #2
0
 public static extern bool GetClassInfo(IntPtr hlnst, string lpszClass, ref WndClassFromUnmanged lpWndClass);