Link to home
Start Free TrialLog in
Avatar of ttobin333
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!
Avatar of Jon500
Jon500
Flag of Brazil image

I have no idea what you're talking about and I am a Microsoft Certified Professional in VB6, in particular.

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
ASKER CERTIFIED SOLUTION
Avatar of LMiller7
LMiller7
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ttobin333
ttobin333

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.
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
No problem, Jon. Thanks for your response.
That's it, thanks!
Avatar of Mike Tomlinson
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

Open in new window