Stu, thanks.
That may be useful. However, I have no idea how to use it using
NSIS script. My Win32 API knowledge is not as good as I want.
I tried:
FindWindow $R9 "#32770" "" $HWNDPARENT
GetDlgItem $R9 $R9 1016 ; 1016 is Listview control ID
I have handle to the control... And now what?
There is no definitioin in NSIS for "${LVM_SETBKIMAGE}".
Tried this:
SendMessage $R9 ${LVM_SETBKIMAGE} 0 "$PLUGINSDIR\Image1.bmp"
But it doeasnt work and I suppose it cant.
Any tips?
Ps: I found !define LVM_SETBKIMAGE "0x00001044"
Ps1: I found Delphi code to do what i want:
procedure TForm1.DrawWallpaper;
var
lv : TLVBKIMAGE;
begin
FillChar(lv, SizeOf(lv), 0);
lv.ulFlags := LVBKIF_SOURCE_URL or LVBKIF_STYLE_TILE;
lv.pszImage := 'c:\sample.bmp';
SendMessage(ListView1.Handle, LVM_SETBKIMAGE, 0, integer(@lv));
end
There is even better code, to show image as Watermark. That would be better to me (the flag:
LVBKIF_TYPE_WATERMARK;).
procedure TForm1.DrawWallpaper;
var
lv : TLVBKIMAGE;
hinst: Thandle;
const
LVBKIF_TYPE_WATERMARK = $10000000;
begin
hinst := GetModuleHandle(nil);
if (hinst = 0) then exit;
FillChar(lv, SizeOf(lv), 0);
lv.ulFlags := LVBKIF_TYPE_WATERMARK;
lv.hbm := LoadImage(hinst,PChar('LVWALLPAPER'),IMAGE_BITMAP,0,0,
LR_CREATEDIBSECTION or
LR_LOADTRANSPARENT);
SendMessage(ListView1.Handle, LVM_SETBKIMAGE, 0, integer(@lv));
end;
Can someone translate it to NSIS using system plugin?
In my code, i use incorrectly last param of sendmessage, as it is a pointer to structure (and I just put there image path)
-Pawel