
The official plugins are now stored in architecture specific subdirectories under NSIS\Plugins. !AddPluginDir also gained a new (optional) architecture flag because MakeNSIS now stores separate plugin information for each target architecture. Storing plugins in the root of the Plugins directory is no longer supported. MinGW does not implement the unicode CRT startup functions so the entry point functions and linker parameters had to be changed. The unicode tools use the ansi entry point and a small helper function that calls into the real code: _tmain has full argc+argv emulation while wWinMain does not pass the command line parameters. The stubs do not use any CRT functions and have no CRT or unicode helper code, they call our entry point directly. git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@6269 212acab6-be3b-0410-9dea-997c60f758d6
91 lines
2.4 KiB
C
91 lines
2.4 KiB
C
// ui.cpp : Defines the entry point for the application.
|
|
//
|
|
// Unicode support by Jim Park -- 08/10/2007
|
|
|
|
#include "../../Source/Platform.h"
|
|
#include <windows.h>
|
|
#include <commctrl.h>
|
|
#include "resource.h"
|
|
|
|
HINSTANCE g_hInstance;
|
|
HWND m_curwnd;
|
|
|
|
const TCHAR* windows[] = {
|
|
MAKEINTRESOURCE(IDD_LICENSE),
|
|
MAKEINTRESOURCE(IDD_SELCOM),
|
|
MAKEINTRESOURCE(IDD_DIR),
|
|
MAKEINTRESOURCE(IDD_INSTFILES),
|
|
MAKEINTRESOURCE(IDD_UNINST)
|
|
};
|
|
|
|
BOOL CALLBACK GenericProc(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lParam) {
|
|
static LOGBRUSH b = {BS_SOLID, RGB(255,0,0), 0};
|
|
static HBRUSH red;
|
|
|
|
if (!red)
|
|
red = CreateBrushIndirect(&b);
|
|
|
|
switch (uMsg) {
|
|
case WM_CTLCOLORSTATIC:
|
|
return (int)red;
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
BOOL CALLBACK DialogProc(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lParam) {
|
|
static int i = -1;
|
|
switch (uMsg) {
|
|
case WM_INITDIALOG:
|
|
SetWindowText(hwndDlg, _T("NSIS User Interface - Testing"));
|
|
SetWindowText(GetDlgItem(hwndDlg, IDC_VERSTR), _T("NSIS version"));
|
|
SetWindowText(GetDlgItem(hwndDlg, IDC_BACK), _T("< Back"));
|
|
SetWindowText(GetDlgItem(hwndDlg, IDOK), _T("Next >"));
|
|
SetWindowText(GetDlgItem(hwndDlg, IDCANCEL), _T("Cancel"));
|
|
ShowWindow(GetDlgItem(hwndDlg, IDC_BACK), SW_SHOW);
|
|
ShowWindow(GetDlgItem(hwndDlg, IDC_CHILDRECT), SW_SHOW);
|
|
SendMessage(hwndDlg, WM_COMMAND, MAKEWORD(IDOK, 0), 0);
|
|
ShowWindow(hwndDlg, SW_SHOW);
|
|
break;
|
|
case WM_COMMAND:
|
|
switch (LOWORD(wParam)) {
|
|
case IDOK:
|
|
case IDC_BACK:
|
|
i+=(LOWORD(wParam)==IDOK)?1:-1;
|
|
if (i < 0) {
|
|
i++;
|
|
break;
|
|
}
|
|
if (i >= (int)sizeof(windows)/sizeof(TCHAR*)) {
|
|
i--;
|
|
break;
|
|
}
|
|
if (m_curwnd) DestroyWindow(m_curwnd);
|
|
m_curwnd=CreateDialog(g_hInstance,windows[i],hwndDlg,GenericProc);
|
|
if (m_curwnd)
|
|
{
|
|
RECT r;
|
|
GetWindowRect(GetDlgItem(hwndDlg,IDC_CHILDRECT),&r);
|
|
ScreenToClient(hwndDlg,(LPPOINT)&r);
|
|
SetWindowPos(m_curwnd,0,r.left,r.top,0,0,SWP_NOACTIVATE|SWP_NOSIZE|SWP_NOZORDER);
|
|
ShowWindow(m_curwnd,SW_SHOWNA);
|
|
}
|
|
break;
|
|
default:
|
|
EndDialog(hwndDlg, 0);
|
|
PostQuitMessage(0);
|
|
break;
|
|
}
|
|
break;
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
NSIS_ENTRYPOINT_SIMPLEGUI
|
|
int WINAPI _tWinMain(HINSTANCE hInst,HINSTANCE hOldInst,LPTSTR CmdLineParams,int ShowCmd)
|
|
{
|
|
InitCommonControls();
|
|
g_hInstance = hInst;
|
|
LoadLibrary(_T("RichEd32.dll"));
|
|
return DialogBox(g_hInstance,MAKEINTRESOURCE(IDD_INST),0,DialogProc);
|
|
}
|
|
|