Archive: WM_CLOSE opposite?


WM_CLOSE opposite?
I want to hide a control and then show it later during installation progress.

I've found WM_CLOSE 0x10 will hide it, but it completely terminates it so I cannot get it back again!

-Stu


Use ShowWindow. It can both show and hide.


Ah thanks, I have no idea how I forgot about that!

-Stu


Here's another WM question...

How can I dynamically select/unselect items in a listbox control.

-Stu


!define CB_GETCURSEL 0x0147
!define CB_SETCURSEL 0x014E

GetDlgItem $0 $HWND 1201
SendMessage $0 ${CB_GETCURSEL} -1 0 $1

GetDlgItem $0 $HWND 1202
SendMessage $0 ${CB_SETCURSEL} $1 0


SendMessage doesn't seem to work very well for NOTIFY events (on page leave).

You can use it to change strings, but for anything else it doesn't work correctly.

When I'd try to change the colour of a control, it would only change once you had set focus on it (ie background colours for combo boxes.)

Due to this, I couldn't get select all working either (had no effect whatsoever).

I'm going to try InstallOptionsEx now.

-Stu


Never mind. I should have did a bit of my own research.

The CB_GETCURSEL is not the right Message - It's for ComboBox's. I specifically said ListBox's.

The correct Message I found was LB_SELITEMRANGEEX (0x0183) and it works perfectly now.

Edit: And LB_SETSEL (0x0185) can be used to select none...
SendMessage $R0 ${LB_SETSEL} 0 -1

-Stu