Italia
Foro

Erledigt: Messagebox plus Hyperlink

 

Hans
Hermann
Ciao,
ich suche eine einfache XProfan-Lösung, in einer Messagebox (Impronta) noch eine Website und eine Mailadresse unterzubringen als underlined-Lösung, nicht als Button.

Vielen Dank!
Hans
 
05.02.2010  
 



Da hilft MessageBoxIndirect  [...]  mit Beispielen  [...]  und  [...]  , Hyperlink vlt. per  [...]  .

Wenn Du das zusammenbekommen hast, dann hätte ich das auch gerne.
 
05.02.2010  
 




Rolf
Koch
Tja Hans, wer meinen Object Creator nutzt, der weis wie einfach es ist
 
05.02.2010  
 




Andreas
Miethe


Per Hook geht eine Menge
 $H Windows.ph
 $H Messages.ph
Struct CWPSTRUCT = lParam&,wParam&,message&,hwnd&
Struct Rect = left&,top&,right&,bottom&
#############################
Messagebox-Konstanten
DEF &IDOK         1
DEF &IDCANCEL     2
DEF &IDABORT      3
DEF &IDRETRY      4
DEF &IDIGNORE     5
DEF &IDYES        6
DEF &IDNO         7
DEF &IDHELP       9
DEF &IDTRYAGAIN  10
DEF &IDCONTINUE  11
DEF &IDICON      20
DEF &IDPROMPT $FFFF
DEF &IDSTATIC $CAFE
#############################

Proc MB

    Parameters wnd&,msg&,wparam&,lparam&
    Declare Result&,W&,H&,b&
    Result& = ~CallWindowProc(OldProc&,wnd&,msg&,wparam&,lparam&)

    select msg&

        Caseof ~WM_INITDIALOG

        Var SRect# = New(Rect)
        ~GetWindowRect(wnd&,SRect#)
        Dialog vergrössern und zentrieren
        W& = SRect#.right& - SRect#.left&
        H& = SRect#.bottom& -SRect#.top& + 40
        ~Movewindow(wnd&,((%maxx/2)-(W&/2)),((%maxy/2)-(H&/2)),W&,H&,1)
        Positionen der Controls 40 Pixel nach untern verchieben
        ~Getwindowrect(~GetDlgItem(wnd&,&IDSTATIC),SRect#)
        ~Mapwindowpoints(0,wnd&,SRect#,2)
        ~Movewindow(~GetDlgItem(wnd&,&IDSTATIC),0,SRect#.Top&+40,SRect#.Right&,SRect#.Bottom&,1)

        Whileloop 1,11

            If ~IsWindow(~GetDlgItem(wnd&,&Loop))

                ~Getwindowrect(~GetDlgItem(wnd&,&Loop),SRect#)
                ~Mapwindowpoints(0,wnd&,SRect#,2)
                ~Setwindowpos(~GetDlgItem(wnd&,&Loop),0,SRect#.Left&,SRect#.Top&+40,0,0,~SWP_NOSIZE | ~SWP_NOZORDER)

            Endif

        Endwhile

        Position vom PROMPT holen
        ~Getwindowrect(~GetDlgItem(wnd&,&IDPROMPT),SRect#)
        ~Mapwindowpoints(0,wnd&,SRect#,2)
        LINKS unter PROMPT anlegen
        Link& = Control("SysLink","<a>Besuch meine Homepage</a>",$50000000,SRect#.Left&,SRect#.Bottom&+10,width(wnd&),18,wnd&,4000,0,0)
        SendMessage(Link&,~WM_SETFONT,~GetStockObject(~ANSI_VAR_FONT),1)
        Mail& = Control("SysLink","<a>Schick mir eine Mail</a>",$50000000,SRect#.Left&,SRect#.Bottom&+30,width(wnd&),18,wnd&,4001,0,0)
        SendMessage(Mail&,~WM_SETFONT,~GetStockObject(~ANSI_VAR_FONT),1)
        Dispose SRect#
        Result& = 1

        Caseof ~WM_NOTIFY

        Link abfragen

        If (Long(lparam&,8) = -2) and (Long(lParam&,0) = LINK&)

            ShellExec("https://www.ampsoft.eu","open",~SW_SHOWNORMAL)

        endif

        If (Long(lparam&,8) = -2) and (Long(lParam&,0) = Mail&)

            ShellExec("Mailto://","open",~SW_SHOWNORMAL)

        endif

        Result& = 1

        Caseof ~WM_NCDESTROY

        ~UnhookWindowsHookEx(Hook&)
        Result& = 1

    Endselect

    Return Result&

Endproc

Proc SetHook

    Parameters nCode&, wParam&, lParam&

    Select nCode&

        Caseof ~HC_ACTION

        Var pw# = New(CWPSTRUCT)
        pw# = lparam&

        If pw#.message& = ~WM_INITDIALOG

            OldProc& = ~SetWindowlong(pw#.hwnd&,~GWL_WNDPROC,ProcAddr("MB",4))
            Dispose pw#

        Endif

    EndSelect

    Return ~CallNextHookEx(Hook&, nCode&, wParam&, lParam&)

EndProc

Proc PRF_Messagebox

    Set("Fastmode",1)
    Parameters  body$, title$, flags&
    Declare Result&
    Hook& = ~SetWindowsHookEx(~WH_CALLWNDPROC, ProcAddr("SetHook",3), 0,~GetCurrentThreadId())
    Result& = MessageBox(title$,body$, flags&)
    Set("Fastmode",0)
    Return Result&

EndProc

Hier gehts los
Declare Hook&,OldProc&
Declare LINK&,Mail&
cls
Print PRF_Messagebox("Eine Frage...","Wirklich löschen ?",~MB_YESNOCANCEL | ~MB_DEFBUTTON2 | ~MB_ICONQUESTION | ~MB_APPLMODAL)
Waitinput
 
Gruss
Andreas
________ ________ ________ ________ _
Profan 3.3 - XProfanX2
Win 95,98,ME,2000,XP,Vista - Win 7 32 / 64 Bit
ASUS X93S - Intel Core I7-NVIDIA GForce 540M 8GB Arbeitsspeicher
Homepage :  [...] 
06.02.2010  
 




Frank
Abbing
Der Hintergrund stimmt noch nicht ganz.

 
06.02.2010  
 




Andreas
Miethe


Wie soll der Hintergrund denn aussehen ?
 
Gruss
Andreas
________ ________ ________ ________ _
Profan 3.3 - XProfanX2
Win 95,98,ME,2000,XP,Vista - Win 7 32 / 64 Bit
ASUS X93S - Intel Core I7-NVIDIA GForce 540M 8GB Arbeitsspeicher
Homepage :  [...] 
06.02.2010  
 




Frank
Abbing
Wirkt komisch, wenn er unten wieder weiss wird. Der Linktext sollte vielleicht besser unter dem Icon stehen.
 
06.02.2010  
 




Andreas
Miethe


Das kann ja jeder anpassen wie er es möchte ( bei WM_INITDIALOG )
z.B. in Schweinchenrosa

6 kB
Hochgeladen:06.02.2010
Downloadcounter197
Download
 
Gruss
Andreas
________ ________ ________ ________ _
Profan 3.3 - XProfanX2
Win 95,98,ME,2000,XP,Vista - Win 7 32 / 64 Bit
ASUS X93S - Intel Core I7-NVIDIA GForce 540M 8GB Arbeitsspeicher
Homepage :  [...] 
06.02.2010  
 




Frank
Abbing
Schweinchenrosa ist genau richtig, danke!
 
06.02.2010  
 




Andreas
Miethe


OK, ich habe obigen Code so geändert, dass die Links jetzt unter dem Prompt und circa den Butons angezeigt werden.

5 kB
Hochgeladen:07.02.2010
Downloadcounter194
Download
 
Gruss
Andreas
________ ________ ________ ________ _
Profan 3.3 - XProfanX2
Win 95,98,ME,2000,XP,Vista - Win 7 32 / 64 Bit
ASUS X93S - Intel Core I7-NVIDIA GForce 540M 8GB Arbeitsspeicher
Homepage :  [...] 
07.02.2010  
 




Frank
Abbing
Das sieht richtig gut aus, Andreas!
 
07.02.2010  
 




E.T.
Klasse !! Aber warum müssen denn die Schweinchen immer rosa sein ???
Bei uns (früher) im Stall waren die immer dreckig , haben aber trotzdem geschmeckt...
 
Grüße aus Sachsen... Mario
WinXP, Win7 (64 Bit),Win8(.1),Win10, Win 11, Profan 6 - X4, XPSE, und 'nen schwarzes, blinkendes Dingens, wo ich das alles reinschütte...
08.02.2010  
 



Answer


Topictitle, max. 100 characters.
 

Systemprofile:

Kein Systemprofil angelegt. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Bitte anmelden um einen Beitrag zu verfassen.
 

Topic-Options

10.975 Views

Untitledvor 0 min.
RudiB.15.04.2022
Alibre28.11.2017
p.specht24.07.2017
Hans Hermann10.08.2015
Di più...

Themeninformationen



Admins  |  AGB  |  Applications  |  Autori  |  Chat  |  Informativa sulla privacy  |  Download  |  Entrance  |  Aiuto  |  Merchantportal  |  Impronta  |  Mart  |  Interfaces  |  SDK  |  Services  |  Giochi  |  Cerca  |  Support

Ein Projekt aller XProfaner, die es gibt!


Il mio XProfan
Private Notizie
Eigenes Ablageforum
Argomenti-Merkliste
Eigene Beiträge
Eigene Argomenti
Zwischenablage
Annullare
 Deutsch English Français Español Italia
Traduzioni

Informativa sulla privacy


Wir verwenden Cookies nur als Session-Cookies wegen der technischen Notwendigkeit und bei uns gibt es keine Cookies von Drittanbietern.

Wenn du hier auf unsere Webseite klickst oder navigierst, stimmst du unserer Erfassung von Informationen in unseren Cookies auf XProfan.Net zu.

Weitere Informationen zu unseren Cookies und dazu, wie du die Kontrolle darüber behältst, findest du in unserer nachfolgenden Datenschutzerklärung.


einverstandenDatenschutzerklärung
Ich möchte keinen Cookie