Let me be more specific. I own an engineering business where we do extensive hardware and software work. So this is not an instance of a user not knowing how to use the taskbar.
The first thing I do when I set up a PC is set the takbar to always show, never combine as I can't stand combined taskbar icons.
And as another follow up, this issue will apply itself to one program at a time. It is randomly every program, but if it's say Chrome that won't maximize, none of the chrome taskbar icons will maximize, but all of the other taskbar programs will.
Let me be more specific. I own an engineering business where we do extensive hardware and software work. So this is not an instance of a user not knowing how to use the taskbar.
The first thing I do when I set up a PC is set the takbar to always show, never combine as I can't stand combined taskbar icons.
And as another follow up, this issue will apply itself to one program at a time. It is randomly every program, but if it's say Chrome that won't maximize, none of the chrome taskbar icons will maximize, but all of the other taskbar programs will.
Is it possible that there is more than one running instance of the program(s) you are trying to "maximize"?
If so, then just clicking the taskbar icon will not usually restore the previously minimized window because it doesn't know which one you want. For example, if you are running two File Explorer windows and minimize them both, AND if there is not much room on the taskbar (many other programs perhaps) they will occupy the same taskbar position, and you cannot restore those windows with just a mouse click. In this state, the taskbar icon is said to represent a "group" of windows. Here are some keyboard plus mouse shortcuts that may help in this and similar cases. The Ctrl + that you are using is a special case of the first one:
When the taskbar button represents a group of windows:
(a) Hold the Ctrl key down: repeated left-clicks of the mouse on the taskbar button will cycle through each window in the group.
(b) Pressing the Shift key while you right-click the taskbar button will bring up a menu of choices for rearranging all of the group's windows.
When the taskbar button represents just one window:
(a) The same Ctrl + shown above will just restore the window.
(b) The same Shift + shown above will bring up a very different menu - the one with "Minimize", "Maximize", "Restore" etc.
(c) Shift + will bring up another instance (fresh copy) of a program that is already running.
(d) Ctrl + Shift + will do the same thing but the new instance will run with Administrator privileges.
But if your issue is NOT due to multiple instances or a nearly full taskbar then .... Never mind!
How do I get the taskbar to be on top of a maximized window?
Windows 10 taskbar programs won't maximize unless the Ctrl key is pressed
WPF : Maximize window with WindowState Problem (application will hide windows taskbar) - Stack Overflow
How to maximize window without hiding windows taskbar
Videos
So I want the taskbar to be on top of the window, just like when the taskbar is visible when the 'hide taskbar' option is enabled (see example in 2nd image below).
I want my taskbar icons to be always visible, so the 'hide taskbar' option is not an option.
You can set the MaxHeight property of that window to SystemParameters.MaximizedPrimaryScreenHeight using the constructor.
public MainWindow()
{
InitializeComponent();
this.MaxHeight = SystemParameters.MaximizedPrimaryScreenHeight;
}
To continue with my previous remark. I use the following code in my applications (source: Maximizing WPF windows
using WinInterop = System.Windows.Interop;
using System.Runtime.InteropServices;
public MainWindow()
{
InitializeComponent();
winMain.SourceInitialized += new EventHandler(win_SourceInitialized);
}
#region Avoid hiding task bar upon maximalisation
private static System.IntPtr WindowProc(
System.IntPtr hwnd,
int msg,
System.IntPtr wParam,
System.IntPtr lParam,
ref bool handled)
{
switch (msg)
{
case 0x0024:
WmGetMinMaxInfo(hwnd, lParam);
handled = true;
break;
}
return (System.IntPtr)0;
}
void win_SourceInitialized(object sender, EventArgs e)
{
System.IntPtr handle = (new WinInterop.WindowInteropHelper(this)).Handle;
WinInterop.HwndSource.FromHwnd(handle).AddHook(new WinInterop.HwndSourceHook(WindowProc));
}
private static void WmGetMinMaxInfo(System.IntPtr hwnd, System.IntPtr lParam)
{
MINMAXINFO mmi = (MINMAXINFO)Marshal.PtrToStructure(lParam, typeof(MINMAXINFO));
// Adjust the maximized size and position to fit the work area of the correct monitor
int MONITOR_DEFAULTTONEAREST = 0x00000002;
System.IntPtr monitor = MonitorFromWindow(hwnd, MONITOR_DEFAULTTONEAREST);
if (monitor != System.IntPtr.Zero)
{
MONITORINFO monitorInfo = new MONITORINFO();
GetMonitorInfo(monitor, monitorInfo);
RECT rcWorkArea = monitorInfo.rcWork;
RECT rcMonitorArea = monitorInfo.rcMonitor;
mmi.ptMaxPosition.x = Math.Abs(rcWorkArea.left - rcMonitorArea.left);
mmi.ptMaxPosition.y = Math.Abs(rcWorkArea.top - rcMonitorArea.top);
mmi.ptMaxSize.x = Math.Abs(rcWorkArea.right - rcWorkArea.left);
mmi.ptMaxSize.y = Math.Abs(rcWorkArea.bottom - rcWorkArea.top);
}
Marshal.StructureToPtr(mmi, lParam, true);
}
[StructLayout(LayoutKind.Sequential)]
public struct POINT
{
/// <summary>
/// x coordinate of point.
/// </summary>
public int x;
/// <summary>
/// y coordinate of point.
/// </summary>
public int y;
/// <summary>
/// Construct a point of coordinates (x,y).
/// </summary>
public POINT(int x, int y)
{
this.x = x;
this.y = y;
}
}
[StructLayout(LayoutKind.Sequential)]
public struct MINMAXINFO
{
public POINT ptReserved;
public POINT ptMaxSize;
public POINT ptMaxPosition;
public POINT ptMinTrackSize;
public POINT ptMaxTrackSize;
};
void win_Loaded(object sender, RoutedEventArgs e)
{
winMain.WindowState = WindowState.Maximized;
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)]
public class MONITORINFO
{
/// <summary>
/// </summary>
public int cbSize = Marshal.SizeOf(typeof(MONITORINFO));
/// <summary>
/// </summary>
public RECT rcMonitor = new RECT();
/// <summary>
/// </summary>
public RECT rcWork = new RECT();
/// <summary>
/// </summary>
public int dwFlags = 0;
}
[StructLayout(LayoutKind.Sequential, Pack = 0)]
public struct RECT
{
/// <summary> Win32 </summary>
public int left;
/// <summary> Win32 </summary>
public int top;
/// <summary> Win32 </summary>
public int right;
/// <summary> Win32 </summary>
public int bottom;
/// <summary> Win32 </summary>
public static readonly RECT Empty = new RECT();
/// <summary> Win32 </summary>
public int Width
{
get { return Math.Abs(right - left); } // Abs needed for BIDI OS
}
/// <summary> Win32 </summary>
public int Height
{
get { return bottom - top; }
}
/// <summary> Win32 </summary>
public RECT(int left, int top, int right, int bottom)
{
this.left = left;
this.top = top;
this.right = right;
this.bottom = bottom;
}
/// <summary> Win32 </summary>
public RECT(RECT rcSrc)
{
this.left = rcSrc.left;
this.top = rcSrc.top;
this.right = rcSrc.right;
this.bottom = rcSrc.bottom;
}
/// <summary> Win32 </summary>
public bool IsEmpty
{
get
{
// BUGBUG : On Bidi OS (hebrew arabic) left > right
return left >= right || top >= bottom;
}
}
/// <summary> Return a user friendly representation of this struct </summary>
public override string ToString()
{
if (this == RECT.Empty) { return "RECT {Empty}"; }
return "RECT { left : " + left + " / top : " + top + " / right : " + right + " / bottom : " + bottom + " }";
}
/// <summary> Determine if 2 RECT are equal (deep compare) </summary>
public override bool Equals(object obj)
{
if (!(obj is Rect)) { return false; }
return (this == (RECT)obj);
}
/// <summary>Return the HashCode for this struct (not garanteed to be unique)</summary>
public override int GetHashCode()
{
return left.GetHashCode() + top.GetHashCode() + right.GetHashCode() + bottom.GetHashCode();
}
/// <summary> Determine if 2 RECT are equal (deep compare)</summary>
public static bool operator ==(RECT rect1, RECT rect2)
{
return (rect1.left == rect2.left && rect1.top == rect2.top && rect1.right == rect2.right && rect1.bottom == rect2.bottom);
}
/// <summary> Determine if 2 RECT are different(deep compare)</summary>
public static bool operator !=(RECT rect1, RECT rect2)
{
return !(rect1 == rect2);
}
}
[DllImport("user32")]
internal static extern bool GetMonitorInfo(IntPtr hMonitor, MONITORINFO lpmi);
[DllImport("user32.dll")]
static extern bool GetCursorPos(ref Point lpPoint);
[DllImport("User32")]
internal static extern IntPtr MonitorFromWindow(IntPtr handle, int flags);
#endregion
Hey Stef,
This is usually what you'll see if you have two monitors enabled, but only one plugged in. The program is running on the "other monitor" where you can't see it.
If that's it, the easiest way to fix this is to hold down the Windows logo on the keyboard, then type P (for "Projector") until the Computer-only option is selected. Let go of the logo and it should adjust to only be using the one correct monitor again.
Thanks for letting me know it helped. Almost every tip I give here is because I've been in the same situation at some point. Back in the XP days there wasn't a keyboard shortcut to turn off monitors and it was more difficult. You could get the off-screen window active (by knowing it was selected in the taskbar), then use keyboard commands to move it back over. Basically alt-space to open that other window's title bar menu, then m for move, then the arrow keys. But doing that without seeing the screen sure looks like magic to my coworkers ha ha.
I am running a game in the background I minimized it so it isn’t visible. When I click its icon in the taskbar to bring it back up, nothing happens, even though the icon shows its opened. It is not offscreen either. I have unsaved data so I would rather not restart my pc. Hovering over it also brings no preview.
Hello AI F,
I’m Segunfunmi, an Independent Advisor and Microsoft user like you. Thanks for posting the query here in this forum.
Are you having trouble getting Word to maximize from the taskbar? No worries, I can lend a hand. Here are a few methods you can try out:
- Maximize Word: Right-click the Word button on the taskbar and select Maximize. If the Word window pops up, click Exit in the File menu. Then, restart Microsoft Word.
- Move Word into view: Right-click the Word button on the taskbar. Choose Move. Use your mouse to point to the middle of the screen, and then use your keyboard's arrow keys to move the program window to a spot on the screen where you can see it. Click ENTER. If you need to, you can resize the window.
- Remove the Data Key: Try this method if you're comfortable changing your computer's registry. But remember to back up your registry first!
- Cascade Windows: Right-click on the taskbar and choose Cascade Windows.
- Use Alt + Spacebar: Click on Word and press Alt + Spacebar. A window menu with options like minimize, maximize, and restore will pop up. Click Maximize.
Give these methods a try one by one until you're all set. And if you need more help, just let me know!
Kind regards, Segunfunmi.
Segunfunmi,
Yes, your suggestion #2, using the Move function worked to get me back to work in Word. Thank you