Emulate Minimize

Cheetah

Well-known member
Joined
Oct 12, 2006
Messages
232
Programming Experience
Beginner
Hi there,

When you minimize a program the memory usage of the program goes down.

What I want to do essentially is to minimize the program to tastbar tray - but I don't want it to show in the taskbar - or have that weird animation where is minimizes (if possible). I also don't want to maximize the program to get it to show again or to take focus, dispite the fact is will have the TopMost set to true.

So I was wondering if there was a way to emulate minimize in what I am guessing is resource release, and the memory usage go down.

Something like this:

VB.NET:
Private Sub SomeEvent()

   Me.Hide
   'Here is where i would emulate the minimize

End Sub

By the way, I have already read and understood this thread: Clicky!

Thanks.
 
You know.. if task manager didnt exist, you probably wouldnt care about the meaningless numbers it shows. Memory usage will go down in your app when old resources are cleaned up. Like every teenager that only occasionally loses something, the framework only cleans up when it needs to, not when mom tell it to. Just wait, or run another big app..
 
Why is it then - when it is minimized it uses low resources and stays low

- but when its windows state is normal it uses higher resources and stays higher. The clean-up doesn't clean all the resources as if it was minimized. Also I'd like the cleanup to me more regular as in every time my program changes to show that it uses lower resources.

PS. I know a little about the garbage collection class - it was brought up in another thread.
 
When the window is open the resources is higher and stays higher? Kinda like when you go work out in the gym, your heart beats faster and your skin temperature is higher? A working program requires more resources than a dormant one. Why would you expect this to not be, or put another way; can you expect to go to a gym and not raise your heart rate or temperature?

Windows stomps applications you arent using, down a bit because it knows youre not using them. Stop fussing over stuff you cant change, and do some work! :D:D
 
My program is Gui dormant when i set it to hide - there is only something being done is the background.

The only reason I want this - is because its one of the main "selling points" (if you like) of my application.

See the source and actual app here: http://www.vbdotnetforums.com/showthread.php?t=21899.

I have achieved what I want, but only in a really "hacky" way which has some animations and aspects i don't like.
 
If your application does not require an interface, would writing it as a Windows Service be a better alternative? Either that or a console application?
 
It does require an interface - but it's not seen much.

If you look at the application itself - I am sure you will understand.
 
If you want to advertise a program as "low memory usage" then for goodness sake, dont write it in .NET!
 
Something i've done in the past in a similar situation, but for different reasons (if that makes sense). I created a windows app. then set the startup object to my sub main of the module which actually does the work. I also created a notification icon in that module which if double clicked will open a windows form which shows me the applications progress. The application uses WMI to pull information from pc clients and stores that information in a SQL db. I don't know if something like that would work for you or not, but it works great for me. The only time I generally worry about memory usage is when I have a leaky app.
 
If you want to advertise a program as "low memory usage" then for goodness sake, dont write it in .NET!

I meant for people that already have the .NET services running. For instance I have them running practically all the time as i have a dock app that uses .NET
 
Something i've done in the past in a similar situation, but for different reasons (if that makes sense). I created a windows app. then set the startup object to my sub main of the module which actually does the work. I also created a notification icon in that module which if double clicked will open a windows form which shows me the applications progress. The application uses WMI to pull information from pc clients and stores that information in a SQL db. I don't know if something like that would work for you or not, but it works great for me. The only time I generally worry about memory usage is when I have a leaky app.

Thanks - will look into this.
 
Back
Top