Add search field with find-as-you-type function.

This commit is contained in:
Jonathan Ernst 2005-03-11 10:26:41 +00:00 committed by Alexandre Julliard
parent cfb6c8ebca
commit 393d16a67f
4 changed files with 25 additions and 6 deletions

View File

@ -26,6 +26,7 @@ CAPTION "Wine Application Uninstaller"
FONT 10, "MS Sans Serif"
BEGIN
LTEXT "Please select the application you wish to uninstall:",IDC_PLEASESELECT,10,10,250,14
EDITTEXT IDC_FILTER,10,25,250,14,ES_AUTOHSCROLL
LISTBOX IDC_LIST,10,43,250,106,LBS_NOINTEGRALHEIGHT |
LBS_EXTENDEDSEL | WS_VSCROLL | WS_TABSTOP
PUSHBUTTON "&Uninstall",IDC_UNINSTALL,270,48,50,14
@ -37,7 +38,7 @@ END
STRINGTABLE DISCARDABLE {
IDS_APPNAME, "Wine Application Unsinstaller"
IDS_ABOUT, "Wine Application Uninstaller (C) 2005 by Andreas Mohr, Hannu Valtonen and Jonathan Ernst."
IDS_ABOUTTITLE, "About Unsinstaller"
IDS_ABOUTTITLE, "About Uninstaller"
IDS_REGISTRYKEYNOTAVAILABLE, "Uninstall registry key not available (yet), nothing to do !"
IDS_UNINSTALLFAILED, "Execution of uninstall command '%s' failed, perhaps due to missing executable.\r\nDo you want to remove the uninstall entry from the registry ?"
}

View File

@ -4,7 +4,7 @@ SRCDIR = @srcdir@
VPATH = @srcdir@
MODULE = uninstaller.exe
APPMODE = -mconsole
IMPORTS = user32 gdi32 advapi32 kernel32
IMPORTS = shlwapi user32 gdi32 advapi32 kernel32
C_SRCS = \
main.c

View File

@ -19,15 +19,13 @@
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* ToDo:
* - add search box for locating entries quickly
*/
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <time.h>
#include <windows.h>
#include <shlwapi.h>
#include "resource.h"
#include "regstr.h"
#include "wine/debug.h"
@ -44,6 +42,7 @@ static uninst_entry *entries = NULL;
static unsigned int numentries = 0;
static int list_need_update = 1;
static int oldsel = -1;
static WCHAR *sFilter;
static WCHAR sAppName[MAX_STRING_LEN];
static WCHAR sAboutTitle[MAX_STRING_LEN];
static WCHAR sAbout[MAX_STRING_LEN];
@ -67,6 +66,7 @@ static const WCHAR PathUninstallW[] = {
'U','n','i','n','s','t','a','l','l',0 };
static const WCHAR UninstallCommandlineW[] = {'U','n','i','n','s','t','a','l','l','S','t','r','i','n','g',0};
/**
* Used to output program list when used with --list
*/
@ -228,6 +228,8 @@ static int FetchUninstallInformation(void)
RegQueryValueExW(hkeyApp, UninstallCommandlineW, 0, 0, (LPBYTE)entries[numentries-1].command, &uninstlen);
WINE_TRACE("allocated entry #%d: %s (%s), %s\n",
numentries, wine_dbgstr_w(entries[numentries-1].key), wine_dbgstr_w(entries[numentries-1].descr), wine_dbgstr_w(entries[numentries-1].command));
if(sFilter != NULL && StrStrIW(entries[numentries-1].descr,sFilter)==NULL)
numentries--;
}
RegCloseKey(hkeyApp);
sizeOfSubKeyName = 255;
@ -295,6 +297,22 @@ static INT_PTR CALLBACK DlgProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM l
case WM_COMMAND:
switch(LOWORD(wParam))
{
case IDC_FILTER:
{
if (HIWORD(wParam) == EN_CHANGE)
{
int len = GetWindowTextLengthW(GetDlgItem(hwnd, IDC_FILTER));
list_need_update = 1;
if(len > 0)
{
sFilter = (WCHAR*)GlobalAlloc(GPTR, (len + 1)*sizeof(WCHAR));
GetDlgItemTextW(hwnd, IDC_FILTER, sFilter, (len + 1)*sizeof(WCHAR));
}
else sFilter = NULL;
UpdateList(hList);
}
break;
}
case IDC_UNINSTALL:
{
int count = SendMessageW(hList, LB_GETSELCOUNT, 0, 0);

View File

@ -1,7 +1,7 @@
/*
* Uninstaller (rsrc.rc)
*
* Copyright 2000 Andreas Mohr <andi@lisas.de>
* Copyright 2000 Andreas Mohr
* Copyright 2003 Vincent Béron
* Copyright 2003 Ivan Leo Puoti
* Copyright 2004 David Kredba