Jump to content

Wrong FileOpenDialog directory after creating exe


Go to solution Solved by sumitvc9,

Recommended Posts

Hi,

I am using fileopendilog to pick a file from directory. Directory location is stored in a file, after reading file I am storing this location in a variable. And I am passing this variable to a function triggers FileOpenDialog. This works fine if I run the script directly from scite.

But once I create an executable it's picking up the last accessed directory location.

Any idea what might be going wrong.

Here is  sample code:

$SMEBrowseB = GUICtrlCreateButton("Browse", $BX, $IBY, $BW, $BH)

GUICtrlSetOnEvent($SMEBrowseB,"_GetSMEBrowseB")

func _GetSMEBrowseB()
   $SMELoc = GetSMEPath("SME Location", $SMEDir, "SME (*.sme_exe;*.sme_proj)" )
   WinActivate($MainForm)
   ControlSetText("","",$SMEPath,$SMELoc)
EndFunc
 
Func GetSMEPath ($Title,$Dir,$Ext)
   MsgBox("","Dir",$Dir) ; Geting right location
   Local $Path=0
   Local $FilesList=""
   $Path = FileOpenDialog($Title, $Dir, $Ext,1 )
   $Title=""
   $Dir=""
   $Ext=""
   return $Path
EndFunc
Link to comment
Share on other sites

FileChangeDir have a look at the WorkingDir.

Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Link to comment
Share on other sites

I think it's maybe related to this?

http://msdn.microsoft.com/en-us/library/windows/desktop/ms646839%28v=vs.85%29.aspx
OPENFILENAME structure
lpstrInitialDir
Windows 7: If lpstrInitialDir has the same value as was passed the first time the application used an Open or Save As dialog box, the path most recently selected by the user is used as the initial directory.

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...