Copy command line parameters at start to EditBox

git-svn-id: svn://kolibrios.org@7212 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
0CodErr 2018-04-01 07:53:27 +00:00
parent 62c0d24f6c
commit a4ee0eb182
2 changed files with 13 additions and 3 deletions

View File

@ -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)

View File

@ -315,6 +315,9 @@ Edit1 TEditBox <\
; -------------------------------------------------------- ;
.Data? ; ------------------------------------------------- ;
; -------------------------------------------------------- ;
Extern AppParams: Byte
Extern AppPath: Byte
BoxLib Dword ?
ProcLib Dword ?
@ -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