I bought PB a few days ago and I'm searching for some help now

What I want to do:
I need to detect which mouse button is clicked while the mouse is hovering over a window (which is NOT my own!).
That window can be e.g. the Windows inbuilt file manager (aka Windows Explorer). The window
can already be the active one but this isn't a necessity (so it must work while the mouse is
hovering over it as well).
Additionally I need the information if one of the mouse buttons is not only clicked but hold
as well. There would be a minimal timeout that needs to be reached until such a "hold" would
count as a "hold", e.g. 200 ms (but this value would be user configurable).
Additionally (sorry!), it matters if the mouse gets moved while the first click was initiated.
E.g. the right mouse button is pressed and the mouse is moved 50px to somewhere else in
e.g. 1500 ms would be different from just clicking it and releasing it immediately after.
And the last thing: I need to be able to detect if a modifier key (or a combination of them)
is pressed when an initial click is happening (it doesn't matter if the keys are still pressed
when a mouse button is released). Modifier keys are shift, ctrl + alt. Win would be nice
but isn't a necessity.
The whole thing isn't ultra complicated in AutoHotkey (which I can't use for this application)
but I struggle to find anything that gets this done in PureBasic...
This does not need be cross-platform, the only supported platform is Windows...
Can a forum member help me out please?
Thank you,
Jacky