Questions tagged [showwindow]

Winapi function that manipulates Windows window display options. It shows, hides, maximalises and minimalises window by HWND handle passed to it. This is windows only function.

showWindow is member of winAPI.

Syntax:

BOOL WINAPI ShowWindow(
  _In_  HWND hWnd,
  _In_  int nCmdShow
);

Parameters:

(int) hWnd
Window handle

(int) nCmdShow
Display mode. There are constanst defined for display mode. Zero (0 - SW_HIDE) results in window being completely hidden.

Code example:

Hide console window:

ShowWindow(GetConsoleWindow(), 0);   //Console window must exist

More info

More info on Microsoft web page.

55 questions
0
votes
1 answer

ShowWindow() sets the width to the full screen width

I have a child form that's ManualDock'd onto a panel from a larger form. The problem is that when calling ChildForm.Show(), the width of ChildForm is set to 1920 by the ShowWindow() function from user32.dll. How do I prevent this behavior? Even if…
muchos
  • 41
  • 5
0
votes
1 answer

ShowWindow won't set focus or maximize

The following code will not set focus to the IE window that I need, nor will it maximize it like it's supposed to. Option Explicit On Public Class Form1 Public Declare Auto Function ShowWindow Lib "user32" (ByVal hwnd As Long, ByVal nCmdShow As…
mp42871
  • 191
  • 1
  • 5
  • 16
0
votes
0 answers

C# How can I dock an application?

I wrote an application in C# that brings another application to the foreground. This function so far. However, there is a problem. If you set the focus, the application is opened and brought to the foreground, but the Windows docking function does…
3252
  • 21
  • 3
0
votes
1 answer

Why is C++ ShowWindow() not working properly when hiding a window and showing another?

I am writing my first Win32 app in C++ and I am trying to create 3 windows between which to redirect based on what buttons the user clicks on. I initialised the windows (window1,window2,window3) as children of the main window hwnd and only set…
0
votes
0 answers

Open a popup window from a hidden window

I am developing a tool in VB.NET to automate some tasks of another application, however, I would like to do this in a hidden way. I open the editor and then, through ShowWindow (Editor, SW_HIDE), I hide its window. The problem is that in this Editor…
0
votes
3 answers

HowTo hide Console Window with WinAPI?

I'm trying to hide console window when my C application lauching with this simple WinAPI code: #define CONSOLE_NAME "6FD66E14-FF0F-4B94-B8AF-AFE3D42DC399" void hide_window(void) { // Ставим заголовок для консольного окна / Setting window…
mosg
  • 12,041
  • 12
  • 65
  • 87
0
votes
1 answer

MFC: Show or minimize (to hide) window on startup

In CWinApp::InitInstance() I have: if (!ProcessShellCommand(cmdInfo)) return FALSE; m_pMainWnd->ShowWindow(m_MinimizeOnStartup ? SW_SHOWMINIMIZED : SW_SHOWNORMAL); m_pMainWnd->UpdateWindow(); But my ShowWindow call is not resulting in an OnSize()…
df234987
  • 513
  • 2
  • 13
0
votes
1 answer

ShowWindow SW_MINIMIZE can't restore program

I have a program that I want to start up in the background and, when I want to view it later, be able to click the shortcut link or executable and have it bring up my application. I've gotten this to work in the Windows Mobile emulator but when I…
Zac
  • 2,325
  • 3
  • 23
  • 33
0
votes
1 answer

Win32: Can't Show window after hide it?

I was trying to show a window using ShowWindow in a Callback function that called is set by a SetTime after I have hided it, but it didn't worked. Please check the following code example. #define _WIN32_WINNT 0x0500 #include void CALLBACK…
Mostafa Alayesh
  • 111
  • 1
  • 9
0
votes
1 answer

is SetWindowRgn blocking?

I have an UI that can go to full screen. When going to full screen I'm calling the sequence below: ShowWindow(hwnd, SW_HIDE); SetWindowRgn(hwnd, NULL, TRUE); SetWindowPos(hwnd, 0, left, top, right, bottom, SWP_NOACTIVATE | SWP_NOOWNERZORDER |…
Sanich
  • 1,739
  • 6
  • 25
  • 43
0
votes
1 answer

BHO, SW_HIDE and Windows 8.1

This BHO I have works just fine in Win XP IE 8 and Win 7 IE 11 both 32 bit, but not on Win 8.1 64 bit, no EPM. It retrieves the HWND of an IE 11 window and calls ShowWindow(hwnd, SW_HIDE); on it. The window does not get hidden. Verified with WinSpy…
kellogs
  • 2,837
  • 3
  • 38
  • 51
0
votes
0 answers

What could prevent a window from being displayed in foreground?

What could prevent a dialog from being displayed modally in foreground in some circumstances? A process (KeePass.exe) owns a hidden window. A global shortcut (CTRL+A) displays a dialog in foreground. This is done using the DoModal method. And it…
divB
  • 896
  • 1
  • 11
  • 28
0
votes
1 answer

How to start MFC SDI app inactive?

I require my MFC SDI application to start up inactive. It's an on-screen keyboard. In straight Win32 it is trivial to do by simply calling ShowWindow( hWnd, SW_SHOWNA ); This does not work in MFC. I've tried various things: Overriding OnActivate(),…
Thwip
  • 1
0
votes
0 answers

Popup window without stealing focus from other fullscreen programs

Hi so the title describes it pretty well, I'm currently working on a software that will be installed on a POS system now when an event occurs this program needs to create a popup for the cashier to confirm what my concern is that since this is a…
user3053234
  • 375
  • 1
  • 4
  • 16
0
votes
0 answers

Show hidden window in the same Z order it was

I hide window using ShowWindow() WINAPI function. I use the same function to show these windows again, but when I show them, the order of the windows is changed. I want to show them again with the same Z-order they had before. I found ArnoudMulder's…
Ron
  • 3,975
  • 17
  • 80
  • 130