locked
C++ : PeekMessage win API in Windows Store Apps ?

    Question

  • Hi,

    in my windows store app, i want to check if there are any pending mouse moves, in desktop i can use PeekMessage to check that.

    I was wondering how do i do that in a windows store app ?  Or is it that the API is not available ? if yes, then how do i solve this ? basically, lets say my code flow looks like the following 

    MouseDownHandler - (attached to a ui control , this will be called by winRT framework when there is a mouse down  - , also, assume that there is MouseMoveHandler attached to the same control ) - this function calls

    fun1 -> which calls

    func2 -> 

    func3  ( here, in this function i want to check if there any pending mouse moves, ) -> 

    func4 (if there are no mousemove or there is mouse-up then this is called and continued)

    func5 - return;

    if Peekmessage is not available then how do i solve this issue ? do i need to redesign my workflow ?

    Thanks



    Raj

    Tuesday, August 06, 2013 1:56 PM

Answers

  • Hi Raj,

    There isn't a direct analogy to PeekMessage in Windows Store apps, but pointer messages are routed and you can have multiple event handlers registered.

    What is the scenario you are trying to achieve with this? You will need to redesign your workflow, but it's not clear what the goal is to make any suggestions.

    --Rob

    Tuesday, August 06, 2013 2:52 PM
    Owner
  • IMHO, I believe you should take a different approach to your application and leverage multithreading to perform your background processing.
    Tuesday, August 06, 2013 5:17 PM

All replies

  • Hi Raj,

    There isn't a direct analogy to PeekMessage in Windows Store apps, but pointer messages are routed and you can have multiple event handlers registered.

    What is the scenario you are trying to achieve with this? You will need to redesign your workflow, but it's not clear what the goal is to make any suggestions.

    --Rob

    Tuesday, August 06, 2013 2:52 PM
    Owner
  • Hi Rob,

    I already have a desktop app that i am trying to port to a store app. 

    The desktop app is doing the way i mentioned in my first post, when there is a mouse down it starts to perform an operation and deep down it tries to see if there are any mouse move and if there are any then it continues to do some processing until it receives a mouse up and then finishes the processing and then returns back .. 

    assuming all the mouse-move "peek" operation are done in, say funcX

    the reason i want to keep it the way it is is because there are many functions that come before funcX and it needs some code rewrite to fit into proper "pointer-move" event handler mechanism.

    Thanks,


    Raj

    Tuesday, August 06, 2013 5:06 PM
  • IMHO, I believe you should take a different approach to your application and leverage multithreading to perform your background processing.
    Tuesday, August 06, 2013 5:17 PM