Jump to content

Screen resolution and mousetrap


Recommended Posts

Hello,

Do you know if there's a way to adapt the position of _mousetrap according to the screen resolution ?

I can do that :

If @DesktopHeight == "600" And @DesktopWidth == "800" Then
     _MouseTrap(400, 491)
ElseIf @DesktopHeight == "600" And @DesktopWidth == "896" Then
     _MouseTrap(422, 491)
ElseIf @DesktopHeight == "768" And @DesktopWidth == "1024" Then
     _MouseTrap(512, 576)
ElseIf @DesktopHeight == "768" And @DesktopWidth == "1152" Then
     _MouseTrap(576, 576)
ElseIf @DesktopHeight == "864" And @DesktopWidth == "1152" Then
     _MouseTrap(576, 623)
    EndIf

but it's a very very poor method and really not reliable.

Any idea ?

Merci.

Link to comment
Share on other sites

Hello,

Do you know if there's a way to adapt the position of _mousetrap according to the screen resolution ?

I can do that :

If @DesktopHeight == "600" And @DesktopWidth == "800" Then
     _MouseTrap(400, 491)
ElseIf @DesktopHeight == "600" And @DesktopWidth == "896" Then
     _MouseTrap(422, 491)
ElseIf @DesktopHeight == "768" And @DesktopWidth == "1024" Then
     _MouseTrap(512, 576)
ElseIf @DesktopHeight == "768" And @DesktopWidth == "1152" Then
     _MouseTrap(576, 576)
ElseIf @DesktopHeight == "864" And @DesktopWidth == "1152" Then
     _MouseTrap(576, 623)
    EndIf

but it's a very very poor method and really not reliable.

Any idea ?

Merci.

What are you trying to do here? Maybe give us a hint?
Link to comment
Share on other sites

Well, if you trap the mouse for example on a static button "clickable" with a 600x800 resolution screen, if you keep the same position and you change the screen resolution (or user with other resolution), you are going to click at side.

I hope you understand ?

Link to comment
Share on other sites

Well, if you trap the mouse for example on a static button "clickable" with a 600x800 resolution screen, if you keep the same position and you change the screen resolution (or user with other resolution), you are going to click at side.

I hope you understand ?

You can do this by first getting the WinPos using WinGetPos(), and then find out the range that the button is apart from in pixel, and then just add length and width for the mouse trap.
Link to comment
Share on other sites

Yes but no :whistle:

I can't get the WinPos and the program stop working. It's to secure a desktop on vista and if you press ctrl+alt+del you've got one future which disable the protection (in french : "options ergonomique" -i don't know how that call in english, sorry) you can't do anything, only trap the mouse on "cancel" button to return in the protect session (or press escape but send() _ispressed() hotkeyset() don't work because the program stop working).

I sought many solution (with credential provider, throught registry, hook keyboard, etc) but nothing else work on this sequence :lmao:

Link to comment
Share on other sites

Yes but no :whistle:

I can't get the WinPos and the program stop working. It's to secure a desktop on vista and if you press ctrl+alt+del you've got one future which disable the protection (in french : "options ergonomique" -i don't know how that call in english, sorry) you can't do anything, only trap the mouse on "cancel" button to return in the protect session (or press escape but send() _ispressed() hotkeyset() don't work because the program stop working).

I sought many solution (with credential provider, throught registry, hook keyboard, etc) but nothing else work on this sequence :lmao:

Maybe a screenshot will be helpful.
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...