Thread: resizing makes child windows blink

  1. #1
    Registered User
    Join Date
    Jan 2008
    Posts
    28

    resizing makes child windows blink

    im using MoveWindow under WM_SIZE to change my subwindows according to the
    parent window but all the child windows are blinking all the time...
    is there a way i can make em stop?

  2. #2
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Question: do you call MoveWindow every time WM_SIZE is received?
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  3. #3
    Registered User
    Join Date
    Jan 2008
    Posts
    28
    yes i do for every subwindow that needs to be resized (total of 5 and i need to add another 4)

  4. #4
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    I don't want to test, but it may be that the windows are resized too frequently. Each time you "move" them, Windows will repaint them and if you repaint too often, you get blinking or flickering effect due to Windows limitations.
    This is my theory on your problem.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  5. #5
    Registered User
    Join Date
    Jan 2008
    Posts
    28
    i do belive you could be right. so i could do some sort of global counter to divide it by 4 or something..
    i`ll let you know in a few minutes

  6. #6
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    You can use static too. It's better than global.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  7. #7
    Registered User
    Join Date
    Jan 2008
    Posts
    28
    nop, not it.
    i got it down to 1/15 times and the listboxs resized noticably less but the text inside and the buttons are flickering.

  8. #8
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Well, can you use Spy++ to monitor how many WM_PAINT messages the child windows are receiving?
    Unless you have window proc's for those too. Otherwise you could subclass them and monitor how many WM_PAINT messages they get.
    EDIT: Well, I'm stabbing in the wild again, but you do call MoveWindow with FALSE for bRepaint, right?
    Last edited by Elysia; 01-12-2008 at 02:40 PM.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  9. #9
    Registered User
    Join Date
    Jan 2008
    Posts
    28
    never used or heard of spy++ before but i found it and im working on finding out how its done... will take me a few mins at least.....

  10. #10
    Registered User
    Join Date
    Jan 2008
    Posts
    28
    wow, i just resized the parent window just a bit and it posted A LOT of WM_PAINT msgs
    and this is using the 1/15 divider, so maybe i need to limit the amount of WM_PAINT msgs the main windows sends it and then it could be all right!
    Last edited by robig2; 01-12-2008 at 03:13 PM.

  11. #11
    Registered User
    Join Date
    Jan 2006
    Posts
    49
    I just solved a flickering problem similar to this. All I did was add WS_CLIPCHILDREN to the windows style. There is also this website I found with other tips on how to reduce flickering...

    http://www.catch22.net/tuts/flicker.asp

  12. #12
    Registered User
    Join Date
    Jan 2006
    Posts
    49

  13. #13
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Good find! Indeed,
    /me bookmarks.
    Windows programming never gets easier
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  14. #14
    Registered User
    Join Date
    Jan 2008
    Posts
    28
    thanks rakan, that helped me stop the buttons from flickering now i need to get the text in the list boxs to stop and im there!
    ive been playing around with
    Code:
    SendMessage(hwndListFname,WM_SETREDRAW,1,0);
    but i need to find exactly where to place those in order that my list is updated when should but thats it. that would eliminate all flickering inside it i think.
    edit:
    anyway i loot at it, i need to handle the listbox`s WM_PAINT msg. but since the listbox`s proc is predefined, i cant change it!
    ideas?

    did anyone ever get a listbox or any edit control working that doesnt flicker the text inside it on resize?
    Last edited by robig2; 01-13-2008 at 04:19 AM.

  15. #15
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    The article mentions you can handle the WM_ERASEBKG message or specify a style when creating it.
    You can subclass a control, though. What dose this do? It allows you to specify a new window proc procedure for the control where messages are sent.
    How do you do it? You do it using SetWindowLong I believe.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Can't create child windows
    By OnionKnight in forum Windows Programming
    Replies: 4
    Last Post: 04-10-2011, 04:13 PM
  2. Child windows cursor
    By Gordon in forum Windows Programming
    Replies: 1
    Last Post: 02-24-2008, 10:02 AM
  3. Keeping child windows in their place
    By Smallz in forum Windows Programming
    Replies: 1
    Last Post: 08-27-2006, 06:22 AM
  4. Removing/Hiding Child Windows
    By Hysteresis in forum Windows Programming
    Replies: 4
    Last Post: 07-14-2006, 11:50 AM
  5. What makes a Windows EXE?
    By willkoh in forum Windows Programming
    Replies: 19
    Last Post: 04-02-2005, 10:15 PM