[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[debian-knoppix] Suggestion for a cleaner windows autorun



Hi,

first, thanks a zillion for knoppix!

About the only thing I think I'd be able to contribute
is actually on the windows side, namely what happens
when you insert your knoppix cdrom in the reader.
It's possible to launch the index.html file without
that annoying dos box to show up.
It only takes a tiny C program to wrap the ShellExecute
Win32 API, which launches the supplied filename using
whichever program is registered for the document type.
In this case, the default browser on the system, IE for
most users. You need to compile this for the windows
subsystem so as to get rid of the console. This can be
done with visual C, or using mingw:

gcc -Os -mwindows launch.c -o launch -s

With cygwin and appropriate mingw packages:

gcc -Os -mno-cygwin -mwindows launch.c -o launch -s

this produces a 10k exe which autorun can then use.
This has been tested under windows 95,98,NT4 and 2000.
I can of course provide the EXE in case anyone (Klaus ?-)
is interested.

--------------------> launch.c <--------------------

#include <windows.h>

int APIENTRY WinMain(HINSTANCE hInstance,
                     HINSTANCE hPrevInstance,
                     LPSTR     lpCmdLine,
                     int       nCmdShow)
{
    (void) ShellExecute( NULL, "open", lpCmdLine,
                         NULL, NULL, SW_SHOWNORMAL );
    return 0;
}


--------------------> autorun.inf <--------------------

[autorun]
open=launch.exe index.html
icon=cdrom.ico




_______________________________________________
debian-knoppix mailing list
debian-knoppix@linuxtag.org
http://mailman.linuxtag.org/mailman/listinfo/debian-knoppix


Reply to: