PeekMessage

This is a discussion on PeekMessage within the Windows Programming forums, part of the Platform Specific Boards category; Can somebody please explain the extent of this function? I'm a little confused of its functionality/advantage/implementation. Thanks, I appreciate it. ...

  1. #1
    the Corvetter
    Join Date
    Sep 2001
    Posts
    1,584

    PeekMessage

    Can somebody please explain the extent of this function? I'm a little confused of its functionality/advantage/implementation. Thanks, I appreciate it.

    --Garfield
    1978 Silver Anniversary Corvette

  2. #2
    zen
    zen is offline
    of Zen Hall zen's Avatar
    Join Date
    Aug 2001
    Posts
    1,007
    It's pretty much the same as GetMessage() except that it'll return when there are no messages (whereas GetMessage() wont return until it has retrieved a message), allowing you to call other functions when your window is idle.
    zen

  3. #3
    Just one more wrong move. -KEN-'s Avatar
    Join Date
    Aug 2001
    Posts
    3,230
    It's a little bit like GetMessage only it doesn't take the message off the queue, it just lets you see what it is.

  4. #4
    Just one more wrong move. -KEN-'s Avatar
    Join Date
    Aug 2001
    Posts
    3,230
    ahh...appears as if we have differing views, my friend

  5. #5
    the Corvetter
    Join Date
    Sep 2001
    Posts
    1,584
    Yup, who's right/wrong???
    1978 Silver Anniversary Corvette

  6. #6
    zen
    zen is offline
    of Zen Hall zen's Avatar
    Join Date
    Aug 2001
    Posts
    1,007
    It can do either, but you'd normaly want to remove a message from the queue so you'd specify the PM_REMOVE flag. If you wanted to leave it in the queue you'd use the PM_NOREMOVE flag.
    zen

  7. #7
    the Corvetter
    Join Date
    Sep 2001
    Posts
    1,584
    Thanks, y'all!

    --Garfield
    1978 Silver Anniversary Corvette

  8. #8
    Registered User DutchStud's Avatar
    Join Date
    Oct 2001
    Posts
    43
    I think i saw one implementation once that if PeekMessage returned that there wasn't a message, the program kept doing something, and if it returned that there was a message, it'd call GetMessage

  9. #9
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,789
    I think i saw one implementation once that if PeekMessage returned that there wasn't a message, the program kept doing something, and if it returned that there was a message, it'd call GetMessage
    Like this

    Good for games

  10. #10
    the Corvetter
    Join Date
    Sep 2001
    Posts
    1,584
    I see, thanks guys!
    1978 Silver Anniversary Corvette

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. windowproc vs. peekmessage
    By CuLtOfGoAt in forum Windows Programming
    Replies: 4
    Last Post: 06-04-2005, 03:32 PM
  2. PeekMessage Windows XP
    By wgdb198 in forum C++ Programming
    Replies: 6
    Last Post: 02-12-2005, 07:46 AM
  3. PeekMessage function
    By Micko in forum Windows Programming
    Replies: 9
    Last Post: 09-14-2004, 04:06 PM
  4. 100%cpu usage with PeekMessage
    By glUser3f in forum Windows Programming
    Replies: 6
    Last Post: 08-19-2003, 07:56 AM
  5. PeekMessage
    By xds4lx in forum Windows Programming
    Replies: 13
    Last Post: 08-26-2002, 11:51 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21