Results 1 to 8 of 8

Thread: File path for mouse cursor

  1. #1

    Thread Starter
    New Member
    Join Date
    Mar 2023
    Posts
    4

    File path for mouse cursor

    Hi guys, I want to get the file path under the mouse cursor, how can I do that?

  2. #2
    Addicted Member
    Join Date
    Jul 2022
    Posts
    239

    Re: File path for mouse cursor

    Are you creating your own form and displaying the contents of folders? You'll need to explain more to get any help.

  3. #3
    PowerPoster Elroy's Avatar
    Join Date
    Jun 2014
    Location
    Near Nashville TN
    Posts
    10,180

    Re: File path for mouse cursor

    I'm assuming you want the executable of the process of the hWnd the cursor is over.

    The Spy.vbp comes pretty close to doing this. If it doesn't directly do it, it'd be pretty easy to add it. Or, it's not difficult to just do this directly. It'd take the following API calls:

    GetCursorPos
    WindowFromPoint
    GetWindowThreadProcessId
    GetModuleFileNameExW
    Any software I post in these forums written by me is provided "AS IS" without warranty of any kind, expressed or implied, and permission is hereby granted, free of charge and without restriction, to any person obtaining a copy. To all, peace and happiness.

  4. #4

    Thread Starter
    New Member
    Join Date
    Mar 2023
    Posts
    4

    Re: File path for mouse cursor

    Quote Originally Posted by jdelano View Post
    Are you creating your own form and displaying the contents of folders? You'll need to explain more to get any help.
    When the mouse passes over a folder, return the path of that folder (including the computer desktop).

  5. #5

    Thread Starter
    New Member
    Join Date
    Mar 2023
    Posts
    4

    Re: File path for mouse cursor

    Quote Originally Posted by Elroy View Post
    I'm assuming you want the executable of the process of the hWnd the cursor is over.

    The Spy.vbp comes pretty close to doing this. If it doesn't directly do it, it'd be pretty easy to add it. Or, it's not difficult to just do this directly. It'd take the following API calls:

    GetCursorPos
    WindowFromPoint
    GetWindowThreadProcessId
    GetModuleFileNameExW
    I have tried many methods, but none of them have source code support.

  6. #6
    Addicted Member -Franky-'s Avatar
    Join Date
    Dec 2022
    Location
    Bremen Germany
    Posts
    247

    Re: File path for mouse cursor

    You should give a little more information. Which program is the mouse cursor over? Your own program and which control or is it another program such as Explorer?

  7. #7

    Thread Starter
    New Member
    Join Date
    Mar 2023
    Posts
    4

    Resolved Re: File path for mouse cursor

    Quote Originally Posted by -Franky- View Post
    You should give a little more information. Which program is the mouse cursor over? Your own program and which control or is it another program such as Explorer?
    YES!! Explorer.

  8. #8
    PowerPoster Elroy's Avatar
    Join Date
    Jun 2014
    Location
    Near Nashville TN
    Posts
    10,180

    Re: File path for mouse cursor

    Quote Originally Posted by wtusvi View Post
    YES!! Explorer.
    Ohhh, cancel everything I said in post #3. It would have been nice to know this when you originally posted!

    AFAIK, I've never really seen any "automation" for Windows explorer, which is what it would take to do this. However, you can certainly do it with a Windows File Explorer add-in. I routinely install the little Path Copy Copy utility on new Windows computers.

    Is that what you're looking for? Next time, please be more clear as to what you want!
    Any software I post in these forums written by me is provided "AS IS" without warranty of any kind, expressed or implied, and permission is hereby granted, free of charge and without restriction, to any person obtaining a copy. To all, peace and happiness.

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