New uninstaller

Dmitry Timoshkov dmitry at baikal.ru
Fri Feb 25 22:09:45 CST 2005


"Jonathan Ernst" <Jonathan at ErnstFamily.ch> wrote:

> 1) Strange problem with UpdateWindow
> uninstaller.c, line 264
> I implemented a search/filter field and I want to repaint the window
> after each input in the EDITTEXT control. However, when I call
> UpdateWindow on this line, the value returned is 1 so that a WM_PAINT
> message should be sent right ?

No. UpdateWindow only sends WM_PAINT if there are invalidated areas to
repaint. You need to use InvalidateRect first.

Are you sure you want to repaint the whole window on each EN_CHANGE
and not some small area of a dialog?

> But strangly no message is sent and I
> have to make something else (like moving the dialog) to force the window
> to repaint and filter the entries. 
> The funny thing is that UpdateWindow on line 279 works just fine.
> I guess it's a bug in my code and not in Wine so I'd be glad if you
> could help me.

> 2) Improve filter code
> Currently I filter the entries that match exactly the filter string. I
> would like to at least make a case insensitive strstr on the string.
> What's the best way to do it (See uninstaller.c, line 235)

Just send LB_FINDSTRING or LB_FINDSTRINGEXACT to listbox, it will do
the job for you.

> 3) Stringtables
> a)Is there a way to load localized strings without having to guess
> beforehand the size of the string in each language ?
> b)Is there a way to not call LoadString for each string ?
> c)Where is the best place to load every string of a stringtable ? in
> main(), just before calling DialogBox() ?

It's better to void using string tables, since now you have converted
code to use dialog box instead.

> 4) Please tell me if you see things that are bad in the attached code,
> so that I'll fix it before submitting a patch.

> +BOOL CALLBACK DlgProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam)

BOOL -> INT_PTR

WM_PAINT is not needed for dialog boxes, user32 does the job.

> +int main(int argc, char *argv[])
> +{
> +    MSG msg;
> +    WNDCLASS wc;
> +    HWND hWnd;
> +    LPSTR token = NULL;
> +    int i = 1;
> +    HINSTANCE hInst = NULL;

HINSTANCE hInst = GetModuleHandle(0);

-- 
Dmitry.




More information about the wine-devel mailing list