Archive: Placing a banner with link


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 ?


Maybe you could have two link controls with no text covering two images.

-Stu


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 ?


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.


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.


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.


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 ?


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.


ok thanks deguix, i'm trying it out


Ok everything worked fine. Thanks alot. Any chance of having the "hand" cursor appear when you hover on the mouse ?


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().


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.


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.


Thanks tons Takhir, that's exactly what I needed =D