PDA

View Full Version : ShowWindow



amir_civil
یک شنبه 14 خرداد 1385, 17:42 عصر
سلام دوستان
کسی میتونه یه مثال از کاربرد دستورهای زیر در سی# بزنه

FindWindow....ShowWindow
ممنون

محمد میرمصطفی
سه شنبه 16 خرداد 1385, 14:36 عصر
class

NativeMethods



{


public const int SW_ERASE = 4;



public const int SW_HIDE = 0;



public const int SW_INVALIDATE = 2;



public const int SW_MAX = 10;



public const int SW_MAXIMIZE = 3;



public const int SW_MINIMIZE = 6;



public const int SW_NORMAL = 1;



public const int SW_RESTORE = 9;



public const int SW_SCROLLCHILDREN = 1;



public const int SW_SHOW = 5;



public const int SW_SHOWMAXIMIZED = 3;



public const int SW_SHOWMINIMIZED = 2;



public const int SW_SHOWMINNOACTIVE = 7;



public const int SW_SHOWNA = 8;



public const int SW_SHOWNOACTIVATE = 4;



public const int SW_SMOOTHSCROLL = 0x10;


}


classProgram



{

[


DllImport("user32.dll")]



private static extern bool ShowWindow(IntPtr hWnd, int nCmdShow);



[

DllImport("user32.dll")]



private static extern IntPtr FindWindow(string className, string text);



static void Main(string[] args)



{


Thread.Sleep(1000);


ShowWindow(FindWindow(null, Console.Title), NativeMethods.SW_HIDE);




Thread.Sleep(5000);



ShowWindow(FindWindow(null, Console.Title), NativeMethods.SW_SHOW);



Console.ReadKey();



}

}

Milad Mohseny
سه شنبه 16 خرداد 1385, 22:08 عصر
آقای محمد میرمصطفی ممنون ما هم از پاسخ استفاده کردیم .

amir_civil
سه شنبه 16 خرداد 1385, 23:26 عصر
سلام
واقعا ممنون