Welcome Guest.   Make a donation to an author on the site November 01, 2014, 08:25:23 AM  *

Please login or register.
Or did you miss your validation email?


Login with username and password (forgot your password?)
Why not become a lifetime supporting member of the site with a one-time donation of any amount? Your donation entitles you to a ton of additional benefits, including access to exclusive discounts and downloads, the ability to enter monthly free software drawings, and a single non-expiring license key for all of our programs.


You must sign up here before you can post and access some areas of the site. Registration is totally free and confidential.
 
Your Support Funds this Site: View the Supporter Yearbook.
   
  Forum Home Thread Marks Chat! Downloads Search Login Register  
  Show Posts
      View this member's profile 
      donate to someone Donate to this member 
Pages: [1]
1  DonationCoder.com Software / Post New Requests Here / Re: IDEA: Confine Mouse to Specific Monitor in Multi-monitor setup on: October 29, 2009, 04:07:15 PM
Thanks for welcome. smiley

Yes, I wrote the code. If something isn't clear, I can explain it.
2  DonationCoder.com Software / Post New Requests Here / Re: IDEA: Confine Mouse to Specific Monitor in Multi-monitor setup on: October 29, 2009, 03:21:27 PM
This code is what probably everybody in this thread is looking for and its a pure AHK solution without .NET-Frameworks. Just start and hit Win+C to enable / disable.

Formatted for AutoIt with the GeSHI Syntax Highlighter [copy or print]
  1. #SingleInstance,Force
  2. #NoEnv
  3.  
  4. ; Mouse Rectangle Lock / Release
  5. #c::
  6. If IsActive = True
  7. {
  8. SetTimer, KeepLock, Off
  9. DllCall("ClipCursor", UInt, 0)
  10. IsActive = False
  11. } else {
  12. VarSetCapacity(Rect, 16) ; Define var size
  13. NumPut(0, Rect, 0) ; Left
  14. NumPut(0, Rect, 4) ; Top
  15. NumPut(1600, Rect, 8) ; Right
  16. NumPut(1200, Rect, 12) ; Bottom
  17. DllCall("ClipCursor", UInt, &Rect)
  18. SetTimer, KeepLock, 50
  19. ActiveOld := WinActive("A")
  20. IsActive = True
  21. }
  22.  
  23. KeepLock:
  24. Active := WinActive("A")
  25. If Active <> %ActiveOld%
  26. {
  27. ActiveOld := Active
  28. DllCall("ClipCursor", UInt, &Rect)
  29. }

Bye
Pages: [1]
DonationCoder.com | About Us
DonationCoder.com Forum | Powered by SMF
[ Page time: 0.109s | Server load: 0.06 ]