Note that there are some explanatory texts on larger screens.

plurals
  1. POtouch-scroll on winapi
    primarykey
    data
    text
    <p>I want to implement touch-scroll like behavior for pure WinAPI program. I spent few days already.</p> <p>I tried few ways so far. Most successful was to disable the whole window with EnableWindow(hwnd, false), and then capturing all mouse events and dispatching them to children. I could find all children using GetCursorPos/GetTopWindow/GetNextWindow. But now it only works for buttons and other simple things. The EDIT control will not respond, because it is in disabled state (because the whole window is disabled).</p> <p>I also tried WM_PARENTNOTIFY. But this will not work, because when you receive this message, you cannot stop the child from getting it immediately. And for touch-scrolling you need that.</p> <p>This is frustrating. I think the only option is to do some low-level interception of mouse messages. With the ability to queue them and then either send to children or discard if actual scrolling occurs. But how to do that exactly? What I need is to get mouse event in main window BEFORE it goes to a child tree, and be able on some condition to stop this event if I want from going to child tree.</p> <p>Without it I can only think about using keyboard modifier. So when user press CONTROL (for example) the whole window will be temporary disabled and all mouse events will go to scrolling. But this is the last resort. I would love to have exact "phone" behavior, so that if you press the mouse button and start moving within 100 ms - it will scroll, if no movement is detected in 100 ms, then events go normal way.</p> <p>I need this for my cross-platform library, I want it to work the same across all platforms including Windows XP.</p> <p>Thank you.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload