hi
I want to prevent my window application from hide and minimize, when we click on show desktop my application is hide,so is there any way to prevent it.
I searched lot but the proper answer is not getting from any forum.
so any one can help me in this topic!
Loading
RomaricPosted Nov 3, 2011, 10:19 AM
While working on a calendar "glued to the desktop", I ran into the same problem.
Here is a working solution:
/************ win32 interop stuff ****************/
[DllImport( "user32.dll", SetLastError = true )]
static extern int SetWindowLong( IntPtr hWnd, int nIndex, IntPtr dwNewLong );
[DllImport( "user32.dll", SetLastError = true )]
static extern IntPtr FindWindow( string lpWindowClass, string lpWindowName );
[DllImport( "user32.dll", SetLastError = true )]
static extern IntPtr FindWindowEx( IntPtr parentHandle, IntPtr childAfter, string className, string windowTitle );
const int GWL_HWNDPARENT = -8;
/************* in Form_Load or equivalent ***************/
IntPtr hprog = FindWindowEx(
FindWindowEx(
FindWindow( "Progman", "Program Manager" ),
IntPtr.Zero, "SHELLDLL_DefView", ""
),
IntPtr.Zero, "SysListView32", "FolderView"
);
SetWindowLong( this.Handle, GWL_HWNDPARENT, hprog );
The tricky part was to set the form's owner (SetWindowLong + GWL_HWNDPARENT) instead of the form's parent (SetParent). This fixed the form not being rendered on an aero desktop.
Mandar DeshpandePosted Sep 10, 2009, 5:08 AM
I allready hide minimize buttons, my application don't have border and title bar.
I want to prevent my application from minimize, when user clicks on 'show desktop' icon in quick launch bar or press Win+D.
Roei BarPosted Sep 9, 2009, 3:46 PM
like this:
http://www.codeproject.com/KB/dotnet/DesktopWidget.aspx
active desktop application is not under the rules of the minimize window, its above it.
hope this helps