flat assembler
Message board for the users of flat assembler.

Index > Windows > Hyperlink Static (sub-classing example)

Author
Thread Post new topic Reply to topic
bitRAKE



Joined: 21 Jul 2003
Posts: 2900
Location: [RSP+8*5]
bitRAKE
Simple example.

To WM_CREATE/WM_INITDIALOG:
Code:
stdcall ConvertStaticToHyperlink,[hWndParent],ID_LINK    
To WM_COMMAND/ID_LINK:
Code:
invoke GetDlgItemText,[hWndParent],ID_LINK,string_buffer,sizeof.string_buffer
invoke ShellExecute,0,"Open",string_buffer,0,0,SW_SHOWNORMAL    
...and any static becomes a clickable link.

Of course, the static text doesn't need to match the URL - I just like to inform the user where they are going.


Description: Convert static to hyperlink.
Download
Filename: Hyperlink.rar
Filesize: 2.94 KB
Downloaded: 167 Time(s)

Post 18 Dec 2007, 06:56
View user's profile Send private message Visit poster's website Reply with quote
bitRAKE



Joined: 21 Jul 2003
Posts: 2900
Location: [RSP+8*5]
bitRAKE
I've done a conversion of the above example for Win64 - using the new Subclassing API, and added the abliity to change the link color (by updating the control property). Please let me know of errors.


Description: Fixed some bugs, please re-download if you're one of the three prior.
Download
Filename: Hyperlink64.zip
Filesize: 3.23 KB
Downloaded: 119 Time(s)


_________________
¯\(°_o)/¯ unlicense.org


Last edited by bitRAKE on 29 May 2009, 04:15; edited 1 time in total
Post 28 May 2009, 08:24
View user's profile Send private message Visit poster's website Reply with quote
pete



Joined: 20 Apr 2009
Posts: 110
pete
Wow, i didn't know that such an effort is needed for a hyperlink. Thanks for the example.
Post 28 May 2009, 13:02
View user's profile Send private message Reply with quote
bitRAKE



Joined: 21 Jul 2003
Posts: 2900
Location: [RSP+8*5]
bitRAKE
A custom control might be more appropriate to the task, but that wouldn't demonstrate sub-classing. Here the goal is to reuse an existing control interface with small changes to improve the user's experience.
Post 28 May 2009, 15:10
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar.

Powered by rwasa.