1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/other-licenses/nsis/Contrib/ExDLL/exdll.c Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,44 @@ 1.4 +// Unicode support by Jim Park -- 08/02/2007 1.5 + 1.6 +#include <windows.h> 1.7 +#include "tchar.h" 1.8 +#include "exdll.h" 1.9 + 1.10 +HINSTANCE g_hInstance; 1.11 + 1.12 +HWND g_hwndParent; 1.13 + 1.14 +// To work with Unicode version of NSIS, please use TCHAR-type 1.15 +// functions for accessing the variables and the stack. 1.16 + 1.17 +void __declspec(dllexport) myFunction(HWND hwndParent, int string_size, 1.18 + TCHAR *variables, stack_t **stacktop, 1.19 + extra_parameters *extra) 1.20 +{ 1.21 + g_hwndParent=hwndParent; 1.22 + 1.23 + EXDLL_INIT(); 1.24 + 1.25 + 1.26 + // note if you want parameters from the stack, pop them off in order. 1.27 + // i.e. if you are called via exdll::myFunction file.dat poop.dat 1.28 + // calling popstring() the first time would give you file.dat, 1.29 + // and the second time would give you poop.dat. 1.30 + // you should empty the stack of your parameters, and ONLY your 1.31 + // parameters. 1.32 + 1.33 + // do your stuff here 1.34 + { 1.35 + TCHAR buf[1024]; 1.36 + wsprintf(buf,_T("$0=%s\n"),getuservariable(INST_0)); 1.37 + MessageBox(g_hwndParent,buf,0,MB_OK); 1.38 + } 1.39 +} 1.40 + 1.41 + 1.42 + 1.43 +BOOL WINAPI DllMain(HANDLE hInst, ULONG ul_reason_for_call, LPVOID lpReserved) 1.44 +{ 1.45 + g_hInstance=hInst; 1.46 + return TRUE; 1.47 +}