Mid Button (mouse wheel) dragging solved

After some time struggling with Declares and parameters types I managed to be able to drag objects with middle button (mouse wheel). (32 and 64 bits)
This is a normal behaviour for CAD software on Windows.
Just in case anyone could be interested I share this project with you:

https://dl.dropboxusercontent.com/u/6172411/XojoForum/MidButton2.xojo_binary_project

1 Like

Thank you for sharing :slight_smile:

[quote=255255:@Ramon SASTRE]After some time struggling with Declares and parameters types I managed to be able to drag objects with middle button (mouse wheel). (32 and 64 bits)
This is a normal behaviour for CAD software on Windows.
Just in case anyone could be interested I share this project with you:

https://dl.dropboxusercontent.com/u/6172411/XojoForum/MidButton2.xojo_binary_project[/quote]

Ramon,

I downloaded your project to study it to see if I can use that to detect right click out of MouseDown.

Unfortunately, those three methods are external and not included into the project. This makes it in practice unusable.

I wondered if these methods could have been from WFS, but that is not the case. Could you put all that with the project into a zip ?

Thank you in advance.

[quote=277807:@Michel Bujardet]Ramon,

I downloaded your project to study it to see if I can use that to detect right click out of MouseDown.[/quote]
IsContextualClick doesn’t work for you ?

No, because MouseDown does not fire (the window is in the background not to interfere with the top app).

But I now found a way to catch the right mouseclick in Win32

Declare Function GetKeyState Lib "User32" ( nVirtKey As integer ) as short getkeystate(2)

When the right button is down, it gives -127 or -128, otherwise 1 or 0.

Michel,

At this moment I’m out of office in a workshop and I can not answer properly. But sure you can do the same I did width the middle button (wheel) with the right button. And as you say values of some parameters change. Using WindowProc in the example I shared Lmsg did the thing.

[code]WindowProc(Lwnd as Integer, Lmsg as uint32, Wparam as uInteger, Lparam as Integer) as Integer
#if TargetWindows then

if Lmsg = &H207 then 
  
  'Mouse DOWN
  xIni = Lparam and &Hffff
  yIni = (Lparam and &Hffff0000) / &Hffff
  
  x0 = window1.TextField1.Left
  y0 = window1.TextField1.Top
  
  mButton = True
  
elseif Lmsg = &H208 then 
  
  'Mouse UP
  mButton = False
  
else
  
  return CallWindowProc (LocalPrevWndProc, Lwnd, Lmsg, Wparam, Lparam)
  
end if

#endif[/code]

[quote=277807:@Michel Bujardet]Ramon,

I downloaded your project to study it to see if I can use that to detect right click out of MouseDown.

Unfortunately, those three methods are external and not included into the project. This makes it in practice unusable.

I wondered if these methods could have been from WFS, but that is not the case. Could you put all that with the project into a zip ?

Thank you in advance.[/quote]

Michel,

There is nothing external. All belong to User32 dll.
In the project you’ll find all you need.

Hi, I am struggling with a crash and I suspect my own implementation could be the cause. I would be very interested in comparing it to yours, but the file you shared last year is unavailable now. Could you be so kind to share it again?

Can you try: https://www.dropbox.com/s/vn6oij0mmc2lfq3/MidButton2.xojo_binary_project?dl=0

1 Like

Thank you :slight_smile: