You are here

Problem launching Java app with minimised console

1 post / 0 new
Matt Harris
Offline
Last seen: 12 years 4 months ago
Joined: 2008-10-14 05:13
Problem launching Java app with minimised console

I'm working on a launcher for a Java application and wish to have the console window to be minimised at startup.

The use of the javaw.exe executable (instead of java.exe) is not a suitable solution as certain console messages need to be visible.

At the moment, the code snippet below launches successfully, but with a normal console window:

; create STARTUPINFO structure
System::Alloc /NOUNLOAD 68
Pop $5
System::Call /NOUNLOAD '*$5(i 68, i, i, i, i, i, i, i, i, i, i, i 1, i 6, i, i, i, i, i)'
; create PROCESS_INFORMATION structure
System::Call /NOUNLOAD '*(i, i, i, i)i .r6'
; create the process
System::Call /NOUNLOAD `kernel32::CreateProcess(i, t '$EXESTRING', i, i, i 0, i 0, i, i, i r5, i r6)i .r7`
System::Free /NOUNLOAD $5
System::Free $6

I believe that I need to pass the parameter SW_MINIMIZE in the STARTUPINFO structure to the CreateProcess function of kernel32 but am having trouble achieving this with the System plug-in.

Any help would be gratefully received.

Best regards,

Matt Harris