Thread: Draw an hyperlink on the window

  1. #1
    Registered User
    Join Date
    Mar 2005
    Location
    Juneda
    Posts
    291

    Draw an hyperlink on the window

    Hello, that's about drawing an html hyperlink text out of any control, like the links that appear in the devc++/help/about window.

    I'm sure that I have seen a similar question on that board, but I'm not able to find it (yes, I have searched on the search section).

    Well, the exact problem that I have is how to draw a blue-underlined-clickable text directly on the window. I know how to draw blue and underlined text, but I cannot find how to assign a pointer mouse cursor to a simple text (well, I can assign a mouse pointer to a static control, so is that the way to do an hyperlink? I'll try that while wait for help ).

    Thank's in advance
    Niara

  2. #2
    Registered User pronecracker's Avatar
    Join Date
    Oct 2006
    Location
    netherlands
    Posts
    158
    There's a Common Control for this called SysLink control. It does what you want and more. Don't know if you want to use it. For more information see this page: http://msdn2.microsoft.com/en-us/library/ms651106.aspx .
    Don't call me stupid.

  3. #3
    Registered User
    Join Date
    Mar 2005
    Location
    Juneda
    Posts
    291
    Hello pronecracker, thank's for your time and help.

    That is exactly what I'm searching for, but I'm using DevCpp/MingW and I'm not sure that it have implemented the library for the new commoncontrols, because my 'commctrl.h June 2006' doesn't have defined the 'WC_LINK' window class necesary to create that link control.

    I have been reading a bit more about that window class on the msdn and I find the next words about the new common controls for windows xp:
    Code:
    Finally, there's the long-awaited hyperlink control of which all brave Win32 developers have their own custom 
    incarnation. The hyperlink control is implemented through a separate file called hlink.dll that is available only 
    on Windows XP. This DLL is not portable outside Windows XP because it requires side-by-side 
    component support and an explicit link to ComCtl32 version 6.0. The control is a window that renders marked-up text 
    and launches appropriate applications when the user clicks one of the embedded links. You create hyperlink controls 
    by calling CreateWindow specifying the WC_LINK window class name.
    I think that I'll have to create my own link control, althought more comments will be welcomed.

    Niara

  4. #4
    Registered User Joelito's Avatar
    Join Date
    Mar 2005
    Location
    Tijuana, BC, México
    Posts
    310
    I use a static control and capture for the color, WM_CTLCOLORSTATIC; for the mouse events in the static use STN_CLICKED.
    * PC: Intel Core 2 DUO E6550 @ 2.33 GHz with 2 GB RAM: Archlinux-i686 with xfce4.
    * Laptop: Intel Core 2 DUO T6600 @ 2.20 GHz with 4 GB RAM: Archlinux-x86-64 with xfce4.

  5. #5
    Registered User
    Join Date
    Mar 2005
    Location
    Juneda
    Posts
    291
    Hello Joelito, thank's for share your trick.

    Actually I have been created and using my own custom control to do it (yes, lot of work to use only one link in my program )

    Niara

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. WM_CAPTION causing CreateWindowEx() to fail.
    By Necrofear in forum Windows Programming
    Replies: 8
    Last Post: 04-06-2007, 08:23 AM
  2. 6 measly errors
    By beene in forum Game Programming
    Replies: 11
    Last Post: 11-14-2006, 11:06 AM
  3. Pong is completed!!!
    By Shamino in forum Game Programming
    Replies: 11
    Last Post: 05-26-2005, 10:50 AM
  4. OpenGL Window
    By Morgul in forum Game Programming
    Replies: 1
    Last Post: 05-15-2005, 12:34 PM
  5. opengl code not working
    By Unregistered in forum Windows Programming
    Replies: 4
    Last Post: 02-14-2002, 10:01 PM