exdll.c 978 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. #include <windows.h>
  2. #include <nsis/pluginapi.h> // nsis plugin
  3. HINSTANCE g_hInstance;
  4. HWND g_hwndParent;
  5. void __declspec(dllexport) myFunction(HWND hwndParent, int string_size,
  6. char *variables, stack_t **stacktop,
  7. extra_parameters *extra)
  8. {
  9. g_hwndParent=hwndParent;
  10. EXDLL_INIT();
  11. // note if you want parameters from the stack, pop them off in order.
  12. // i.e. if you are called via exdll::myFunction file.dat poop.dat
  13. // calling popstring() the first time would give you file.dat,
  14. // and the second time would give you poop.dat.
  15. // you should empty the stack of your parameters, and ONLY your
  16. // parameters.
  17. // do your stuff here
  18. {
  19. char buf[1024];
  20. wsprintf(buf,"$0=%s\n",getuservariable(INST_0));
  21. MessageBox(g_hwndParent,buf,0,MB_OK);
  22. }
  23. }
  24. BOOL WINAPI DllMain(HANDLE hInst, ULONG ul_reason_for_call, LPVOID lpReserved)
  25. {
  26. g_hInstance=hInst;
  27. return TRUE;
  28. }