Posts: 45
Threads: 13
Joined: Jul 2009
Hello again everyone
Have a new question today
Is it possible to have a static text
At first it says Ex "No Website" with no hyperlink
and at the push of a button
it changes the text(setwintext?) to "Website" and that text is a hyperlink to say http://www.google.com
Was wondering if this is possible
Thanks and any help is appreciated
Posts: 12,073
Threads: 140
Joined: Dec 2002
Function dlg_link
\Dialog_Editor
;SysLink control.
;The control shows text with internet links (hyperlinks). These links can open web pages, files, or execute any other code.
;The control is unavailable on Windows 2000.
function# hDlg message wParam lParam
if(hDlg) goto messages
if(!ShowDialog("dlg_link" &dlg_link 0)) ret
;BEGIN DIALOG
;0 "" 0x90C80AC8 0x0 0 0 223 135 "Dialog"
;1 Button 0x54030001 0x4 120 116 48 14 "OK"
;2 Button 0x54030000 0x4 170 116 48 14 "Cancel"
;3 Button 0x54032000 0x0 4 6 48 14 "Button"
;4 SysLink 0x54030000 0x0 66 6 130 12 ""
;END DIALOG
;DIALOG EDITOR: "" 0x2030208 "*" "" ""
ret
;messages
sel message
,case WM_INITDIALOG
,_s="No Website"
,_s.setwintext(id(4 hDlg))
,
,case WM_DESTROY
,case WM_COMMAND goto messages2
,case WM_NOTIFY goto messages3
ret
;messages2
sel wParam
,case 3 ;;button click
,_s="Link to <a>Google</a>"
,_s.setwintext(id(4 hDlg))
,
,case IDOK
,case IDCANCEL
ret 1
;messages3
NMHDR* nh=+lParam
sel nh.idFrom
,case 4 ;;syslink control
,sel nh.code
,,case [NM_CLICK,NM_RETURN] ;;link click or Enter
,,run "http://www.google.com"
Posts: 45
Threads: 13
Joined: Jul 2009
Thank you so much
This is wonderful
Posts: 45
Threads: 13
Joined: Jul 2009
I was also wondering, can this be done with a static text also
or only SysLink
Thanks again
Posts: 12,073
Threads: 140
Joined: Dec 2002
Need for Windows 2000?
If no, easier to use SysLink. With Static also possible but much work. Also possible with rich edit control.
Posts: 45
Threads: 13
Joined: Jul 2009
No i dont need for Windows 2000
It works great by the way
I was just wondering if would work with static text considering the more options(center text, etc...)
But this will be fine
Maswell use the easiest way
Thanks again man, your a very big help whenever i have problems
Posts: 153
Threads: 33
Joined: Aug 2009
Hi Gintaras!
How would i reset the SysLink control correctly?
thats what i did but it doesnt look right to me!?
Function dlg_link
\Dialog_Editor
;SysLink control.
;The control shows text with internet links (hyperlinks). These links can open web pages, files, or execute any other code.
;The control is unavailable on Windows 2000.
function# hDlg message wParam lParam
if(hDlg) goto messages
if(!ShowDialog("dlg_link" &dlg_link 0)) ret
;BEGIN DIALOG
;0 "" 0x90C80AC8 0x0 0 0 223 135 "Dialog"
;1 Button 0x54030001 0x4 120 116 48 14 "OK"
;2 Button 0x54030000 0x4 170 116 48 14 "Cancel"
;3 Button 0x54032000 0x0 4 6 48 14 "Button"
;4 SysLink 0x54030000 0x0 66 6 130 12 ""
;5 Button 0x54032000 0x0 4 30 48 14 "back"
;END DIALOG
;DIALOG EDITOR: "" 0x2030300 "*" "" ""
ret
;messages
sel message
,case WM_INITDIALOG
,_s="No Website"
,_s.setwintext(id(4 hDlg))
,
,case WM_DESTROY
,case WM_COMMAND goto messages2
,case WM_NOTIFY goto messages3
ret
;messages2
sel wParam
,case 3 ;;button click
,_s="Link to <a>Google</a>"
,_s.setwintext(id(4 hDlg))
,case 5
,_s="<a></a>"
,_s.setwintext(id(4 hDlg))
,case IDOK
,case IDCANCEL
ret 1
;messages3
NMHDR* nh=+lParam
sel nh.idFrom
,case 4 ;;syslink control
,sel nh.code
,,case [NM_CLICK,NM_RETURN] ;;link click or Enter
,,run "http://www.google.com"
thanks!
Posts: 12,073
Threads: 140
Joined: Dec 2002
Why doesnt look right? It works.
Posts: 153
Threads: 33
Joined: Aug 2009
I didnt say it wouldnt work. i said it doesnt look right to me and i was wondering why _s="" does actually nothing.
thanks for ur time and great work on vers. 2.3.3
best regards
Posts: 12,073
Threads: 140
Joined: Dec 2002
I also tested _s="" and it worked, but I believe that on other Windows version it does not work. Then empty link also is OK.
Posts: 153
Threads: 33
Joined: Aug 2009
Im still workin with my good old xp prof and empty string doesnt work..
anyway Thank you very much
|