User Tag List

Results 1 to 3 of 3

Thread: Detecting Microsoft Windows actions (like delete)

  1. #1
    Clicker Fusion 2.5
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    JimJam's Avatar
    Join Date
    Jun 2006
    Location
    USA
    Posts
    338
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)

    Question Detecting Microsoft Windows actions (like delete)

    Hi everyone. I'm trying to recreate a portable recycle bin app, like the one here: https://sourceforge.net/projects/ibin/

    So in Windows, you can't use the Recycle Bin on most USB flash drives or SD cards. When you press the "DELETE" key, it permanently deletes the file. What the program iBin does, is essentially detect if Windows has gotten a "DELETE FILE" command and intercepts this action. iBin then moves the file/folder to its own "portable recycle bin" folder for temporary storage. Then using iBin's recyle-bin interface, you can choose to either permanently delete the items (empty trash) or restore items to their previous directories.

    So I'm attempting to recreate this functionality in Fusion. I've created a frame which allows me to drag-n-drop files into the frame window, and it moves them to its "bin" folder. It stores the original location in an INI file. So the "delete and restore" functions work fine.

    But the only way I was able to make this work is by physically clicking, dragging, and dropping the files into the Fusion application window.

    Ideally, I would like to be able to just press the "DELETE" key on my keyboard, in a normal Windows Explorer window, and have the Fusion app detect this action, and redirect the file for its own purposes. But I can't figure out how to accomplish that.

    iBin was created with scripting language called AutoHotKey. AutoHotKey has a development function called "WindowSpy" which basically lets you get some basic information about the currently focused window. This allows you to setup hotkeys and functions for special programs. For example, it can detect when "notepad.exe" is running, and get info from your Notepad window.

    So anyone got any ideas? My app would need to be able to do these things:
    1. Detect DELETE key or DELETE button for files/folders in normal explorer windows.
    2. Retrieve the PATH of the files that are selected (for moving)
    3. Cancel/override the default Windows "Are you sure you want to permanently delete this file?" message box.


    The rest of it I have already figured out, and as a drag-n-drop recycle bin, it works great.

  2. #2
    Clickteam Clickteam
    Danny's Avatar
    Join Date
    Aug 2007
    Location
    United Kingdom
    Posts
    3,006
    Mentioned
    21 Post(s)
    Tagged
    2 Thread(s)
    JimJam, I like a good challenge and I love this one. On the face of it, this almost looks impossible. But, I think with some clever thinking, it could be possible.

    When you hit the delete key on your keyboard, it just acts like a hotkey (shortcut key). Windows "moves" the file to the recycle bin (which is classed as a temporary folder), so it doesn't perform a "delete" command. This would be good, as this is the time window where you need to intercept, however, as you stated, this window is gone in USB/SD cards.

    I will take a look at how this is handled with Windows best I can tomorrow. In the meantime, I have an idea in which you can do this without too much hassle, as a fail-safe if I can't find any other direction.
    Want to learn Clickteam Fusion 2.5?




  3. #3
    Clicker Fusion 2.5
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    JimJam's Avatar
    Join Date
    Jun 2006
    Location
    USA
    Posts
    338
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Cool. On USB's there is a dialog window that pops up, its just not the recycle window. The dialog window says something like "Are you sure you want to permanently delete this file?" with the options of "Yes" or "Cancel." On USBs, this option does indeed permanently delete the file (technically, it likely just flags the bytes for overwrite, and not actually write them as zeros)

    So if there was some way to intercept the dialog window, and get a text copy of all the files/directories selected, it could be done. As I said before, AutoHotKey does have this feature by letting you use WindowSpy to get the process name and other info from a running application/window. I don't know if Fusion could do this with the Shared Data object? Or maybe another extension?

    How does Fusion get a list of files when you drag and drop them into the window? I feel like there should be some way to know what files are selected in an explorer window. Maybe with a batch file? Or command line?

Similar Threads

  1. Replies: 4
    Last Post: 8th March 2016, 09:47 PM
  2. Microsoft slashes Windows Phone developer registration fee to just $8 for 8 days
    By sbucci in forum Multimedia Fusion 2 - Technical Support
    Replies: 0
    Last Post: 30th October 2012, 07:10 PM

Posting Permissions

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