ttobin333
asked on
VB6 Minimize Memory Usage Shown in Task Manager
Dear Experts,
I am aware that the memory use shown in Windows Task Manager can be misleading and lowering this number is partially "cosmetic", but I am trying to use the old trick of minimizing and then normal-sizing my app to reduce the number. This works great when done manually, but not very well when I perform it programmatically, which is my goal.
How can I do this correctly, or is there a better way?
Thanks!
I am aware that the memory use shown in Windows Task Manager can be misleading and lowering this number is partially "cosmetic", but I am trying to use the old trick of minimizing and then normal-sizing my app to reduce the number. This works great when done manually, but not very well when I perform it programmatically, which is my goal.
How can I do this correctly, or is there a better way?
Thanks!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Jon500, that's not a very nice tone, but let me explain.
When my app (like most) launches, it uses more memory than when it is idle, but the task manager processes tab shows the high initial memory usage (even though I realize that this can be freed up when needed by other apps). When you minimize the app then restore it, the memory usage number in task manager goes way down. Try it, it works with most VB apps
I am trying to achieve this programmatically.
Thanks.
When my app (like most) launches, it uses more memory than when it is idle, but the task manager processes tab shows the high initial memory usage (even though I realize that this can be freed up when needed by other apps). When you minimize the app then restore it, the memory usage number in task manager goes way down. Try it, it works with most VB apps
I am trying to achieve this programmatically.
Thanks.
I do apologize for what appeared to be a bad tone. It wasn't my intention. I honestly did not know "the old trick". Thank you for explaining. Your question is far clearer now, in my opinion, and I think it will enable other experts to chime in with some helpful advice.
Regards,
Jon500
Regards,
Jon500
ASKER
No problem, Jon. Thanks for your response.
ASKER
That's it, thanks!
Don't have VB6 on my machine anymore...you could also try:
Private Const SW_MINIMIZE As Long = 6
Private Declare Function ShowWindow Lib "user32" Alias "ShowWindow" (ByVal hWnd As Long, ByVal nCmdShow As Long) As Long
...
ShowWindow Me.hWnd, SW_MINIMIZE
What do you mean "the old trick"? What exactly are you doing to lower memory usage and then "normal-size" (do you mean "normalize")?
Thank you,
Jon500