FaKo
17th September 2004 16:36 UTC
Refresh a label on a custom window
Hello,
(I'm very very very bad in english)
I'm a newbie on NSIS, and I try to make an easy thing :
On a custom window,I have a label and a button
before MUI_INSTALLOPTIONS_SHOW, I verify something and I modify the color and the text of the label like that :
GetDlgItem $label $HWND 1204
SetCtlColors $label 0xFF0000 "transparent"
SendMessage $label ${WM_SETTEXT} 0 "STR:non installé"
and it works :D
if I click on the button, I want to change the color and the text of the label. I do that :
GetDlgItem $label $HWND 1204
SetCtlColors $label 0x00AA00 "transparent"
SendMessage $label ${WM_SETTEXT} 0 "STR:Installé"
The new text overwrites the older but the older is not erased ; it can be seen under ????!!!!!! :weird:
If I open a window on the custom window, the label is refreshed. How can I refresh the label ? :cry:
kichik
17th September 2004 16:41 UTC
The best way to get around this would be not to use a transparent background. If you can't, try calling RedrawWindow or UpdateWindow using System.dll.
FaKo
17th September 2004 16:50 UTC
I must use transparent background because I don't know the background color of the window (it's a system color)...
But how can I use System.dll and RedrawWindow or UpdateWindow ? (sorry,I'm a really newbie !...)
kichik
17th September 2004 16:53 UTC
If you want the system dialog background color you can simply not specify a background color:
SetCtlColors $label 0xFF0000
FaKo
17th September 2004 16:59 UTC
If I not specify a background color, the foreground color don't works : it stay black !
kichik
17th September 2004 17:45 UTC
Hmm... Right, can't have text color without background, it will be ignored. You can hide and show the control using:
ShowWindow $0 ${SW_HIDE}
SendMessage $0 ${WM_SETTEXT} "" STR:$0
ShowWindow $0 ${SW_SHOW}
Make sure you include WinMessages.nsh before using that code:
!include WinMessages.nsh
FaKo
17th September 2004 17:56 UTC
It wooooooooooooorks !!!!!!!!!!!!!!!!!!!!
It's a work-around but It works ! Thx you !!
Thx thx !