ConEmu.WinForms.ConEmuControl.TryGetConEmuHwnd C# (CSharp) 메소드

TryGetConEmuHwnd() 개인적인 메소드

private TryGetConEmuHwnd ( ) : void*
리턴 void*
        private void* TryGetConEmuHwnd()
        {
            if(!IsHandleCreated) // Without this check, getting the Handle would cause the control to be loaded, and AutoStartInfo be executed right in the .ctor, because the first call into this func goes in the .ctor
                return null;
            void* hwndConEmu = null;
            WinApi.EnumWindowsProc callback = (hwnd, param) =>
            {
                *((void**)param) = hwnd;
                return 0;
            };
            WinApi.EnumChildWindows((void*)Handle, (void*)Marshal.GetFunctionPointerForDelegate(callback), (IntPtr)(&hwndConEmu));
            GC.KeepAlive(callback);
            return hwndConEmu;
        }