PageRenderTime 122ms CodeModel.GetById 60ms app.highlight 2ms RepoModel.GetById 59ms app.codeStats 0ms

/admin/win/nsi/nsis_processes/src/exdll.c

http://github.com/tomahawk-player/tomahawk
C | 37 lines | 20 code | 10 blank | 7 comment | 0 complexity | 6e799deda3b041fcae2805a5e8472b35 MD5 | raw file
 1#include <windows.h>

 2#include "exdll.h"

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