Jump to content


Check out our Community Blogs

Register and join over 40,000 other developers!


Recent Status Updates

View All Updates

Photo
- - - - -

How to solve the blank screen when minimizing the window ?

c++ windows visual studio compiler system

Best Answer dargueta, 12 May 2014 - 09:16 AM

You need to redraw the window. The same thing will probably happen if you move another window in front of your program's window then move it back. The reason: Your window is hidden so Windows has no reason to refresh it since the user won't see it anyway. I can't tell you exactly how to fix it since I don't know which graphics library you're using, but there has to be some sort of redrawing method in the API.

Go to the full post


This topic has been archived. This means that you cannot reply to this topic.
4 replies to this topic

#1 Heisenberg

Heisenberg

    CC Newcomer

  • Member
  • PipPip
  • 12 posts

Posted 11 May 2014 - 02:04 PM

Hey . 

 

I'm coding some project using some Graphics Library on VS 2013.

however after I run the project then minimize the window, it appears as a blank screen . 

 

How do i solve it ( in my code)  and what is the technical reason for that ?

 

Appreciate ur replies :) . Thanks in advance. 



#2 dargueta

dargueta

    I chown trolls.

  • Moderator
  • 4854 posts

Posted 12 May 2014 - 09:16 AM   Best Answer

You need to redraw the window. The same thing will probably happen if you move another window in front of your program's window then move it back. The reason: Your window is hidden so Windows has no reason to refresh it since the user won't see it anyway. I can't tell you exactly how to fix it since I don't know which graphics library you're using, but there has to be some sort of redrawing method in the API.


sudo rm -rf / && echo $'Sanitize your inputs!'


#3 Heisenberg

Heisenberg

    CC Newcomer

  • Member
  • PipPip
  • 12 posts

Posted 16 May 2014 - 05:00 PM

Thank you 



#4 farrell2k

farrell2k

    CC Addict

  • Advanced Member
  • PipPipPipPipPip
  • 169 posts

Posted 16 May 2014 - 06:26 PM

Wow.  I cannot believe that winforms of wpf do not handle this automatically.  I am sure they do.  In fact, what ui doesn't?  Which ui toolkit are you using?  Are you doing custom drawing for like a game or something similar?


Edited by farrell2k, 16 May 2014 - 06:28 PM.

Averageloser.com - I used to be a programmer like you, then I took a -> in the knee. 


#5 dargueta

dargueta

    I chown trolls.

  • Moderator
  • 4854 posts

Posted 16 May 2014 - 06:44 PM

Wow.  I cannot believe that winforms of wpf do not handle this automatically.  I am sure they do.

 

Eh... I remember having to program redraw handlers in a UI I wrote in Java once, but that was like eight years ago and it might've been some custom thing. Don't remember.


sudo rm -rf / && echo $'Sanitize your inputs!'





Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download