no more /UNLOAD with new plug-in api

git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@5844 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
kichik 2008-12-12 19:31:52 +00:00
parent 06ab0c6314
commit 3db2839a3c
9 changed files with 65 additions and 36 deletions

View file

@ -8,7 +8,7 @@
g_stringsize=string_size; \
g_stacktop=stacktop; }
#define NSISFunc(name) extern "C" void __declspec(dllexport) name(HWND hwndParent, int string_size, char *variables, stack_t **stacktop)
#define NSISFunc(name) extern "C" void __declspec(dllexport) name(HWND hwndParent, int string_size, char *variables, stack_t **stacktop, extra_parameters *extra)
char szTemp[2048];
HWND hWndImage, hWndParent;
@ -61,11 +61,24 @@ HBITMAP __stdcall LoadBitmapFile(long right, long bottom, BITMAP *bBitmap);
COLORREF GetColor();
void __stdcall GetXY(LPPOINT lpPoint);
NSISFunc(Destroy);
static UINT_PTR PluginCallback(enum NSPIM msg)
{
if (msg == NSPIM_GUIUNLOAD)
{
Destroy(0, 0, 0, 0, 0);
}
return 0;
}
BOOL bReturn;
NSISFunc(SetReturn) {
EXDLL_INIT();
extra->RegisterPluginCallback(g_hInstance, PluginCallback);
popstring(szTemp);
bReturn = !lstrcmpi(szTemp, "on");
}
@ -83,6 +96,8 @@ static void __stdcall my_pushstring(char *str)
NSISFunc(SetBg) {
EXDLL_INIT();
extra->RegisterPluginCallback(g_hInstance, PluginCallback);
ECS();
if (!hWndImage) {
@ -335,7 +350,7 @@ NSISFunc(Destroy) {
SendMessage(hWndImage, WM_CLOSE, 0, 0);
hWndImage = 0;
oldProc = NULL;
Clear(0, 0, 0, 0);
Clear(0, 0, 0, 0, 0);
UnregisterClass("NSISBGImage", g_hInstance);
}