diff --git a/Contrib/Splash/splash.c b/Contrib/Splash/splash.c index 8910eb00..5220363e 100644 --- a/Contrib/Splash/splash.c +++ b/Contrib/Splash/splash.c @@ -1,20 +1,11 @@ #include - -typedef struct _stack_t { - struct _stack_t *next; - char text[1]; // this should be the length of string_size -} stack_t; - -int popstring(char *str); // 0 on success, 1 on empty stack -void pushstring(char *str); +#include "../exdll/exdll.h" HINSTANCE g_hInstance; -stack_t **g_stacktop; -int g_stringsize; HBITMAP g_hbm; int sleep_val; -int g_rv; +int g_rv=-1; static LRESULT CALLBACK WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { @@ -70,11 +61,11 @@ void __declspec(dllexport) show(HWND hwndParent, int string_size, char *variable char temp[64]; char *sleep=temp; - g_stringsize=string_size; - g_stacktop=stacktop; + + EXDLL_INIT(); - popstring(fn); popstring(sleep); + popstring(fn); sleep_val=0; while (*sleep >= '0' && *sleep <= '9') @@ -118,31 +109,9 @@ void __declspec(dllexport) show(HWND hwndParent, int string_size, char *variable DeleteObject(g_hbm); - wsprintf(temp,"%d",g_rv); - pushstring(temp); } } } + wsprintf(temp,"%d",g_rv); + pushstring(temp); } - -// utility functions (not required but often useful) -int popstring(char *str) -{ - stack_t *th; - if (!g_stacktop || !*g_stacktop) return 1; - th=(*g_stacktop); - lstrcpy(str,th->text); - *g_stacktop = th->next; - GlobalFree((HGLOBAL)th); - return 0; -} - -void pushstring(char *str) -{ - stack_t *th; - if (!g_stacktop) return; - th=(stack_t*)GlobalAlloc(GPTR,sizeof(stack_t)+g_stringsize); - lstrcpyn(th->text,str,g_stringsize); - th->next=*g_stacktop; - *g_stacktop=th; -} \ No newline at end of file diff --git a/Contrib/Splash/splash.dsp b/Contrib/Splash/splash.dsp index 2098ae0c..0c566409 100644 --- a/Contrib/Splash/splash.dsp +++ b/Contrib/Splash/splash.dsp @@ -101,6 +101,10 @@ SOURCE=.\splash.c # Begin Group "Header Files" # PROP Default_Filter "h;hpp;hxx;hm;inl" +# Begin Source File + +SOURCE=..\ExDLL\exdll.h +# End Source File # End Group # Begin Group "Resource Files" diff --git a/Contrib/Splash/splash.txt b/Contrib/Splash/splash.txt index d6da1850..851d9a93 100644 --- a/Contrib/Splash/splash.txt +++ b/Contrib/Splash/splash.txt @@ -18,6 +18,10 @@ Function .onInit ; File /oname=spltmp.wav "my_splashshit.wav" splash::show 1000 $TEMP\spltmp + + Pop $0 ; $0 has '1' if the user closed the splash screen early, + ; '0' if everything closed normal, and '-1' if some error occured. + Delete $TEMP\spltmp.bmp ; Delete $TEMP\spltmp.wav FunctionEnd @@ -29,7 +33,7 @@ the .bmp). The BMP file used will be this parameter.bmp, and the wave file used (If you already have an .onInit function, put that in it) -Note: the return value of splash.exe is 1 if the user closed the splash +Note: the return value of splash is 1 if the user closed the splash screen early (pop it from the stack) -Justin