In einer echten Statusbar ist mir keine Möglichkeit bekannt.
Ich hatte es doch beschrieben. So wirds gemacht:
AutoIt
#include <WindowsConstants.au3>
#include <GUIConstantsEx.au3>
#include <GuiStatusBar.au3>
#include <GuiRichEdit.au3>
Global $g_hRichEdit
Example()
Func Example()
Local $hGUI, $idInputUrl, $idSetUrl, $hStatus, $sRead
Local $aParts[3] = [80, 160, -1]
; Create GUI
$hGUI = GUICreate("StatusBar Embed Control", 400, 300)
$idInputUrl = GUICtrlCreateInput('', 10, 10, 345, 20)
GUICtrlSendMsg($idInputUrl, 0x1501, 1, 'Url hier eintragen')
$idSetUrl = GUICtrlCreateButton('Set', 360, 10, 30, 20)
; defaults to 1 part, no text
$hStatus = _GUICtrlStatusBar_Create($hGUI)
_GUICtrlStatusBar_SetMinHeight($hStatus, 20)
GUISetState(@SW_SHOW)
; Initialize parts
_GUICtrlStatusBar_SetParts($hStatus, $aParts)
_GUICtrlStatusBar_SetText($hStatus, "Part 1")
_GUICtrlStatusBar_SetText($hStatus, "Part 2", 1)
; Embed a Richedit
$g_hRichEdit = _GUICtrlRichEdit_Create($hGui, '', 0, 0, -1, -1)
_GUICtrlRichEdit_SetParaAlignment($g_hRichEdit, 'c')
GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY")
_GUICtrlRichEdit_SetEventMask($g_hRichEdit, $ENM_LINK)
_GUICtrlRichEdit_AutoDetectURL($g_hRichEdit, True)
_GUICtrlStatusBar_EmbedControl($hStatus, 2, $g_hRichEdit)
; Loop until the user exits.
While 1
Switch GUIGetMsg()
Case -3
ExitLoop
Case $idSetUrl
$sRead = GUICtrlRead($idInputUrl)
If $sRead <> '' Then
_GUICtrlRichEdit_SetText($g_hRichEdit, $sRead)
EndIf
EndSwitch
WEnd
GUIDelete()
EndFunc ;==>Example
Func WM_NOTIFY($hWnd, $iMsg, $wParam, $lParam)
#forceref $hWnd, $iMsg, $wParam
Local $hWndFrom, $iCode, $tNMHDR, $tEnLink, $iCpMin, $iCpMax, $tMsgFilter
$tNMHDR = DllStructCreate($tagNMHDR, $lParam)
$hWndFrom = HWnd(DllStructGetData($tNMHDR, "hWndFrom"))
$iCode = DllStructGetData($tNMHDR, "Code")
Switch $hWndFrom
Case $g_hRichEdit
Select
Case $iCode = $EN_LINK
$tMsgFilter = DllStructCreate($tagMSGFILTER, $lParam)
If DllStructGetData($tMsgFilter, "msg") = $WM_LBUTTONUP Then
$tEnLink = DllStructCreate($tagENLINK, $lParam)
$iCpMin = DllStructGetData($tEnLink, "cpMin")
$iCpMax = DllStructGetData($tEnLink, "cpMax")
ShellExecute(_GUICtrlRichEdit_GetTextInRange($g_hRichEdit, $iCpMin, $iCpMax))
EndIf
EndSelect
EndSwitch
Return $GUI_RUNDEFMSG
EndFunc ;==>WM_NOTIFY
Alles anzeigen
Edit: Ein #Include fehlte - ergänzt.