Jump to content

Is These Possible?


Recommended Posts

  • Moderators

Darknight1366,

- 1. I do not think you can detect anyone just opening a folder. This UDF can detect the following:

•folder and file renames

•folder and file creates

•folder and file deletes

•folder and file updates

•drive additions

•drive removals

But that does not help you and I do not think the Shell can do much more. ;)

- 2. FileInstall will load files onto a machine when the compiled .exe is run, but I have never seen a progress bar associated with it. You might want to think about a marquee progress like this to at least show something is happening: :idiot:

#include <GUIConstantsEx.au3>
#include <ProgressConstants.au3>

$hGUI = GUICreate("Test", 500, 500)
GUICtrlCreateProgress(10, 10, 400, 20, $PBS_MARQUEE)
GUICtrlSendMsg(-1, $PBM_SETMARQUEE, True, 50) ; final parameter is update time in ms
GUISetState()

While 1
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch
WEnd

Sorry I cannot be of more help. :)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

If you know what program the folder will be opened with, i.e. Explorer, you can check the title text. When the Explorer process exist and the path is found in the title text call your script function. This would work with any program opening the folder which shows the path in the title (or other) text.

Link to comment
Share on other sites

My Explorer does not show anything in the Title.

But if you are using explorer and select the folder you can use this to keep your system very buzy!

Dim $bak, $bak1
HotKeySet("{ESC}", "Ontsnap")
While 1
Send("^c")
    $bak = ClipGet()
    If $bak1 <> $bak Then
        If $bak = "C:\Test2" Then MsgBox(0, "GotHa!", $bak & ' was selected!', 4)
        $bak1 = $bak
    EndIf
    Sleep(17)
WEnd
Func Ontsnap()
    Exit 0
EndFunc

Spelling!

Edited by JoHanatCent
Link to comment
Share on other sites

My Explorer does not show anything in the Title.

But if you are using explorer and select the folder you can use this to keep your system very buzy!

Dim $bak, $bak1
HotKeySet("{ESC}", "Ontsnap")
While 1
Send("^c")
    $bak = ClipGet()
    If $bak1 <> $bak Then
        If $bak = "C:\Test2" Then MsgBox(0, "GotHa!", $bak & ' was selected!', 4)
        $bak1 = $bak
    EndIf
    Sleep(17)
WEnd
Func Ontsnap()
    Exit 0
EndFunc

Spelling!

Mine does not show a title either, but it still has the title set to the path which is returned by WinGetTitle(). Certainly it would consume system resources for a highly limited utility, regardless of several ways of limiting those resource requirements. However, my response was geared toward what was merely possible, per the OP question. I would never accept accept this resource cost for such a utility myself, especially using AutoIt, but I have seen tray apps that were just as bad or worse.
Link to comment
Share on other sites

You might try creating a custom web view for the folder, and triggering something from there when the folder is opened. I can't say I've ever tried it, but you might look into it.

Some links to help you out:

http://support.microsoft.com/kb/812003

http://www.virtualplastic.net/html/wv_main.html

I understand that much of this functionality was disabled with XP SP2, but one person claims to have found a way to re-enable it.

http://www.pcreview.co.uk/forums/windows...thout-setting-folder-syste-t22

Hope that is helpful.

Link to comment
Share on other sites

MayBe a not so Buzy method?

Dim $bak = "C:\Test2"; Your folder name
HotKeySet("{ESC}", "Ontsnap")
While 1
    If ControlGetText('[CLASS:CabinetWClass]','','Edit1') =  $bak Or _ 
    ControlGetText('[CLASS:ExploreWClass]','','Edit1') = "C:\Test2" Then MsgBox(0, "GotHa!", $bak & ' was selected!', 4)
     Sleep(17)
WEnd
Func Ontsnap()
    Exit 0
EndFunc
Link to comment
Share on other sites

Hers my simple offer.

$sFolder = "folder\path"

While 1
    Sleep(100)
    $sWinGetText = WinGetText("[ACTIVE]")
    If StringInStr($sWinGetText, $sFolder) Then
        _MyFunc()
    EndIf
WEnd

Func _MyFunc()
    MsgBox(0, "MsgBox", $sFolder & " Opened")
EndFunc   ;==>_MyFunc
Edited by JohnOne

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Link to comment
Share on other sites

Both those solutions work to an extent, but they continue to trigger as long as the folder is open/has focus, rather than just triggering once per folder open event.

Merging JoHanatCent's "buzy" solution with JohnOne's gives

Dim $sFolder = "C:\test"
Dim $bak = ""

While 1
    Sleep(100)
    $sWinGetText = WinGetText("[ACTIVE]")
    If $sWinGetText <> $bak Then
        If StringInStr($sWinGetText, $sFolder) Then _MyFunc()
        $bak = $sWinGetText
    EndIf
WEnd

Func _MyFunc()
    MsgBox(0, "MsgBox", $sFolder & " Opened")
EndFunc   ;==>_MyFunc

This eliminates the looping while the folder is open, but still triggers every time the folder looses focus, then regains it.

To meet the OP's original need as stated, I still think that the custom folder.htt will work the best. The folder.htt is only loaded on folder open or refresh, so should not re-trigger when re-gaining focus.

---Edit---

The unfortunate drawback to the folder.htt solution though, is that it will only work up through WinXP. It will not work with Vista or Win7. That functionality was removed with those versions.

Edited by willichan
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...