Click here to Skip to main content
15,913,685 members
Home / Discussions / C#
   

C#

 
Generalmerging halftoned images Pin
Member 7466529-Sep-04 6:40
Member 7466529-Sep-04 6:40 
GeneralMerge halftone images Pin
Anonymous9-Sep-04 6:21
Anonymous9-Sep-04 6:21 
QuestionIntegrating A Custom Editor Within VS IDE 2003... Possible? Pin
Nailbite9-Sep-04 5:25
Nailbite9-Sep-04 5:25 
GeneralMaster-Child DataGrid Filter Issue: Winform DataGrid Pin
Looney Tunezez9-Sep-04 4:50
Looney Tunezez9-Sep-04 4:50 
GeneralClearing the clipboard Pin
Garrick Hensberg9-Sep-04 4:36
Garrick Hensberg9-Sep-04 4:36 
GeneralRe: Clearing the clipboard Pin
Dave Kreskowiak9-Sep-04 5:44
mveDave Kreskowiak9-Sep-04 5:44 
GeneralTo minimize all opened windows Pin
Chauhan9-Sep-04 2:59
Chauhan9-Sep-04 2:59 
GeneralRe: To minimize all opened windows Pin
Nick Parker9-Sep-04 3:46
protectorNick Parker9-Sep-04 3:46 
Yes, however you will need to P/Invoke several Win32 functions. Your P/Invoke statements will look like the following:

const Int32 SW_HIDE = 0 ;
const Int32 SW_SHOWNORMAL = 1 ;
const Int32 SW_NORMAL = 1 ;
const Int32 SW_SHOWMINIMIZED = 2 ;
const Int32 SW_SHOWMAXIMIZED = 3 ;
const Int32 SW_MAXIMIZE = 3 ;
const Int32 SW_SHOWNOACTIVATE = 4 ;
const Int32 SW_SHOW = 5 ;
const Int32 SW_MINIMIZE = 6 ;
const Int32 SW_SHOWMINNOACTIVE = 7 ;
const Int32 SW_SHOWNA = 8 ;
const Int32 SW_RESTORE = 9 ;
const Int32 SW_SHOWDEFAULT = 10 ;
const Int32 SW_FORCEMINIMIZE = 11 ;
const Int32 SW_MAX = 11 ;

[DllImport("user32.dll")]
static extern int ShowWindow(IntPtr hWnd, int nCmdShow);

[DllImport("user32.dll")]
static extern bool EnumWindows(EnumWindowsProc lpEnumFunc, IntPtr lParam);
delegate bool EnumWindowsProc(IntPtr hWnd, IntPtr lParam);
[DllImport("user32.dll")]
static extern bool IsWindowVisible(IntPtr hWnd);


The implementation part would look something like this if you were invoking this from a button click:
private void bClick(object sender, EventArgs e)
{
    EnumWindowsProc proc = new EnumWindowsProc(MinimizeWindow);
    EnumWindows(proc, IntPtr.Zero);
}

private bool MinimizeWindow(IntPtr hWnd, IntPtr lParam)
{
    if(IsWindowVisible(hWnd))
        ShowWindow(hWnd, SW_SHOWMINIMIZED);
    return true;
}


- Nick Parker
My Blog | My Articles

Generalnumeric updown column in datagrid Pin
9-Sep-04 1:32
suss9-Sep-04 1:32 
GeneralAPI Calls Pin
Member 368639-Sep-04 1:25
Member 368639-Sep-04 1:25 
GeneralRe: API Calls Pin
Nick Parker9-Sep-04 3:58
protectorNick Parker9-Sep-04 3:58 
QuestionHow to use COM DLL in ASP.NET using C# Pin
zahid_ash9-Sep-04 0:39
zahid_ash9-Sep-04 0:39 
AnswerRe: How to use COM DLL in ASP.NET using C# Pin
Dave Kreskowiak9-Sep-04 5:32
mveDave Kreskowiak9-Sep-04 5:32 
GeneralA simple FileSystemWatcher Question ( How to see if file has copied) Pin
Capriono9-Sep-04 0:29
Capriono9-Sep-04 0:29 
GeneralRe: A simple FileSystemWatcher Question ( How to see if file has copied) Pin
Pradeep Shamarao9-Sep-04 3:11
Pradeep Shamarao9-Sep-04 3:11 
GeneralRe: A simple FileSystemWatcher Question ( How to see if file has copied) Pin
mav.northwind9-Sep-04 5:30
mav.northwind9-Sep-04 5:30 
GeneralDelay Pin
erina5488-Sep-04 22:53
erina5488-Sep-04 22:53 
GeneralRe: Delay Pin
sreejith ss nair8-Sep-04 22:56
sreejith ss nair8-Sep-04 22:56 
GeneralDo User Control Pin
jzb8-Sep-04 21:40
jzb8-Sep-04 21:40 
GeneralRe: Do User Control Pin
sreejith ss nair8-Sep-04 22:53
sreejith ss nair8-Sep-04 22:53 
Generalcomparing date in database Pin
xiaowenjie8-Sep-04 20:32
xiaowenjie8-Sep-04 20:32 
GeneralRe: comparing date in database Pin
sreejith ss nair8-Sep-04 21:15
sreejith ss nair8-Sep-04 21:15 
GeneralRe: comparing date in database Pin
Anonymous8-Sep-04 22:34
Anonymous8-Sep-04 22:34 
GeneralRe: comparing date in database Pin
sreejith ss nair8-Sep-04 22:44
sreejith ss nair8-Sep-04 22:44 
GeneralGood tool for developer! Pin
tianzj8-Sep-04 17:27
tianzj8-Sep-04 17:27 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.