Sign in to follow this  
Followers 0
Guest Garen

File Path ...

6 posts in this topic

Hello

I can't get a file path, for example using WinGetActiveStats I can get the Title, Width, positoin of active file, but not PATH (C:\\??????????\\???????\\)

Please help

Share this post


Link to post
Share on other sites



Hello

I can't get a file path, for example using WinGetActiveStats I can get the Title, Width, positoin of active file, but not PATH (C:\\??????????\\???????\\)

Please help

WinGetActiveStats retrieves information about the active window not about the active program that generates this window.

Maybe you can explain what you would like to accomplish ?


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

Ok, may be my question were not so correct asked

So, I will ask it in example

You are right, about the WinGetActiveStatus that it take the information about the active window, I know this, So I want find the way which can detect the full path of this active window

For me it is need for detecting opened Folder's path

And I have ones more question.

Is there any way like the command "while" ?

example:

While, <InputBox, variable, title, massage>, <do something>

It is need for blocking some an other action during the Input

I try to put password on files or folders which I want to protect using command WinWaitAstive, WinHide, when any want to open my folder there appear the dialog with question of password, but when user try to open the folder again ignoring the question script don't work (It still stay at the old command of INputing the password)

sorry for my bad english if any thing I have written not correctly

Share this post


Link to post
Share on other sites

There's an option which you should enable: Run Explorer\Tools\Folder Options\View\ --> Display the full Path in Title Bar

Now you should be able to read the path from the windows title bar !?

What I've understand from your 2nd request (I'm sorry too my english isn't much better) ...

You want to protect files/folders not to be accessed without permission?

On the other hand - if the login was done once successfull, you don't want to be asked again?

Can you provide some code. Don't be shy ... :whistle:

Share this post


Link to post
Share on other sites

it is very simple way, I know

I want show the problem width this line: InputBox, password, Entering Password, Please - Enter Your Password!, hide

If user ignore this dialog and try open the folred, the script dose not work this time

and is there any an other way to get full path of opend folder ?

start:

WinWaitActive, MyFolderName

WinHide, MyFolderName

start2:

InputBox, password, Entering Password, Please - Enter Your Password!, hide

IfEqual, password, mypassword, Goto, open

WinClose, MyFlderName

MsgBox, 49, ERROR, wrong password, If you Want try again enter OK

IfMsgBox, OK, Goto, start2

Goto, start

open:

WinShow, MyFolderName

Share this post


Link to post
Share on other sites

let's make somethings sure first. I'm assuming these, tell me if you don't agree:

-you want any attempt to open a specific folder (let's call it MyFolderName) to be blocked unless authenticated.

-if there are folders within MyFolderName then you WILL HAVE TO enable "Display the full Path in Title Bar" as beastmaster said.

-if there are no folders inside it then its okay.

now try this:

DetectHiddenText, on
SetBatchLines, 200
SetTitleMatchMode, 2
SetWinDelay, 1

start:
IfWinExist, MyFolderName,, goto, start2
sleep,1000
goto, start

start2:
InputBox, password, Entering Password, Please - Enter Your Password!, hide
IfEqual, password, mypassword, Goto, open
WinClose, MyFolderName
MsgBox, 49, ERROR, wrong password, If you Want try again enter OK
IfMsgBox, OK, Goto, start2
Goto, start

open:
WinShow, MyFolderName

[ADLIB]
MyFolderName,,WinHide, MyFolderName

this script works alright, but if someone can then plz shed light on why does it take some time (or changing the active window) before the inputbox is shown.

Share this post


Link to post
Share on other sites
Sign in to follow this  
Followers 0