14 Kasım 2015 Cumartesi

C# masaüstü yüklenmesini bekleme

 [DllImport("user32.dll", SetLastError = true)]
        static extern IntPtr FindWindow(string lpClassName, string lpWindowName);

        // wait until desktop ready

        IntPtr lHwnd = IntPtr.Zero;
        do
        {
            lHwnd = FindWindow("Shell_TrayWnd", null);
            Thread.Sleep(100);
        } while (lHwnd == IntPtr.Zero);