CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 9 of 9
  1. #1
    Join Date
    May 2002
    Posts
    121

    intercepting mouse click

    Hi,

    How can i interecept a mouse click outside of the application?

  2. #2
    Join Date
    Dec 2000
    Location
    Slovakia
    Posts
    1,043
    Control.Capture property will do it... Read about Capture property in MSDN...

    martin

  3. #3
    Join Date
    May 2002
    Posts
    121
    I've looked at it and it seems like it allows only to capture events with in the window of the application.

    Can you provide some links?

    Thanks.

  4. #4
    Join Date
    Nov 2002
    Location
    Singapore
    Posts
    1,890
    actually when u click outside of the app then focus is lost isn't it...

    Paresh

  5. #5
    Join Date
    Nov 2002
    Location
    Singapore
    Posts
    1,890
    you could try Cursor.Position

  6. #6
    Join Date
    Jul 2002
    Location
    EU
    Posts
    68
    I think I know what you need, but it is not going to be simple. You need something like a spy - a program that "hooks" Windows messages, grabs them before they reach their target application.

    A possible answer is the article
    ms-help://MS.VSCC/MS.MSDNQTR.2002OCT.1033/dnwui/html/msdn_hooks32.htm
    (I put here the address from my Microsoft Visual C#.net help - it should also work for you). If I am not wrong, this article provides the source code for a dll that you may use for creating your own hook.

    I used this code to make my own hook in C# - and it was not pleasant, because I had to use unsafe code. But maybe you can find a better way.

    Hope this helps.

    Petru

  7. #7
    Join Date
    Nov 2002
    Location
    Singapore
    Posts
    1,890
    the link doesn't come up.

    Paresh
    - Software Architect

  8. #8
    Join Date
    Jul 2002
    Location
    EU
    Posts
    68
    Sorry - I did not know how to post the address of the article.

    So this is its name:
    ------------
    Win32 Hooks

    Kyle Marsh
    Microsoft Developer Network Technology Group
    -------------

    It can be found in MSDN in
    --------
    Windows User Interface Technical Articles
    --------

    Maybe you can search it using some keywords.


    In fact, I just copied the link that I did in the previous article, opened
    a dynamic help / search session, asked for whatever ("hook", for instance),
    clicked on a link in the "Search result" window, and in the "Help" toolbar that appeared, I pasted the link; and lo! there it was.

    Petru

  9. #9
    Join Date
    Nov 2002
    Location
    Singapore
    Posts
    1,890
    thank you .
    will look in to it.
    - Software Architect

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured