From b4dc54b3e310bb608a0f334d04bf3ef33586eae8 Mon Sep 17 00:00:00 2001 From: rlar Date: Sat, 6 Aug 2011 09:07:21 +0000 Subject: [PATCH] another type fix for Visual Studio, QUIT_BUTTON_ID --- ChangeLog | 4 ++++ src/winmain.c | 6 ++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4dca6805e..d0a8c382a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2011-08-05 Robert Larice + * src/winmain.c : + another type fix for Visual Studio, QUIT_BUTTON_ID + 2011-08-05 Robert Larice * src/spicelib/devices/dev.c : fix broken commit `type fix for Visual Studio' diff --git a/src/winmain.c b/src/winmain.c index 30c9a50dc..03bf5b608 100644 --- a/src/winmain.c +++ b/src/winmain.c @@ -47,6 +47,8 @@ /* macro to ignore unused variables and parameters */ #define NG_IGNORE(x) (void)x +#define QUIT_BUTTON_ID 2 + /* Types */ typedef char SBufLine[SBufSize+1]; // Eingabezeile @@ -443,7 +445,7 @@ static LRESULT CALLBACK MainWindowProc( HWND hwnd, UINT uMsg, WPARAM wParam, LPA if (HIWORD(wParam) == BN_CLICKED) if (ft_batchmode && (MessageBox(NULL, "Do you want to quit ngspice?", "Quit", MB_OKCANCEL|MB_ICONERROR) == IDCANCEL)) goto DEFAULT_AFTER; - if (LOWORD(wParam) == 2) { + if (LOWORD(wParam) == QUIT_BUTTON_ID) { SendMessage(GetParent((HWND)lParam), WM_CLOSE, 0, 0); } /* write all achieved so far to log file */ @@ -908,7 +910,7 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpszCmdLi /* Create "Quit" button */ hwQuitButton = CreateWindow("BUTTON", "Quit", WS_CHILD | BS_PUSHBUTTON, 0, 0, QuitButtonLength, - StatusElHeight, hwMain, (HMENU) 2, hInst, NULL); + StatusElHeight, hwMain, (HMENU)(UINT_PTR)QUIT_BUTTON_ID, hInst, NULL); if (!hwQuitButton) goto THE_END;