Compiles with the new ExDLL.h and updates the image faster

git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@1709 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
kichik 2002-11-15 11:59:56 +00:00
parent 59f4f257d0
commit e5550dac1d
2 changed files with 10 additions and 8 deletions

View file

@ -5,7 +5,7 @@
int x, y; int x, y;
char temp[MAX_PATH]; char temp[MAX_PATH];
HBITMAP hBitmap; HBITMAP hBitmap;
HWND hWndImage; HWND hWndImage, hWndParent;
HINSTANCE g_hInstance; HINSTANCE g_hInstance;
@ -15,6 +15,8 @@ int myatoi(char *s);
extern "C" void __declspec(dllexport) SetImage(HWND hwndParent, int string_size, char *variables, stack_t **stacktop); extern "C" void __declspec(dllexport) SetImage(HWND hwndParent, int string_size, char *variables, stack_t **stacktop);
extern "C" void __declspec(dllexport) Init(HWND hwndParent, int string_size, char *variables, stack_t **stacktop) { extern "C" void __declspec(dllexport) Init(HWND hwndParent, int string_size, char *variables, stack_t **stacktop) {
hWndParent = hwndParent;
SetImage(hwndParent, string_size, variables, stacktop); SetImage(hwndParent, string_size, variables, stacktop);
WNDCLASSEX wc = { WNDCLASSEX wc = {
@ -24,7 +26,7 @@ extern "C" void __declspec(dllexport) Init(HWND hwndParent, int string_size, cha
0, 0,
0, 0,
g_hInstance, g_hInstance,
LoadIcon(GetModuleHandle(0), MAKEINTRESOURCE(103)), 0,//LoadIcon(GetModuleHandle(0), MAKEINTRESOURCE(103)),
0, 0,
(HBRUSH)GetStockObject(WHITE_BRUSH), (HBRUSH)GetStockObject(WHITE_BRUSH),
0, 0,
@ -57,7 +59,7 @@ extern "C" void __declspec(dllexport) Init(HWND hwndParent, int string_size, cha
SetWindowLong(hWndImage, GWL_STYLE, WS_VISIBLE); SetWindowLong(hWndImage, GWL_STYLE, WS_VISIBLE);
oldProc = (void *)SetWindowLong(g_hwndParent, GWL_WNDPROC, (long)WndProc); oldProc = (void *)SetWindowLong(hwndParent, GWL_WNDPROC, (long)WndProc);
} }
extern "C" void __declspec(dllexport) SetImage(HWND hwndParent, int string_size, char *variables, stack_t **stacktop) { extern "C" void __declspec(dllexport) SetImage(HWND hwndParent, int string_size, char *variables, stack_t **stacktop) {
@ -87,14 +89,14 @@ extern "C" void __declspec(dllexport) SetImage(HWND hwndParent, int string_size,
if (hWndImage) { if (hWndImage) {
SetWindowPos( SetWindowPos(
hWndImage, hWndImage,
g_hwndParent, hWndParent,
(GetSystemMetrics(SM_CXSCREEN)-x)/2, (GetSystemMetrics(SM_CXSCREEN)-x)/2,
(GetSystemMetrics(SM_CYSCREEN)-y)/2, (GetSystemMetrics(SM_CYSCREEN)-y)/2,
x, x,
y, y,
SWP_NOACTIVATE SWP_NOACTIVATE
); );
RedrawWindow(hWndImage, 0, 0, RDW_INVALIDATE); RedrawWindow(hWndImage, 0, 0, RDW_INVALIDATE | RDW_UPDATENOW);
} }
} }
@ -170,7 +172,7 @@ LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
wParam, wParam,
lParam lParam
); );
SetWindowPos(hWndImage, g_hwndParent, 0, 0, 0, 0, SWP_NOACTIVATE|SWP_NOMOVE|SWP_NOSIZE); SetWindowPos(hWndImage, hWndParent, 0, 0, 0, 0, SWP_NOACTIVATE|SWP_NOMOVE|SWP_NOSIZE);
return 0; return 0;
} }
} }
@ -201,11 +203,11 @@ LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{ {
LPWINDOWPOS wp = (LPWINDOWPOS) lParam; LPWINDOWPOS wp = (LPWINDOWPOS) lParam;
wp->flags |= SWP_NOACTIVATE; wp->flags |= SWP_NOACTIVATE;
wp->hwndInsertAfter = g_hwndParent; wp->hwndInsertAfter = hWndParent;
break; break;
} }
case WM_DESTROY: case WM_DESTROY:
SetWindowLong(g_hwndParent, GWL_WNDPROC, (long)oldProc); SetWindowLong(hWndParent, GWL_WNDPROC, (long)oldProc);
default: default:
return DefWindowProc(hwnd, message, wParam, lParam); return DefWindowProc(hwnd, message, wParam, lParam);
} }

Binary file not shown.