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
2
votes
0 answers

Maximize (Fullscreen) MainWindow of a Process through C# and user32

I am using: private const int SW_SHOWMAXIMIZED = 3; [DllImport("user32.dll")] public static extern int ShowWindow(IntPtr hWnd, int nCmdShow); To try and maximize another window on the current computer. However, this "Maximize" only makes the window…
Kyle Uithoven
  • 2,414
  • 5
  • 30
  • 43
2
votes
0 answers

in c# BringWindowToTop and ShowWindow DLL not work for all application

I am facing a problem in “BringWindowToTop” and “ShowWindow” which is occuring in some applications, but not all. The issue is that if my applications are minimized to the taskbar, and when I open applications one by one, they all open except…
1
vote
1 answer

How to tell who sends the ON_WM_SHOWWINDOW message mfc

I have a bug that I'm trying to fix ( Odd MFC/GDI behaviour (blank image) that doesn't appear when screen is recorded ), and I think it might be because I'm calling Invalidate() before I call ShowWindow() somewhere. I have a class that's derived…
Jordan
  • 9,014
  • 8
  • 37
  • 47
1
vote
0 answers

Why does `SW_HIDE` leave a ghost after forcibly setting a game's window style to `WS_POPUP`?

I am trying to hide Factorio window after removing its border by setting its style to WS_POPUP. When I call ShowWindow(factorio, SW_HIDE) the window leaves behind a black box, that is transparent to clicks, can not be activated, does not appear in…
LOST
  • 2,956
  • 3
  • 25
  • 40
1
vote
1 answer

Capturing ShowWindow event in .Net code

Does anyone know how to capture an ShowWindow api call in a .NET form? We have an external VB6 program calling ShowWindow to minimize all our .NET forms in a second app. I'd like to be able to add some sort of event handler to know when the message…
bruno
  • 11
  • 1
1
vote
1 answer

ShowWindow doesn't work when a window is running under SYSTEM account

I'm currently using this code to restore a minimized window, and it works perfectly when I try to restore a window that runs under my own user account. ShowWindow(wHandle, SW_RESTORE); The problem arises when I try to restore a window that runs…
user14733993
1
vote
1 answer

ShowWindow restores the window only if is the last minimized

I'm trying to make a program in C++ that shows a minimized calculator. It works if I minimize it, but if I minimize the Calculator and then another program like firefox, the program doesn't show the calculator anymore. int main() { hwnd =…
nico marty
  • 11
  • 1
1
vote
3 answers

Which problem prevents ShowWindow from working?

I try to create a window, which is hidden when it is minimized. The Window should be hidden, when it's minimized. Where is my problem? What prevents ShowWindow from working? #define _WIN32_WINNT 0x0600 #include #include…
Norbert Willhelm
  • 2,579
  • 1
  • 23
  • 33
1
vote
1 answer

More than one titleWindow in a Flex Application

I'm a GIS Analyst that was moved to an Analyst Programmer position. This has been a hard transition for me as I don't have much of a programming background, but I was thrown into it. I'm working on a Flex app inside a jsp page. Essentially it is a…
Evan
  • 125
  • 4
1
vote
0 answers

Restore other instance of same application from tray when launched

i created a program which hide itself to tray icons when minimized. and it can run only one instance and when you try to run it again it supposed to show and active the current instance. my code simply looks like…
trksyln
  • 136
  • 10
1
vote
1 answer

Error: Import DLL from run dialog

I seem to be experiencing a DLL import error only when the following powershell command is executed from the run dialog. The exact same command from an open powershell window executes without an issue. Error producing RUN dialog command: Powershell…
Msegling
  • 365
  • 3
  • 12
1
vote
1 answer

ShowWindow spawns unexpected windows/application

I'm trying to pop notepad window in my c# Application using this code: Process[] Processes = Process.GetProcessesByName("notepad"); IntPtr hWnd = IntPtr.Zero; Debug.WriteLine("Processes: " + Processes.Length); // do something foreach(Process p in…
KalanyuZ
  • 672
  • 6
  • 15
1
vote
2 answers

Win32 API deadlocks while using different threads

I am experience deadlock while trying to use WIN32 API from additional thread. The additional thread is needed in my application to improve Frame Rate. It actually helps, however, I get deadlocks in almost all of the system…
Iron-Eagle
  • 1,707
  • 2
  • 17
  • 34
1
vote
1 answer

ShowWindow not working from a DLL on a 64-bit OS?

I have a process that calls SetWindowsHook to catch keyboard events. In the DLL that processes the events, I conditionally call ShowWindow on the handle of the window of the process who set the hook. That code works perfectly on a 32-bit OS (XP) and…
Auto Roast
  • 11
  • 1
0
votes
2 answers

CreateProcess for Running JAR File Starts with Window Minimized

I'm using a CreateProcess call within a C++ program to execute a JAR file that runs a Java Swing GUI application. All works fine with the exception that the Java app starts off minimized and I want it to start with the window displayed. Here's the…
Sheldon R.
  • 452
  • 2
  • 7
  • 26