diff options
author | Damian Minkov <damencho@jitsi.org> | 2014-01-10 12:43:53 +0200 |
---|---|---|
committer | Damian Minkov <damencho@jitsi.org> | 2014-01-10 12:54:51 +0200 |
commit | 52c87eaf68d8ba2048bd822588ceb2e2faf8f20e (patch) | |
tree | 084449da4f3e2b89c33aa674512507c4f8111ae3 /src/native | |
parent | 64b1d7610336619674127d98c64f8c52c460fbdb (diff) | |
download | jitsi-52c87eaf68d8ba2048bd822588ceb2e2faf8f20e.zip jitsi-52c87eaf68d8ba2048bd822588ceb2e2faf8f20e.tar.gz jitsi-52c87eaf68d8ba2048bd822588ceb2e2faf8f20e.tar.bz2 |
Adds splash screen.
Diffstat (limited to 'src/native')
-rw-r--r-- | src/native/windows/run/run.c | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/src/native/windows/run/run.c b/src/native/windows/run/run.c index 581286c..2829f77 100644 --- a/src/native/windows/run/run.c +++ b/src/native/windows/run/run.c @@ -66,6 +66,9 @@ static DWORD Run_runJavaFromRegKey(HKEY key, BOOL *searchForJava); static DWORD Run_runJavaFromRuntimeLib(LPCTSTR runtimeLib, LPCTSTR javaHome, BOOL *searchForJava);
static LPSTR Run_skipWhitespace(LPSTR str);
+typedef void (CALLBACK *SplashInit)();
+typedef int (CALLBACK *SplashLoadFile)(const char* file);
+
static DWORD
Run_addPath(LPCTSTR path)
{
@@ -1533,6 +1536,53 @@ Run_runJavaFromRuntimeLib javaVMInitArgs.nOptions = optionStringCount;
javaVMInitArgs.options = options;
javaVMInitArgs.version = JNI_VERSION_1_2;
+
+ HMODULE hSplash = NULL;
+ LPTSTR lockFilePath = Run_getLockFilePath();
+
+ if(!(lockFilePath && Run_isFile(lockFilePath)))
+ {// Lets load and start splashscreen, if any
+ size_t javaHomeLength = _tcslen(javaHome);
+ LPTSTR path
+ = (LPTSTR) malloc(sizeof(TCHAR)
+ * (javaHomeLength + 20 + 1));
+ if (path)
+ {
+ if (javaHomeLength >= 1)
+ {
+ TCHAR *ch =
+ (TCHAR *) (javaHome + (javaHomeLength - 1));
+
+ if ((_T('\\') == *ch) || (_T('/') == *ch))
+ {
+ *ch = 0;
+ javaHomeLength--;
+ }
+ }
+
+ _tcscpy(path, javaHome);
+ _tcscpy(path + javaHomeLength,
+ _T("\\bin\\splashscreen.dll"));
+ hSplash = LoadLibrary(path);
+
+ if(hSplash > 0)
+ {
+ SplashInit splashInit =
+ (SplashInit)GetProcAddress(
+ hSplash, "SplashInit");
+ SplashLoadFile splashLoadFile =
+ (SplashLoadFile)GetProcAddress(
+ hSplash, "SplashLoadFile");
+
+ if (splashInit && splashLoadFile)
+ {
+ splashInit();
+ splashLoadFile("splash.gif");
+ }
+ }
+ }
+ }
+
if (jniCreateJavaVM(
&javaVM,
(void **) &jniEnv,
@@ -1553,6 +1603,9 @@ Run_runJavaFromRuntimeLib }
if (options)
free(options);
+
+ if(hSplash)
+ FreeLibrary(hSplash);
}
else
error = ERROR_OUTOFMEMORY;
|