I am experiencing a rare problem. I wrote a program in C that creates several windows and I use them to load and display images. After using the program for a while loading and displaying images then all of a sudden all the windows on the desktop disappear including the task bar on the bottom. Once this happens I can move the mouse and as I move the mouse over the desktop then pieces of the windows start to reappear again. If you can help me with ideas about what to check on my code to eliminate this problem would be much appreciated

have you looked? open the performance monitor and watch the memory usage while you run the program. does it increase continuously?

do you have calls to malloc, calloc, or realloc?

if so, do you "free" the memory allocated?

... load and display images. After using the program for a while loading and displaying images then all of a sudden all the windows on the desktop disappear including the task bar on the bottom...

This sounds very much like you are leaking GDI objects. That is, you are not disposing of the Windows' GDI objects you create/allocate. One handy utility to check this would be GDIView, which enables you to pinpoint the types of the objects you might be leaking.

Of course, also pay attention to malloc()/free() as already noted.

This article has been dead for over six months. Start a new discussion instead.