Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > java program launcher

Reply
Thread Tools

java program launcher

 
 
Hiker Hauk
Guest
Posts: n/a
 
      02-19-2006
Hi there,

I want to know how to write a java program launcher for Windows.

It's a .exe file to laucher a java program. Just like the one Azureus
use.

Basically, it equals command "java classname", but when looking at the
process tree, you'll see the difference.

I think it's easy to implement for people who're familiar with Win32
programming.

Could someone tell me how to do it or send me a sample program.

Thanks in advance.

 
Reply With Quote
 
 
 
 
Roedy Green
Guest
Posts: n/a
 
      02-19-2006
On 19 Feb 2006 02:12:25 -0800, "Hiker Hauk" <>
wrote, quoted or indirectly quoted someone who said :

>I want to know how to write a java program launcher for Windows.
>
>It's a .exe file to laucher a java program. Just like the one Azureus
>use.


see http://mindprod.com/jgloss/kicker.html
http://mindprod.com/jgloss/installer.html
--
Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.
 
Reply With Quote
 
 
 
 
Madroadie
Guest
Posts: n/a
 
      02-19-2006
Here is the basic app Launcher. The rest is up to you

DWORD LaunchApp(LPCTSTR szCmdLine, LPCTSTR szWorkingDir, bool bWait)
{
DWORD dwRetVal, dwCreationFlags;
STARTUPINFO sInfo;
PROCESS_INFORMATION pInfo;

dwCreationFlags = CREATE_NO_WINDOW;

ZeroMemory( &sInfo,sizeof( STARTUPINFO ) );
sInfo.cb = sizeof( STARTUPINFO );

BOOL bRet = ::CreateProcess( NULL,
(LPTSTR)(LPCTSTR)szCmdLine,
NULL,
NULL,
FALSE,
dwCreationFlags,
NULL,
szWorkingDir,
&sInfo,
&pInfo );

if (bWait)
{
WaitForSingleObject( (HANDLE)pInfo.hProcess, INFINITE );
GetExitCodeProcess( (HANDLE)pInfo.hProcess, &dwRetVal );
}
else
dwRetVal = 0;


return dwRetVal;
}


Hiker Hauk wrote:
> Hi there,
>
> I want to know how to write a java program launcher for Windows.
>
> It's a .exe file to laucher a java program. Just like the one Azureus
> use.
>
> Basically, it equals command "java classname", but when looking at the
> process tree, you'll see the difference.
>
> I think it's easy to implement for people who're familiar with Win32
> programming.
>
> Could someone tell me how to do it or send me a sample program.
>
> Thanks in advance.


 
Reply With Quote
 
weiss.matt@gmail.com
Guest
Posts: n/a
 
      02-19-2006
Check out JSmooth... http://jsmooth.sourceforge.net/

 
Reply With Quote
 
Red Orchid
Guest
Posts: n/a
 
      02-19-2006
"Hiker Hauk" <> wrote or quoted in
Message-ID: <. com>:

>
> I want to know how to write a java program launcher for Windows.
>


Maybe .. it is as like.

<code>
(This is not tested)

int APIENTRY _tWinMain (HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPTSTR lpCmdLine,
int nCmdShow) {

STARTUPINFO si;
memset(&si, 0, sizeof(si));
si.cb = sizeof(STARTUPINFO);
si.dwFlags = STARTF_USESHOWWINDOW;
si.wShowWindow = SW_HIDE;

PROCESS_INFORMATION pi = {0};
BOOL b = CreateProcess (
NULL,
"javaw.exe -jar -your option your file.jar",
NULL,
NULL,
FALSE,
NORMAL_PRIORITY_CLASS,
NULL,
NULL,
&si,
&pi );

if (!b) {

return -1;
}
WaitForSingleObject(pi.hProcess, INFINITE);
CloseHandle(pi.hThread);
CloseHandle(pi.hProcess);
return 0;
}
</code>



 
Reply With Quote
 
Thomas Kellerer
Guest
Posts: n/a
 
      02-19-2006
Hiker Hauk wrote on 19.02.2006 11:12:
> Hi there,
>
> I want to know how to write a java program launcher for Windows.
>
> It's a .exe file to laucher a java program. Just like the one Azureus
> use.
>
> Basically, it equals command "java classname", but when looking at the
> process tree, you'll see the difference.
>
> I think it's easy to implement for people who're familiar with Win32
> programming.
>
> Could someone tell me how to do it or send me a sample program.
>


The JDK sources do include the sources for the java.exe launcher which is
exactly what you want.

Thomas
 
Reply With Quote
 
Hiker Hauk
Guest
Posts: n/a
 
      02-20-2006
Thank you all. Merci beaucoup!

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Install gnu Java application launcher Peng Yu Javascript 3 09-01-2009 06:56 AM
A free and handy program categorizer/launcher anderson_geller@yahoo.com Digital Photography 1 01-20-2006 03:06 PM
Writing a Windows JVM launcher program Paul J. Lucas Java 12 11-21-2005 04:28 AM
ASDM Application Launcher v1.1(1) slow? you know who maybe Cisco 1 06-11-2005 02:05 PM
Microsoft works/ task launcher deb Microsoft Certification 2 11-07-2003 05:17 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57