Solved

Minimize or hide window

Posted on 1998-11-05
9
465 Views
Last Modified: 2010-04-30
How can i Minimize or Hide a window that has nothing to do with my app?
0
Comment
Question by:Jambyte
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 4
9 Comments
 
LVL 1

Expert Comment

by:csalves
ID: 1443455
You have to Get The Hwd of the window (You van use the API) and after that you can minimize the window.

regards,
0
 
LVL 2

Author Comment

by:Jambyte
ID: 1443456
can you explain in detail i will up the points
0
 
LVL 13

Expert Comment

by:Mirkwood
ID: 1443457
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
Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

 
LVL 2

Author Comment

by:Jambyte
ID: 1443458
That works for most windows but not this one for some reson. is there any other ways to hide or minimize a window?
0
 
LVL 13

Expert Comment

by:Mirkwood
ID: 1443459
Does the window respond to minimize all. <Windows-Key M>
0
 
LVL 2

Author Comment

by:Jambyte
ID: 1443460
Mirkwood, no it doesn't.
0
 
LVL 13

Expert Comment

by:Mirkwood
ID: 1443461
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
 
LVL 2

Author Comment

by:Jambyte
ID: 1443462
Mirkwood answer this question and i'll give u the points. Thank you!
0
 
LVL 13

Accepted Solution

by:
Mirkwood earned 100 total points
ID: 1443463
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses
Course of the Month7 days, 5 hours left to enroll

623 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question