Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    Visual Basic




Minimize Window


Is there a way to minimize a window when a command is executed
then restore the window back when program has finished ?




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Get Active Window Handle / Minimize Window
Hello,

I have two (hopefully) simple questions that I hoped could be answered.

How do you obtain the currently active window's handle? I have tried GetActiveWindow, it doesn't seem to work.

How do you minimize a window through the use of the window handle? I do not want to have to focus on the window I am trying to minimize.

Thankyou

Edit: I just thought of another question I need answered.
Could somone please tell me how to use the API SetCursor, and whether SetCursor persists through a restart?

Quote:




Private Declare Function SetCursor Lib "user32" (ByVal hCursor As Long) As Long

Minimize Window
Hi all - I wrote a small program that will use rundll to load any of the web sites (in internet explorer) that I've placed in a certain folder - my problem is that I can't control the way that they open, they all open in about a half sized window box with focus, I'd like them to open minimized, and I've tried the standard procedure, something like x=shell("blah.exe",0) and it won't do it, I then used a API call to minimize all windows, but the last two don't respond to the call...... Can anyone help me here?????
Thanks
Chris

Minimize Window
I set my program to not show up in the task bar, but when I minimize it, it just goes on top of the Start button. How can I stop this and make it disappear when I minimize it? Thanks.

Minimize Window
Hi Gurus... How can I make the window to be minimized when a user click on a command button?

thank you,
kethees

Minimize A Window With SendMessage
Hi, all. I use the GetForegroundWindow API to get the handle of the topmost window(a non-VB window). Now, I want to minimize it using the SendMessage API. Is there a WM_MINIMIZE constant that I can pass to the SendMessage API function? If none, how can I minimize the window using the SendMessage API? Please post sample code. Thanks.

Forcing A Window To Minimize
Hello,
I'm currently having problems making a DirectX game window minimise. I can make it maximise but not minimise . I've seen it done before so I know it's possible. I had a brief moment of success by making the window maximise and then minimise but it's not reliable as it hardly ever works......

Please help

Force A Window To Minimize
Is anyone aware of a way to force a window to minimize itself? I know the window handle if that helps. Thanks peeps

Don't Minimize When Window Has Focus?
WinNT4

When a certain event happens in my program
it is set to miminize frmMain nomatter what.

I dont want it to minimize if it has focus.
or if something is currently being typed into
a textbox that is on frmMain

I know NT has problems with VB Focus events.
Anyone have any ideas?

Thanks much!
Garrett

Minimize Popup Window
Hi I think that the following problem will be a challenge : )

There is enough code for closing a window but not I can't find help in
maximizing and minimizing a window.As concern the maximizing I don't
want to just maximize it and that's all but in second clic to restore it
in previous dimensions. As the 3 upright buttons of Windows in a window
do, I need to find a piece of code that will do the same work.
If you could help me I would appreciate it.
Most of the code I found was in Javascript, so if there is something in VBscript or Javascript please mention it to me
Thanks on advancce

Minimize Or Hide This DOS Window
hi,
when i run a batch file it always pop up a DOS window on my windows 2000 computer.
how can i Minimize or hide this DOS window?
thanks

Minimize, Max, Restore Window
Does anyone have a code sample for minimizing to and restoring from the taskbar?

I constantly drop the forms to the taskbar but then when I need them again I go back to the button that calls the form. When it does not call the form, I then remember I minimized it to the taskbar.

Couldn't I put code behind the command button that calls the form so it will restore it?

Minimize TopMost Window
Hi,
I have an MDI form with many MDIChild forms and I also have a non-MDIChild form called from within the program. I want this non-MDIChild form to be always on top of every other MDIChild form. So I call the following API Function:

SetWindowPos hwnd, HWND_TOPMOST, 0, 0, 400, 100, SWP_SHOWWINDOW

"Public Declare Sub SetWindowPos Lib "user32" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal x As Long, ByVal Y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long)"

Everything works fine apart from when I minimize the MDI form, then the non-MDIChild form stays on top of every other window or program running on my pc.
I want this form to minimize when the MDI forms is minimized and I suppose I can use the same API function to do that, but I have a problem to control the MDI-minimization event.

Window - Minimize Icon
Hi,

How can I associate an event and know when the user has clicked the minimize icon on the window.. Why because there is no event associated to it.. Is it possible or no..

Or is there any API related to it.. Why because there is a Constant
SC_MINIMIZE .. Can I post this to the Window Queue and do somethings
with that..

Pl give me your idea regarding this..

Regards

Arun Kumar

I Need To Maximize A Window Which Is At Minimize State
hi friends ,
i need in asp that i can get a minimized window tobe maximised as some value of my another page is changed .here i will like to mention that i don't need to reload the minimized window but just maximise it
plz its urgent

Minimize Access Window On Opening
How can I minimize the access window when my application starts. I would like to simply see the form that I have set to open when the application starts.

Scott

Window Minimize Event Handler
Hey Guys,

Could someone please help me with code that would detect a window minimize event in VB6?

Perform An Action When A Window Is Minimize??
I would like to place an icon in the task tray when my program is minimized. I am able to create the icon but not when the program is minimized. This is what I would like to accomplish:
When the program is minimized, hide it from the start bar and place it's icon in the task tray.

Any ideas?

Thanks.

Minimize Window If Focus Lost
I have a program the runs in NT4. The "lostfocus" and "gotfocus" sub options dont work.
what I need to do is if my form loses focus, for it to minimize. how can I accomplish this?

Thanks for any help
Garrett

Window Minimize Event Handler
Hey Guys,

Could someone please help me with a window minimize event handler?

The Activated Window Disappear/minimize By Itself
Hi All,

I am new in this forum,and maybe someone can help me.

General background:
My VB6.0 program starts with USB communication to the user and gets as a respond back parameters to intiates.
Then the aplication initiates two batch files: one is transmitter and the other one initiates another batch files that starts parallely three receivers(VLAN IP data). All this with external windows XP .dll's,and Shell command.       
The received data is saved on files and then analyzed with my program.
The external transmiting/receiving procces takes a lot of time ~1Min,and the VB program looks like paralyzed in this time.


The Problems:
1) While the first interactive USB communication with the user in real time mode take place,the active window shakes
   and it is refreshed slowly.I am using the DoEvents, Form.Visible, Form.refresh, Form.Enabled = True, Form.SetFocus, Form.Show, and delays. All those in the loops and outside the loops.
   Increasing the delay time in the loops stabilyze the active window,but makes the updates refreshing active window slow.
   It doesn't happen regulary and I can't predict when.

2) While the active window is waitting for data to be analyzed,suddenly it could minimize or disapper and then it is showed minimized, and I have to maximize it back (As a user).For proccess data from the files,the program uses loop.



A)  My question is: How do you communicate or activate  
    external programs interactively displayed with the user response(to active displayed window nicely and
    still, and not shaking,and mealwhile programs running in background?)  
      

B)  My second questin is:How can I prevent the Active window to minimized to the bottom bar menu? or disappear? or become white suddenly? Sometime when the external program is done the active windows comes back or it gets its own color back,or it let me maximize it.   


Thank you very much
Gidon Zilberman

I'm Not Able To Minimize The Window Durring My Prog Run
I put DoEvents in many place in my prog but am not able to do minimize.

Where is the problem?

Thanks
Redg

Minimize, Maximize, Restore Other Window.
Is there a way to make my application tell something else to minimize/maximize/restore itself.

Example: My form commands Windows Media Player to minimize, but not just Media Player. I want to minimize/maximize/restore any window.

Why Would Picture Boxes Clear Itself When I Minimize The Window It's In...
Then sometimes if I click that picturebox again, they may all show up. So frustuating...

(I didn't do anything to alter the minimize button...)

Custom GUI - Minimize To Taskbar, Drag Window
Hi everyone,

How can I make my custom border/GUI have a minimize that goes down to the taskbar? Right now I've got it going to the system tray, but I do not want that, and once it is put in there, you can't get it back out unless you end the process.

Also, how can I make the border/custom GUI window draggable like a normal window, i.e., have a 'handle' across the top bar for them to it with.

Thanks again!

Control Program When Minimize Window Or Lose Focus
Hi,

Perhaps this question is very simple, but I've started with VB a short time ago. I've made a program to comunicate with a mail server. It is necessary to stay continusly receiving information from the server. But when I minimize the window or when I open another program, my program stops! How can I control this?

Thank you,

Eider

Minimize To Tray, But Program Still Listed As Open Window
I just got a nice bit of freeware called NoAds that allows me to block the pop-up ads. Running NoAds, however made me aware of the fact that when my own personal project is minimized to the system tray, it's the only one of the programs from the system tray that NoAds lists as "Currently Open Windows". (Whoops!)

Here's my code:


Code:
Private Sub Form_Resize()
If ResizeAllow = True Then
If Me.WindowState = vbMinimized Then
tIcon.Visible = True
Me.Visible = False
Else
I tried Me.Hide, too, same effect. I don't know why but I thought maybe the fact that my program uses a timer might be the difference, but upon removing the timer, and running the program and minimizing to the tray, still it was listed as a currently open window.

What am I failing to do that's making mine the only program in the tray that comes up listed as a currently open window?

How To Maximize And Minimize The Window Named "Reminder" Thorugh Code
Hi,

I developed a project in VB6, it checks the database and if the date field matches then, the application will mail the user(i.e Reminder). I compiled this project & placed the Exe in Scheduled Tasks in Control Panel and assign it to run daily at 8:00Am. So it will atumatically run daily. I am getting mails when i test from Project it works fine.

The issue here is, as soon as the 8:00 Am comes the application started running, but it is minmized in the Taskbar,after i click the application from the Taskbar the application starts working & sending mail process is completed.
If i didn't click the application in the Taskbar, that remains in teh minimized state for ever. How to solve this issue.

I hope this could be solved if i click the Application once through code & minimize it again.

Kindly reply me about it & any idea or code sample will be helpful.

Thankyou,
Chock.

How To Maximize And Minimize The Window Named "Reminder" Thorugh Code
Hi,

  I developed a project in VB6, it checks the database and if the date field matches then, the application
will mail the user(i.e Reminder). I compiled this project & placed the Exe in Scheduled Tasks in Control Panel and
assign it to run daily at 8:00Am. So it will atumatically run daily. I am getting mails when i test from Project it works fine.

  The issue here is, as soon as the 8:00 Am comes the application started running, but it is minmized in the Taskbar,after i click the application from the Taskbar the application starts working & sending mail process is completed.If i didn't click the application in the Taskbar, that remains in teh minimized state for ever. How to solve this issue.

I hope this could be solved if i click the Application once through code & minimize it again.

Kindly reply me about it & any idea or code sample will be helpful.

Thankyou,
Chock.



Edited by - chs on 11/28/2005 10:39:05 PM

How Do I Minimize A Form Without Clicking The Minimize Button???
Hi,

I would like to mimimize a form with a button called cmdMinimize???

Thanks

How Can Minimize Button Act As Minimize To Tray ?
how can minimize button act as Minimize to tray ?

i have separate button for............ Minimize To Tray........ but i want that..... my minimize button of form must work as minimize to tray !! how can i do that !!

Type "minimize" To Minimize Form1 ***SOLVED***
hi
I have this code:

VB Code:
Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer)If KeyCode = vbKeyReturn Then    If Text1.Text = "minimize" Then        Form1.WindowState = 1        Text1.Text = ""    Else         Text2.Text = Text1.Text        Text1.Text = ""    End IfEnd IfEnd Sub

when i press Enter, it cleans Text1 but also create a new line...
then if I type something; press Enter; then try to minimize, it doesn't work
What can I do

Thanks

Add A Button In Front Of The Minimize-button Kind Of 'minimize-to-system-tray-button'
At the moment I'm trying to add an icon in the system tray for my app - maybe i'll make it.
When I have made it I'd like to add a button in front of the min-button on the title bar of the apps form (like the one on All-API's API-Guide ), in order to empower the user to minimize the app even further, i.e. to the system tray - how can this be achieved?

thx,

Helger

Difference Between Immediate Window , Watch Window , Localas Window
difference between immediate window , watch window , localas window ...?

Minimize
Is anyone aware of an api or other command that can minimize a 3rd party app?

Minimize
Hello,
How can i minimize my program,
when an other program is minimized to?

thnx

Minimize Everything
Im searching for a code that would minimze every window (IE, explorer, card games....)
whatever is loaded must be minimized
any help?

Minimize
Hi all,

I have a little question:
I want to minimize all open windows in xp, but i want to do it with a key combination and without the active form. so the form has lost the focus and i still can do the key combination to minimize all the windows.

Hope anyone knows how to do this.

Thank you

Minimize
My startup form is Form1.
I have a form named Form2 that will show in vbModal mode.
How to force the Form1 to be minimized when we minimize thye Form2 ?
I can use this code :

Code:
Private Sub Form_Resize()
If Form2.WindowState = 1 Then Form1.WindowState = 1
End Sub
but this just minimize it and will not restore the forms.

Minimize?
ok 2 qustion i got

1: to end a form you do End, what do i do to minimize?

2: how do i rotate command buttons?

How Do You Minimize
i need to minimize a single program by knowing its hWnd.

Any ideas?

Thanks,
Brian

1. Minimize, 2. Run Behind
1. How do i minimize a form and make it stay on the startbar, or to make it to a small icon at the clock.

2. How do i make a prog that run and work behind another window, example. I wanna make a prog that counts how manytimes u write xD / day.

Minimize ALT?
anyone know the ALT for minimize? like close is ALT+F4..whats minimize?

Minimize ??
Is there a code that can minimize all windows in the taskbar ???
-------------------------------------------------------------

Jonathan

Minimize Help!
I have a minimize button on my form and when you put your mouse down on it, it shows another picture, and when you let go, it minimizes. After i restore it again, it still shows the mousedown picture. Here's what i've tried so far.

[vb]

Private Sub imgTitleMinimize_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
imgTitleMinimizeOver.Visible = True
End Sub

Private Sub imgTitleMinimize_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
imgTitleMinimizeOver.Visible = False
imgTitleMinimize.Visible = True
End Sub

Private Sub imgTitleMinimize_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
imgTitleMinimizeOver.Picture = imgTitleMinimize.Picture
End Sub
[vb]

It won't seem to respond. After it gets minimized and shows the second picture and i restore it again, it still has the second picture.. Someone help? Thanks.

How To I Minimize An App?
This may be the dumbest question you ever read on here, but I have a form called form 2 that I don't want people to maximize but I would like them to be able to minimize it. So right now it has that big x in the corner and that is it. How may I add this minimizing ability?

Thanks

Minimize?
is it possible to set the minimize to a image/button????

same with max, and close?

Minimize
How do i minimize a form by clicking an object.

On Minimize
I got a User Control off of http://www.andreavb.com/forum/databa...=showmod&mod=2 and it has a code to show the icon in the tray.

VB Code:
TrayArea.Visible = TrueMe.Visible = False

How do I make that code work when I press minimize?

Minimize
how do u minimize a form when an image is clicked?
---------------------------
Private Sub Image5_Click()
(WOT GOES IN HERE?)
End Sub
----------------------------

Copyright © 2005-08 www.BigResource.com, All rights reserved