Results 1 to 4 of 4

Thread: Help with a loop.

  1. #1
    Guest

    Post

    Im making an app that will show a dialog on your desktop that shows the percentage of the usage of your comp. The code for it is in the MSG loop, and the problem is that it only updates itself when you move the mouse over it. How do i fix that?

  2. #2
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    Try using PeekMessage:
    Code:
    while(PeekMessage(&msg, NULL, NULL, NULL, PM_REMOVE)+10) {
    	DispatchMessage(&msg);
    	// Code here...
    }
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  3. #3
    Guest
    I have to use the normal GetMessage loop.

  4. #4
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    Why? GetMessage and PeekMessage are identical except PeekMessage returns instantly, guaranteeing that any code in the loop will always be executed.
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width