Sign in to follow this  
Followers 0
GajjarTejas

FileSelectFolder - Problem with Path

8 posts in this topic

#1 ·  Posted (edited)

I am creating an application that required the FileSelectFolder with valid path.When user select a my computer ,Control Panel path then problem with path because in my application does not define this type of path.

so the required to disable the OK button when user select my computer, Control Panel types of path.How can I Disable ok button of FileSelectFolder?

Edited by GajjarTejas

Share this post


Link to post
Share on other sites



Try this:

Do
$var = FileSelectFolder("Choose a folder.", "")
Until $var <> "Computer" And $var <> "Control Panel"
MsgBox(0,"",$var & " is a valid path.")

Share this post


Link to post
Share on other sites

Thaks Friend For Your Reply ;) but some times I see that when we select "my computer" or "control panel" the OK button is automatically disabled whats that(In 7Z FM)?

Example: Point to zip File--right click on it--Extract File--Browse...(In 7Z FM)

LOOK LIKE THIS

Posted Image

Share this post


Link to post
Share on other sites

Because those are not folders you can extact a zip file to. You can't create a folder in MyComputer, or in the Control Panel. The application is trying to help you by showing you where you can and cannot save the zip contents to.


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

I understand what you are looking for, but I don't think AutoIt can do exactly what you want. The closest you can come to that is to start at the user's root drive.

Local $var = FileSelectFolder("Choose a folder.", @HomeDrive, 7)

RAID Calculator | Software Installer

The truth has been suppressed since the dawn of time.

Share this post


Link to post
Share on other sites

#include <GUIConstantsEx.au3>

#include <ButtonConstants.au3>



$Gui=GUICreate('FileSelectFolder')

$Button=GUICtrlCreateButton('-', 10, 10, 21, 21, $BS_ICON)

GUICtrlSetImage(-1, @SystemDir & 'shell32.dll', 4, 0)

GUISetState ()

While 1

    $msg = GUIGetMsg()

    Switch $msg

        Case $Button

            $Path = FileSelectFolder('', '', 3, @DesktopDir, $Gui)

            If @error Or Not StringInStr(FileGetAttrib($Path), "D") Then ContinueLoop

            MsgBox(4096, 'Folder', $Path)

        Case $GUI_EVENT_CLOSE

             Exit

    EndSwitch

WEnd

Share this post


Link to post
Share on other sites

I understand what you are looking for, but I don't think AutoIt can do exactly what you want. The closest you can come to that is to start at the user's root drive.

Local $var = FileSelectFolder("Choose a folder.", @HomeDrive, 7)

Thats a Good Idea...

ok there are many alternative way that can i do it.also thanks @AZJIO and @JLogan3o13 :bye:

Share this post


Link to post
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
Sign in to follow this  
Followers 0