Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 10/08/18 in all areas

  1. Good moorning Friends, Just wanted to advise. - ShellExecute works fine on VCL Desktop applications only. - ShellExecute does'nt work on a Windows Service ! Because of Windows Security (Session0, Session 1) introduced after Windows 7 use instead CreateProcessAsUser like this : procedure TMainForm.RunApp(cmdLine, WorkDir: String); var hToken: THandle; StartupInfo: TStartupInfo; ProcessInfo: TProcessInformation; res: boolean; begin GetStartupInfo(StartupInfo); if WTSQueryUserToken(WtsGetActiveConsoleSessionID, hToken) then begin { 1. For an application.exe (exemple : NotePad.exe) res := CreateProcessAsUser(hToken, PChar(Path_appName), PChar(cmdLine), nil, nil, False, CREATE_NEW_CONSOLE, nil, PChar(WorkDir), StartupInfo, ProcessInfo); } {2. For a DOS command line (Example FireBird : cmdLine:='gbak.exe -user sysdba -pas masterkey -b -nt "D:\Base.fdb" "D:\toto.fbk" '; WorkDir:='C:\Program Files\Firebird\Firebird_2_5\bin'; } res := CreateProcessAsUser(hToken, Nil, PChar('cmd.exe /C ' + cmdLine), nil, nil, True, CREATE_NO_WINDOW, nil, PChar(WorkDir), StartupInfo, ProcessInfo); if res then WaitForSingleObject(ProcessInfo.hProcess,INFINITE); end; end; That will save you much time Regards.
    2 points
  2. Hi. This example, show how to upload one or multiple files using javascript and ajax notification. the example show file upload progress and uploaded completed, and save the uploaded files in server folder. simply drag files into blue box. example using unigui 0.89 and xe2. MuploadSample_en.zip 05-12-2016: Modified for latest uniGUI version. (Farshad) MuploadSample_en.rar
    1 point
×
×
  • Create New...