Use Wine debugging API. Fixed MessageBox loop.

This commit is contained in:
Alexandre Julliard 2002-07-05 21:23:54 +00:00
parent af0d206752
commit e7ea9b65ca
1 changed files with 12 additions and 17 deletions

View File

@ -29,6 +29,9 @@
#include <windows.h>
#include "main.h"
#include "regstr.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(uninstaller);
/* Work around a Wine bug which defines handles as UINT rather than LPVOID */
#ifdef WINE_STRICT
@ -37,14 +40,6 @@
#define NULL_HANDLE 0
#endif
#undef DUMB_DEBUG
#ifdef DUMB_DEBUG
#include <stdio.h>
#define DEBUG(x...) fprintf(stderr,x)
#else
#define DEBUG(x...)
#endif
/* use multi-select listbox */
#undef USE_MULTIPLESEL
@ -238,7 +233,7 @@ int FetchUninstallInformation(void)
entries[numentries-1].active = 0;
RegQueryValueEx(hkeyApp, REGSTR_VAL_UNINSTALLER_COMMANDLINE, 0, 0,
entries[numentries-1].command, &uninstlen);
DEBUG("allocated entry #%d: '%s' ('%s'), '%s'\n", numentries, entries[numentries-1].key, entries[numentries-1].descr, entries[numentries-1].command);
WINE_TRACE("allocated entry #%d: '%s' ('%s'), '%s'\n", numentries, entries[numentries-1].key, entries[numentries-1].descr, entries[numentries-1].command);
}
RegCloseKey(hkeyApp);
}
@ -263,7 +258,7 @@ void UninstallProgram(void)
{
if (!(entries[i].active)) /* don't uninstall this one */
continue;
DEBUG("uninstalling '%s'\n", entries[i].descr);
WINE_TRACE("uninstalling '%s'\n", entries[i].descr);
memset(&si, 0, sizeof(STARTUPINFO));
si.cb = sizeof(STARTUPINFO);
si.wShowWindow = SW_NORMAL;
@ -272,7 +267,7 @@ void UninstallProgram(void)
{ /* wait for the process to exit */
WaitForSingleObject(info.hProcess, INFINITE);
res = GetExitCodeProcess(info.hProcess, &exit_code);
DEBUG("%d: %08lx\n", res, exit_code);
WINE_TRACE("%d: %08lx\n", res, exit_code);
#ifdef DEL_REG_KEY
/* delete the program's uninstall entry */
if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, REGSTR_PATH_UNINSTALL,
@ -289,7 +284,7 @@ void UninstallProgram(void)
MessageBox(0, errormsg, appname, MB_OK);
}
}
DEBUG("finished uninstall phase.\n");
WINE_TRACE("finished uninstall phase.\n");
list_need_update = 1;
}
@ -372,6 +367,7 @@ LRESULT WINAPI MainProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
case WM_PAINT:
{
hdc = BeginPaint( hWnd, &ps );
if (list_need_update)
{
int prevsel;
@ -385,16 +381,15 @@ LRESULT WINAPI MainProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
SendMessage(hwndList, WM_SETREDRAW, FALSE, 0);
for (i=0; i < numentries; i++)
{
DEBUG("adding '%s'\n", entries[i].descr);
WINE_TRACE("adding '%s'\n", entries[i].descr);
SendMessage(hwndList, LB_ADDSTRING, 0, (LPARAM)entries[i].descr);
}
DEBUG("setting prevsel %d\n", prevsel);
WINE_TRACE("setting prevsel %d\n", prevsel);
if (prevsel != -1)
SendMessage(hwndList, LB_SETCURSEL, prevsel, 0 );
SendMessage(hwndList, WM_SETREDRAW, TRUE, 0);
list_need_update = 0;
}
hdc = BeginPaint( hWnd, &ps );
EndPaint( hWnd, &ps );
return 0;
}
@ -414,11 +409,11 @@ LRESULT WINAPI MainProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
if (oldsel != -1)
{
entries[oldsel].active ^= 1; /* toggle */
DEBUG("toggling %d old '%s'\n", entries[oldsel].active, entries[oldsel].descr);
WINE_TRACE("toggling %d old '%s'\n", entries[oldsel].active, entries[oldsel].descr);
}
#endif
entries[sel].active ^= 1; /* toggle */
DEBUG("toggling %d '%s'\n", entries[sel].active, entries[sel].descr);
WINE_TRACE("toggling %d '%s'\n", entries[sel].active, entries[sel].descr);
SendMessage(hwndEdit, WM_SETTEXT, 0, (LPARAM)entries[sel].command);
oldsel = sel;
}