- NSIS Discussion
- Placing a banner with link
Archive: Placing a banner with link
Rolando
10th October 2004 12:24 UTC
Placing a banner with link
I usually create a custom page with a bitmap as field one and a link as field two and that usually makes it such as when the user clicks on the image, he goes to the link on field two without him seeing the link. I know that's unprofessional but I couldn't find any other way.
However, now I need to place two bitmaps and have each one link to a different url. Can anyone tell me how that can be done, if it's possible ?
Afrow UK
10th October 2004 12:40 UTC
Maybe you could have two link controls with no text covering two images.
-Stu
Rolando
10th October 2004 12:44 UTC
I tried that already... the boundries of the 2 link controls become acting weird. The "click area" of each image becomes different from the size of the image. I don't know why. Shall I post the .ini fields ?
deguix
10th October 2004 14:49 UTC
That's because the boundaries of a link control ever covers the text inside it, not the area. This probably will work right on InstallOptionsEx as I verified this.
Takhir
10th October 2004 16:43 UTC
Is it possible to define Flag=NOTIFY for Type=bitmap and to handle mouse clicks like this was done in testnotify.nsi sample for buttons?
Also might be interesting to use "hand" cursor for this control - SetClassLong(hWin, GCL_HCURSOR, LoadCursor(NULL, MAKEINTRESOURCE(32649))), bitmap/static window handle required.
This trick works fine in C.
deguix
10th October 2004 17:33 UTC
On InstallOptionsEx you can click on a bitmap and execute something. However some things are laking there, like to change the cursor to a hand and to show up the boundaries. But it works, and I even tested it when I added the new notification system.
Rolando
10th October 2004 19:04 UTC
I have no experience with InstallOptionsEx unfortunately. Having the "hand" cursor is not a must but is preferrable. So can anyone guide me how I can do it ?
deguix
10th October 2004 19:27 UTC
Do you use Modern UI?
EDIT: I don't think there is a way to fix IO for that without changing the source code. That's why I'm pointing out IOEx which is already built.
If you're looking for IOEx, see the link on my signature.
Rolando
10th October 2004 19:53 UTC
ok thanks deguix, i'm trying it out
Rolando
13th October 2004 14:34 UTC
Ok everything worked fine. Thanks alot. Any chance of having the "hand" cursor appear when you hover on the mouse ?
Takhir
13th October 2004 18:16 UTC
I wrote above that you must change banner window class parameter - type of cursor. InstallOptions::dialog pushes to stack dialog window handle, so find one of it's childs - STATIC class window with banner and SetClassLong().
Takhir
13th October 2004 20:14 UTC
Another and very simple way - modify InstallOptions.cpp and recompile IO project. Attached file is from 2.0 version, but you can add 2 lines from it to later version (if any), do it after CreateWindowEx in case FIELD_BITMAP:
SetWindowLong(pField->hwnd, GWL_STYLE,
GetWindowLong(pField->hwnd, GWL_STYLE) | SS_NOTIFY);
SetClassLong(pField->hwnd, GCL_HCURSOR,
(long)LoadCursor(NULL, MAKEINTRESOURCE(32649)));
Skip first line if your banner already sends notifications.
deguix
13th October 2004 23:12 UTC
Hmmm... your code will be more than useful for me on the IOEx next version, even for the other controls, or even to add other options... But anyways, thanks for the help.
Rolando
15th October 2004 19:13 UTC
Thanks tons Takhir, that's exactly what I needed =D