From a4ee0eb182c7154c359ae35985776ede0c11ca6a Mon Sep 17 00:00:00 2001 From: 0CodErr <0CodErr@kolibrios.org> Date: Sun, 1 Apr 2018 07:53:27 +0000 Subject: [PATCH] Copy command line parameters at start to EditBox git-svn-id: svn://kolibrios.org@7212 a494cfbc-eb01-0410-851d-a64ba20cac60 --- programs/system/RunOD/1/LScript.x | 7 +++++-- programs/system/RunOD/1/RUN.asm | 9 ++++++++- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/programs/system/RunOD/1/LScript.x b/programs/system/RunOD/1/LScript.x index 2cc4ff9007..9bcdec43c9 100644 --- a/programs/system/RunOD/1/LScript.x +++ b/programs/system/RunOD/1/LScript.x @@ -2,6 +2,9 @@ PATH_SIZE = 1024; PARAMS_SIZE = 256; STACK_SIZE = 1024; +AppParams = $END + PATH_SIZE; +AppPath = $END; + SECTIONS { .all : AT(0){ @@ -12,8 +15,8 @@ SECTIONS LONG(END); LONG($END + PATH_SIZE + PARAMS_SIZE + STACK_SIZE); LONG($END + PATH_SIZE + PARAMS_SIZE + STACK_SIZE); - LONG($END + PATH_SIZE); - LONG($END); + LONG(AppParams); + LONG(AppPath); *(.text) *(.rdata) *(.data) diff --git a/programs/system/RunOD/1/RUN.asm b/programs/system/RunOD/1/RUN.asm index 824faebe0f..c1788027a5 100644 --- a/programs/system/RunOD/1/RUN.asm +++ b/programs/system/RunOD/1/RUN.asm @@ -315,6 +315,9 @@ Edit1 TEditBox <\ ; -------------------------------------------------------- ; .Data? ; ------------------------------------------------- ; ; -------------------------------------------------------- ; +Extern AppParams: Byte +Extern AppPath: Byte + BoxLib Dword ? ProcLib Dword ? @@ -347,7 +350,7 @@ ProcInfoBuffer Byte PROC_INFO_BUFFER_SIZE Dup (?) Edit1MouseVariable Dword ? Edit1TextBuffer Byte EDIT1_TEXT_BUFFER_SIZE + 2 Dup (?) ; buffer for Edit1.text -TmpBuffer Byte TMP_BUFFER_SIZE Dup (?) ; this buffer uses in StrInsert +TmpBuffer Byte TMP_BUFFER_SIZE Dup (?) ; this buffer uses in StrInsert ; -------------------------------------------------------- ; .Code ; -------------------------------------------------- ; ; -------------------------------------------------------- ; @@ -576,6 +579,10 @@ OnButtonBrowse Endp Invoke GetProcAddress, ProcLib, CStr("OpenDialog_start") mov OpenDialogStart, eax +; Copy command line parameters to EditBox +; Assume EDIT1_TEXT_BUFFER_SIZE > PARAMS_SIZE(defined in linker-script) + Invoke EditBoxSetText, Offset Edit1, Offset AppParams + ; it need for case if spaces are present in filepath lea eax, [OpenFilePathBuffer + 1] mov OD.openfile_path, eax