Hey,
ich möchte wie im Titel beschrieben ein Bild rechts oder links IN der MsgBox drinne haben, also nicht dieses kleine Shortcut oben sondern beim Text. Wie kann ich das machen?
Mfg
MsgBox mit eigenem Bild
-
- [ offen ]
-
Nakroma -
1. März 2012 um 17:28 -
Geschlossen -
Erledigt
-
-
Entweder erstellst du dir ein eigenes Fenster per GuiCreate oder du erstellst ein Parent-Fenster zur Msg-Box, mit $GUI_POPUP als Style und nur dem Bild als Control und schiebst es an die richtige Stelle in der Msg-Box.
-
Stoppt eine Zweite GUI die Erste? Das wäre wichtig.
Also ob das Script stoppt solange die 2. GUI offen ist. -
Wie meinst du das?
Geschickt programmiert funktionieren beide. -
Eben das soll es machen. Während die MsgBox/GUI offen ist soll das restliche Script stoppen bis ich OK gedrückt habe.
-
Oder Du fügst Dein Symbol den Ressourcen hinzu und ...
Spoiler anzeigen
[autoit]#include <Constants.au3>
[/autoit] [autoit][/autoit] [autoit]
#include <WinAPI.au3>Global Const $MB_USERICON = 0x00000080
[/autoit] [autoit][/autoit] [autoit]; --- $MSGBOXPARAMS
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]
Global Const $MSGBOXPARAMS = _
"UINT cbSize;"& _
"HWND hwndOwner;"& _
"HANDLE hInstance;"& _
"ptr lpszText;"& _
"ptr lpszCaption;"& _
"DWORD dwStyle;"& _
"ptr lpszIcon;"& _
"DWORD_PTR dwContextHelpId;"& _
"ptr lpfnMsgBoxCallback;"& _
"DWORD dwLanguageId;"Func MessageBoxIndirect ($lpMsgBoxParams)
[/autoit] [autoit][/autoit] [autoit]Local $aRes = DllCall ("user32.dll", "INT", "MessageBoxIndirectW", _
[/autoit] [autoit][/autoit] [autoit]
"ptr", $lpMsgBoxParams)
Return $aRes[0]EndFunc
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]Func MyMsgBox ($hwnd, $text, $title, $style)
[/autoit] [autoit][/autoit] [autoit]Local $mbp = DllStructCreate ($MSGBOXPARAMS)
[/autoit] [autoit][/autoit] [autoit]
Local $szText = DllStructCreate (StringFormat ("WCHAR [%d]", StringLen ($text)+1))
Local $szTitle = DllStructCreate (StringFormat ("WCHAR [%d]", StringLen ($title)+1))
Local $szIcon = DllStructCreate ("WCHAR [4]")DllStructSetData ($szText, 1, $text)
[/autoit] [autoit][/autoit] [autoit]
DllStructSetData ($szTitle, 1, $title)
DllStructSetData ($szIcon, 1, "#99") ; Resource ID from Icon Group (e.g. AutoIt-Icon)DllStructSetData ($mbp, "cbSize", DllStructGetSize ($mbp))
[/autoit] [autoit][/autoit] [autoit]
DllStructSetData ($mbp, "hwndOwner", $hwnd)
DllStructSetData ($mbp, "hInstance", _WinAPI_GetModuleHandle (0))
DllStructSetData ($mbp, "lpszText", DllStructGetPtr ($szText))
DllStructSetData ($mbp, "lpszCaption", DllStructGetPtr ($szTitle))
DllStructSetData ($mbp, "dwStyle", BitOR ($style, $MB_USERICON))
DllStructSetData ($mbp, "lpszIcon", DllStructGetPtr ($szIcon)) ; Icon ID
DllStructSetData ($mbp, "dwContextHelpId", 0)
DllStructSetData ($mbp, "lpfnMsgBoxCallback", 0)
DllStructSetData ($mbp, "dwLanguageId", 0)MessageBoxIndirect (DllStructGetPtr ($mbp))
[/autoit] [autoit][/autoit] [autoit]EndFunc
[/autoit] [autoit][/autoit] [autoit]MyMsgBox (0, "Dies ist der Text", "Titel", $MB_OK)
[/autoit] [autoit][/autoit] [autoit][/autoit]
Exit (0)Gruß
Greenhorn -
In diese Richtung hätte ich auch noch was zu bieten.