• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 475
  • Last Modified:

Minimize or hide window

How can i Minimize or Hide a window that has nothing to do with my app?
0
Jambyte
Asked:
Jambyte
  • 4
  • 4
1 Solution
 
csalvesCommented:
You have to Get The Hwd of the window (You van use the API) and after that you can minimize the window.

regards,
0
 
JambyteAuthor Commented:
can you explain in detail i will up the points
0
 
MirkwoodCommented:
Use findwindow to find the hwnd of the window based on the caption and class of the window. Use a utility like spy32 to find the class of a window
now call ShowWindow with the hwnd and the mode
The code below should be placed into a module

Public Const SW_MAXIMIZE = 3
Public Const SW_MINIMIZE = 6
Public Const SW_NORMAL = 1
Public Const SW_RESTORE = 9
Public Const SW_SHOW = 5
Public Const SW_SHOWMAXIMIZED = 3
Public Const SW_SHOWMINIMIZED = 2
Public Const SW_SHOWDEFAULT = 10
Public Const SW_SHOWMINNOACTIVE = 7
Public Const SW_SHOWNA = 8
Public Const SW_SHOWNOACTIVATE = 4
Public Const SW_SHOWNORMAL = 1
Declare Function ShowWindow Lib "user32" Alias "ShowWindow" (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long
Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long

0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
JambyteAuthor Commented:
That works for most windows but not this one for some reson. is there any other ways to hide or minimize a window?
0
 
MirkwoodCommented:
Does the window respond to minimize all. <Windows-Key M>
0
 
JambyteAuthor Commented:
Mirkwood, no it doesn't.
0
 
MirkwoodCommented:
Then most likely you cannot minimize it.
What you can do maybe is hide using ShowWindow
SW_HIDE.
public Const SW_HIDE = 0

You might even close or destroy it using SendMessage and WM_CLOSE or WM_DESTROY.
You can maybe move the window outside the visible screen area using MoveWindow.

0
 
JambyteAuthor Commented:
Mirkwood answer this question and i'll give u the points. Thank you!
0
 
MirkwoodCommented:
Then most likely you cannot minimize it.
What you can do maybe is hide using ShowWindow
SW_HIDE.
public Const SW_HIDE = 0

You might even close or destroy it using SendMessage and WM_CLOSE or WM_DESTROY.
You can maybe move the window outside the visible screen area using MoveWindow.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

  • 4
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now