Hi,
Spoiler anzeigen
#include<GUIConstantsEx.au3>
#include <GUIConstants.au3>
$GUI = GUICreate("Enter a name for a new folder....", 320, 120, @DesktopWidth / 2 - 160, @DesktopHeight / 2 - 45, -1, 0x00000018); WS_EX_ACCEPTFILES
$file = GUICtrlCreateInput("", 10, 20, 300, 20)
$btn = GUICtrlCreateButton("Ok", 40, 95, 60, 20)
GUISetState(@SW_SHOW)
Dim $previousText
[/autoit] [autoit][/autoit] [autoit]While 1
$msg = GUIGetMsg()
If $msg = $btn Or $msg = $GUI_EVENT_CLOSE Then Exit
$text = GUICtrlRead($file)
If $previousText <> $text Then ToolTip("")
If StringRegExp($text, '\\|/|:|\*|\?|\"|\<|\>|\|') Then
GUICtrlSetData($file, StringRegExpReplace($text, '\\|/|:|\*|\?|\"|\<|\>|\|', ""))
DllCall("user32.dll", "int", "MessageBeep", "int", 0xFFFFFFFF) ;Beep
Local $tooltipPos = WinGetPos($GUI)
ToolTip("A file name cannot contain any of the following characters:" & @LF & _
' \ / : * ? " < > |', $tooltipPos [0] + 160, $tooltipPos [1] + 60, Default, Default, 3)
$previousText = GUICtrlRead($file)
EndIf
WEnd
Mega