From 2093439acda06faa00a31716a4b4f3c730b0da2d Mon Sep 17 00:00:00 2001 From: justin1014 Date: Sat, 21 Sep 2002 06:13:15 +0000 Subject: [PATCH] woohoo 36.0kb for zlib header git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@1106 212acab6-be3b-0410-9dea-997c60f758d6 --- Source/exehead/Ui.c | 8 ++++---- Source/exehead/bgbg.c | 30 ++++++++++++++++-------------- Source/exehead/exec.c | 2 +- 3 files changed, 21 insertions(+), 19 deletions(-) diff --git a/Source/exehead/Ui.c b/Source/exehead/Ui.c index 6493ac4a..91043473 100644 --- a/Source/exehead/Ui.c +++ b/Source/exehead/Ui.c @@ -94,7 +94,7 @@ static BOOL CALLBACK UninstProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l static DWORD WINAPI install_thread(LPVOID p); -HWND NSISCALL bgWnd_Init(HINSTANCE hInstance, int color1, int color2, int); +HWND NSISCALL bgWnd_Init(); HWND insthwnd, insthwnd2,insthwndbutton; @@ -386,7 +386,7 @@ int NSISCALL ui_doinstall(void) #ifdef NSIS_SUPPORT_BGBG if (g_inst_cmnheader->bg_color1 != -1) { - m_bgwnd=bgWnd_Init(g_hInstance,g_inst_cmnheader->bg_color1,g_inst_cmnheader->bg_color2,g_inst_cmnheader->bg_textcolor); + m_bgwnd=bgWnd_Init(); } #endif//NSIS_SUPPORT_BGBG #ifdef NSIS_SUPPORT_CODECALLBACKS @@ -400,7 +400,7 @@ int NSISCALL ui_doinstall(void) #ifdef NSIS_CONFIG_LICENSEPAGE { // load richedit DLL - WNDCLASS wc={0,}; + static WNDCLASS wc; static char str1[]="RichEd20.dll"; static char str2[]="RichEdit20A"; if (!LoadLibrary(str1)) @@ -911,7 +911,7 @@ static BOOL CALLBACK DirProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar TVHITTESTINFO NSISCALL hit_test(HWND tree) { - TVHITTESTINFO ht = {0}; + static TVHITTESTINFO ht; DWORD dwpos = GetMessagePos(); ht.pt.x = GET_X_LPARAM(dwpos); diff --git a/Source/exehead/bgbg.c b/Source/exehead/bgbg.c index ce547343..9f7caa52 100644 --- a/Source/exehead/bgbg.c +++ b/Source/exehead/bgbg.c @@ -1,6 +1,9 @@ #include #include "resource.h" #include "config.h" +#include "fileform.h" +#include "state.h" +#include "ui.h" #ifdef NSIS_SUPPORT_BGBG @@ -13,14 +16,13 @@ static LRESULT CALLBACK BG_WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM l case WM_PAINT: { static PAINTSTRUCT ps; - HFONT newFont, oldFont; HDC hdc=BeginPaint(hwnd,&ps); RECT r; int y,ry; GetClientRect(hwnd,&r); - // this portion by Drew Davidson, drewdavidson@mindspring.com + // this portion by Drew Davidson, drewdavidson@mindspring.com ry=r.bottom; - y=r.top; + y=0; //r.top // JF: made slower, reduced to 4 pixels high, because I like how it looks better/ while (y < r.bottom) @@ -32,7 +34,7 @@ static LRESULT CALLBACK BG_WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM l gv = (GetGValue(m_color2) * y + GetGValue(m_color1) * ry) / r.bottom; bv = (GetBValue(m_color2) * y + GetBValue(m_color1) * ry) / r.bottom; brush = CreateSolidBrush(RGB(rv,gv,bv)); - SetRect(&rect, r.left, y, r.right, y+4); + SetRect(&rect, 0 /*r.left*/, y, r.right, y+4); // note that we don't need to do "SelectObject(hdc, brush)" // because FillRect lets us specify the brush as a parameter. FillRect(hdc, &rect, brush); @@ -43,6 +45,7 @@ static LRESULT CALLBACK BG_WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM l if (m_textcolor != -1) { + HFONT newFont, oldFont; newFont = CreateFont(40,0,0,0,FW_BOLD,TRUE,FALSE,FALSE,DEFAULT_CHARSET,OUT_DEFAULT_PRECIS,CLIP_DEFAULT_PRECIS,DEFAULT_QUALITY,DEFAULT_PITCH,"Garamond"); if (newFont) { @@ -66,28 +69,27 @@ static LRESULT CALLBACK BG_WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM l } -HWND NSISCALL bgWnd_Init(HINSTANCE hInstance, int color1, int color2, int color3) +HWND NSISCALL bgWnd_Init() { RECT vp; - static char classname[4]="_Nb"; static WNDCLASS wc; wc.style = CS_VREDRAW | CS_HREDRAW; wc.lpfnWndProc = BG_WndProc; - wc.hInstance = hInstance; - wc.hIcon = LoadIcon(hInstance,MAKEINTRESOURCE(IDI_ICON2)); + wc.hInstance = g_hInstance; + wc.hIcon = LoadIcon(g_hInstance,MAKEINTRESOURCE(IDI_ICON2)); wc.hCursor = LoadCursor(NULL,IDC_ARROW); - wc.lpszClassName = classname; + wc.lpszClassName = "_Nb"; if (!RegisterClass(&wc)) return 0; - m_color1=color1; - m_color2=color2; - m_textcolor=color3; + m_color1=g_inst_cmnheader->bg_color1; + m_color2=g_inst_cmnheader->bg_color2; + m_textcolor=g_inst_cmnheader->bg_textcolor; SystemParametersInfo(SPI_GETWORKAREA, 0, &vp, 0); - return CreateWindow(classname,"",WS_OVERLAPPED|WS_THICKFRAME|WS_CAPTION|WS_SYSMENU|WS_MAXIMIZEBOX|WS_MINIMIZEBOX, - vp.left,vp.top,vp.right-vp.left,vp.bottom-vp.top,GetDesktopWindow(),NULL,hInstance,NULL); + return CreateWindow("_Nb","",WS_OVERLAPPED|WS_THICKFRAME|WS_CAPTION|WS_SYSMENU|WS_MAXIMIZEBOX|WS_MINIMIZEBOX, + vp.left,vp.top,vp.right-vp.left,vp.bottom-vp.top,GetDesktopWindow(),NULL,g_hInstance,NULL); } diff --git a/Source/exehead/exec.c b/Source/exehead/exec.c index 9256b321..5584cf9d 100644 --- a/Source/exehead/exec.c +++ b/Source/exehead/exec.c @@ -746,7 +746,7 @@ static int NSISCALL ExecuteEntry(entry *entry_) return 0; case EW_CREATEFONT: { - LOGFONT f={0,}; + static LOGFONT f; f.lfHeight=-MulDiv(process_string_fromparm_toint(2),GetDeviceCaps(GetDC(g_hwnd),LOGPIXELSY),72); f.lfWeight=process_string_fromparm_toint(3); f.lfItalic=parm4&1;