When you minimize a program under Windows, it does the equivalent of SetProcessWorkingSetSize(current_process, -1,-1);
. This tells the virtual memory manager that all the memory occupied by that program is eligible for being paged out. The only way I know of to prevent this is to prevent the user from minimizing the program in the first place (e.g., use DeleteMenu
to remove the "minimize" item from its system menu).
Note that this isn't a matter of your program's drawing data being removed from the graphics card -- it's a matter of all its data (and quite possibly code) being removed from memory entirely. Of course, if you have enough memory and a lightly enough loaded system, it won't be removed immediately -- it's just marked as being available, so if the system needs memory for something else, it will be (some of) the first to get used.