Ich glaub man ist im falschen Forum wenn man einen Bot nicht von einem kleinen Spiel (anhand des Codes) unterscheiden kann!
Schnacko, poste doch mal das ganze Skript, ich krieg 5 errors und 38 warnings^^
Beiträge von Irrlicht
-
-
Hallo,
mein neues Projekt ist eigentlich fertig. Ein Windowslogon via Spracherkennung.
Beim Laufenlassen des Skriptes läuft alles sauber:Spoiler anzeigen
[autoit]#include <GUIConstants.au3>
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]
#include <GDIPlus.au3>
#include <WinAPI.au3>
#include <Misc.au3>
#include <SAPIListBox.au3>Local $x1, $y1, $x2 = 0
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]
Local $y2 = @DesktopHeight / 2
Local $login = False
Local $password = IniRead(@ScriptDir & "\data.ini", "data", "pw", "hello")
Dim $wortbox_array[1] = [$password]
HotKeySet("0", "emergency")$oTalk = ObjCreate('SAPI.SpVoice')
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]
$oTalk.voice = $oTalk.GetVoices("Name=Microsoft Sam", "Language=409" ).Item(0)
$vUser32DLL = DllOpen("User32.dll")
$iGUIWidth = @DesktopWidth
$iGUIHeight = @DesktopHeight
$tSize = DllStructCreate($tagSIZE)
$pSize = DllStructGetPtr($tSize)
DllStructSetData($tSize, "X", $iGUIWidth)
DllStructSetData($tSize, "Y", $iGUIHeight)
$tSource = DllStructCreate($tagPOINT)
$pSource = DllStructGetPtr($tSource)
$tBlend = DllStructCreate($tagBLENDFUNCTION)
$pBlend = DllStructGetPtr($tBlend)
DllStructSetData($tBlend, "Alpha", 255)
DllStructSetData($tBlend, "Format", 1)
$hWnd = GUICreate("", $iGUIWidth, $iGUIHeight, 0, 0, 0x08000000, BitOR(0x00080000, 0x00000080))
GUISetState()
$hDC_Window = _WinAPI_GetDC($hWnd)
$hDC_Buffer = _WinAPI_CreateCompatibleDC($hDC_Window)
$hBitmap_Buffer = _WinAPI_CreateCompatibleBitmap($hDC_Window, $iGUIWidth, $iGUIHeight)
_WinAPI_SelectObject($hDC_Buffer, $hBitmap_Buffer)
$fenster = GUICreate("Speechlock by $2Billie", 400, 300)
$wortbox = _GUICtrlSAPIListBox_Create(10, 10, 380, 280)
_GUICtrlSAPIListBox_EnableSpeech($wortbox, 3)
_GUICtrlSAPIListBox_AddArray($wortbox, $wortbox_array)
GUISetState(@SW_HIDE, $fenster)
_GDIPlus_Startup()
$hGraphics = _GDIPlus_GraphicsCreateFromHDC($hDC_Buffer)
$img = _GDIPlus_ImageLoadFromFile(@ScriptDir & "\startscreen.jpg")
$img2 = _GDIPlus_ImageLoadFromFile(@ScriptDir & "\startscreen2.jpg")
_drawgdiplus("Please say your password")
DoIf @SEC = 30 Or @SEC = 0 Then
[/autoit] [autoit][/autoit] [autoit]
$oTalk.Speak("Please say your password.")
Sleep(1000)
EndIf
$gettext = _GUICtrlSAPIListBox_GetText($wortbox)
If _GUICtrlSAPIListBox_CurSelChanged($wortbox) = True Then
$gettext = _GUICtrlSAPIListBox_GetText($wortbox)
If $gettext = $password Then$login = True
[/autoit] [autoit][/autoit] [autoit]
EndIf
EndIf
Until $login <> False
_drawgdiplus("Access was admitted")
Sleep(1000)
$oTalk.Speak("Access was admitted.")While $x1 > (-@DesktopWidth) And $x2 < @DesktopWidth
[/autoit] [autoit][/autoit] [autoit]
_GDIPlus_GraphicsClear($hGraphics)
$x1 -= 2
$x2 += 2
_GDIPlus_GraphicsDrawImageRect($hGraphics, $img, $x1, $y1, @DesktopWidth, @DesktopHeight / 2)
_GDIPlus_GraphicsDrawImageRect($hGraphics, $img2, $x2, $y2, @DesktopWidth, @DesktopHeight / 2)
_WinAPI_UpdateLayeredWindow($hWnd, $hDC_Window, 0, $pSize, $hDC_Buffer, $pSource, 0, $pBlend, 2)
WEnd
If @HOUR - 12 >= 3 And @HOUR <= 12 Then $oTalk.Speak("Good morning " & @UserName)
If @HOUR >= 13 And @HOUR <= 17 Then $oTalk.Speak("Good Day " & @UserName)
If @HOUR >= 18 And @HOUR - 12 >= 2 Then $oTalk.Speak("Good Evening " & @UserName)
ShellExecute("explorer.exe")Exit
[/autoit] [autoit][/autoit] [autoit]Func emergency()
[/autoit] [autoit][/autoit] [autoit]
$open = FileOpenDialog("Chose the file, where your password was saved.", @DesktopDir, "")
If $open = @ScriptDir & "\data.ini" Then
_drawgdiplus("Access was admitted")
Sleep(2000)
While $x1 > (-@DesktopWidth) And $x2 < @DesktopWidth
_GDIPlus_GraphicsClear($hGraphics)
$x1 -= 2
$x2 += 2
_GDIPlus_GraphicsDrawImageRect($hGraphics, $img, $x1, $y1, @DesktopWidth, @DesktopHeight / 2)
_GDIPlus_GraphicsDrawImageRect($hGraphics, $img2, $x2, $y2, @DesktopWidth, @DesktopHeight / 2)
_WinAPI_UpdateLayeredWindow($hWnd, $hDC_Window, 0, $pSize, $hDC_Buffer, $pSource, 0, $pBlend, 2)
WEnd
If @HOUR - 12 >= 3 And @HOUR <= 12 Then $oTalk.Speak("Good morning " & @UserName)
If @HOUR >= 13 And @HOUR <= 17 Then $oTalk.Speak("Good Day " & @UserName)
If @HOUR >= 18 And @HOUR - 12 >= 2 Then $oTalk.Speak("Good Evening " & @UserName)ShellExecute("explorer.exe")
[/autoit] [autoit][/autoit] [autoit]
Sleep(2000)Exit
[/autoit] [autoit][/autoit] [autoit]Else
[/autoit] [autoit][/autoit] [autoit]
$oTalk.Speak("You have said the wrong password.")
EndIf
EndFunc ;==>emergency
Func _GDIPlus_GraphicsDrawStringColor($hGraphics, $sString, $nX, $nY, $sFont = "Arial", $nSize = 10, $iFormat = 0, $iBrush = 0xFF000000)
Local $hBrush, $iError, $hFamily, $hFont, $hFormat, $aInfo, $tLayout, $bResult
$hBrush = _GDIPlus_BrushCreateSolid($iBrush)
$hFormat = _GDIPlus_StringFormatCreate($iFormat)
$hFamily = _GDIPlus_FontFamilyCreate($sFont)
$hFont = _GDIPlus_FontCreate($hFamily, $nSize)
$tLayout = _GDIPlus_RectFCreate($nX, $nY, 0, 0)
$aInfo = _GDIPlus_GraphicsMeasureString($hGraphics, $sString, $hFont, $tLayout, $hFormat)
$bResult = _GDIPlus_GraphicsDrawStringEx($hGraphics, $sString, $hFont, $aInfo[0], $hFormat, $hBrush)
$iError = @error
_GDIPlus_FontDispose($hFont)
_GDIPlus_FontFamilyDispose($hFamily)
_GDIPlus_StringFormatDispose($hFormat)
_GDIPlus_BrushDispose($hBrush)
Return SetError($iError, 0, $bResult)
EndFunc ;==>_GDIPlus_GraphicsDrawStringColor
Func _drawgdiplus($htext)
_GDIPlus_GraphicsDrawImageRect($hGraphics, $img, $x1, $y1, @DesktopWidth, @DesktopHeight / 2)
_GDIPlus_GraphicsDrawImageRect($hGraphics, $img2, $x2, $y2, @DesktopWidth, @DesktopHeight / 2)
_GDIPlus_GraphicsDrawStringColor($hGraphics, $htext, "", @DesktopHeight / 2, "Arial", 40, 0, 0x4B0000FF)
_WinAPI_UpdateLayeredWindow($hWnd, $hDC_Window, 0, $pSize, $hDC_Buffer, $pSource, 0, $pBlend, 2)EndFunc ;==>_drawgdiplus
[/autoit]
Spracherkennung funktioniert...und sonst auch alles!
Nachdem man die au3 kompiliert hat, kommt jedoch gerade in dem Moment, in dem das Passwort erkannt wurde, ein Error:Zitatline 6640 the requested action with this object has failed
Ich weiß echt nicht, was ich falsch mach, wo der Fehler liegt!
Nötige Include vonPeterSean Griffin:Spoiler anzeigen
[autoit]#include-once
[/autoit] [autoit][/autoit] [autoit]
#include <IE.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region Header
#cs
Title: SAPIListBox UDF Library for AutoIt3
Filename: SAPIListBox.au3
Description: A collection of functions for creating and controlling a SAPIListBox control in AutoIT
Author: seangriffin
Version: V0.1
Last Update: 21/05/10
Requirements: AutoIt3 3.2 or higher,
the Microsoft Speech API SDK v5.1
Changelog:
---------21/05/10---------- v0.1
Initial release.
Note that a clipping problem currently exists in the VLC control.#ce
[/autoit] [autoit][/autoit] [autoit]
#EndRegion Header
#Region Global Variables and Constants
Global $curr_speech_list_index = -1, $SpeechListBoxCtrl
#EndRegion Global Variables and Constants
#Region Core functions
; #FUNCTION# ;===============================================================================
;
; Name...........: _GUICtrlSAPIListBox_Create()
; Description ...: Creates a SAPI ListBox control.
; Syntax.........: _GUICtrlSAPIListBox_Create($left, $top, $width, $height, $enable_speech = True, $enable_listbox = True, $hide_listbox = False, $items = False)
; Parameters ....: $left - The left side of the control.
; $top - The top of the control.
; $width - The width of the control.
; $height - The height of the control.
; $enable_speech - A boolean value indicating whether to enable speech recognition.
; $enable_listbox - A boolean value indicating whether to enable the listbox.
; $hide_listbox - A boolean value indicating whether to hide the listbox.
; $items - An array of items to populate the listbox with.
; Return values .: On Success - Returns the identifier (controlID) of the new control.
; On Failure - Returns False.
; Author ........: seangriffin
; Modified.......:
; Remarks .......:
; Related .......:
; Link ..........:
; Example .......: Yes
;
; ;==========================================================================================
Func _GUICtrlSAPIListBox_Create($left, $top, $width, $height, $enable_speech = True, $enable_listbox = True, $hide_listbox = False, $items = False)Local $SpeechListBox
[/autoit] [autoit][/autoit] [autoit]$SpeechListBox = ObjCreate("SAPI51ListBox.Sample")
[/autoit] [autoit][/autoit] [autoit]; If the SAPIListBox is not a valid object (ie. the SAPI 5.1 SDK is not installed), then return False.
[/autoit] [autoit][/autoit] [autoit]
if $SpeechListBox = 0 Then Return False$SpeechListBoxCtrl = GUICtrlCreateObj ($SpeechListBox, $left, $top, $width, $height)
[/autoit] [autoit][/autoit] [autoit]if $enable_speech = True Then
[/autoit] [autoit][/autoit] [autoit]_GUICtrlSAPIListBox_EnableSpeech($SpeechListBox, 1)
[/autoit] [autoit][/autoit] [autoit]
Else_GUICtrlSAPIListBox_EnableSpeech($SpeechListBox, 0)
[/autoit] [autoit][/autoit] [autoit]
EndIf_GUICtrlSAPIListBox_Enable($SpeechListBox, $enable_listbox)
[/autoit] [autoit][/autoit] [autoit]
_GUICtrlSAPIListBox_Hide($SpeechListBox, $hide_listbox)if IsArray($items) Then _GUICtrlSAPIListBox_AddArray($SpeechListBox, $items)
[/autoit] [autoit][/autoit] [autoit]Return $SpeechListBox
[/autoit] [autoit][/autoit] [autoit]
EndFunc; #FUNCTION# ;===============================================================================
[/autoit] [autoit][/autoit] [autoit]
;
; Name...........: _GUICtrlSAPIListBox_EnableSpeech()
; Description ...: Enables or disables speech recognition in a SAPI ListBox control.
; Syntax.........: _GUICtrlSAPIListBox_EnableSpeech($SAPIListBox, $toggle)
; Parameters ....: $SAPIListBox - The control identifier (controlID) as returned by _GUICtrlSAPIListBox_Create.
; $toggle - 1 = enable
; 0 = disable
; Return values .: On Success - Returns True.
; On Failure - Returns False.
; Author ........: seangriffin
; Modified.......:
; Remarks .......:
; Related .......:
; Link ..........:
; Example .......: Yes
;
; ;==========================================================================================
Func _GUICtrlSAPIListBox_EnableSpeech($SAPIListBox, $toggle)$SAPIListBox.SpeechEnabled = $toggle
[/autoit] [autoit][/autoit] [autoit]Return True
[/autoit] [autoit][/autoit] [autoit]
EndFunc; #FUNCTION# ;===============================================================================
[/autoit] [autoit][/autoit] [autoit]
;
; Name...........: _GUICtrlSAPIListBox_Enable()
; Description ...: Enables or disables a SAPI ListBox control.
; Syntax.........: _GUICtrlSAPIListBox_Enable($SAPIListBox, $toggle)
; Parameters ....: $SAPIListBox - The control identifier (controlID) as returned by _GUICtrlSAPIListBox_Create.
; $toggle - 1 = enable
; 0 = disable
; Return values .: On Success - Returns True.
; On Failure - Returns False.
; Author ........: seangriffin
; Modified.......:
; Remarks .......:
; Related .......:
; Link ..........:
; Example .......: Yes
;
; ;==========================================================================================
Func _GUICtrlSAPIListBox_Enable($SAPIListBox, $toggle)$SAPIListBox.Enabled = $toggle
[/autoit] [autoit][/autoit] [autoit]Return True
[/autoit] [autoit][/autoit] [autoit]
EndFunc; #FUNCTION# ;===============================================================================
[/autoit] [autoit][/autoit] [autoit]
;
; Name...........: _GUICtrlSAPIListBox_Hide()
; Description ...: Hides or shows a SAPI ListBox control.
; Syntax.........: _GUICtrlSAPIListBox_Hide($SAPIListBox, $toggle)
; Parameters ....: $SAPIListBox - The control identifier (controlID) as returned by _GUICtrlSAPIListBox_Create.
; $toggle - 1 = hide
; 0 = show
; Return values .: On Success - Returns True.
; On Failure - Returns False.
; Author ........: seangriffin
; Modified.......:
; Remarks .......:
; Related .......:
; Link ..........:
; Example .......: Yes
;
; ;==========================================================================================
Func _GUICtrlSAPIListBox_Hide($SAPIListBox, $toggle)if $toggle = 1 Then
[/autoit] [autoit][/autoit] [autoit]GUICtrlSetState($SpeechListBoxCtrl, $GUI_HIDE)
[/autoit] [autoit][/autoit] [autoit]
ElseGUICtrlSetState($SpeechListBoxCtrl, $GUI_SHOW)
[/autoit] [autoit][/autoit] [autoit]
EndIfReturn True
[/autoit] [autoit][/autoit] [autoit]
EndFunc; #FUNCTION# ;===============================================================================
[/autoit] [autoit][/autoit] [autoit]
;
; Name...........: _GUICtrlSAPIListBox_AddString()
; Description ...: Adds a string to the end of a SAPI ListBox control.
; Syntax.........: _GUICtrlSAPIListBox_AddString($SAPIListBox, $text)
; Parameters ....: $SAPIListBox - The control identifier (controlID) as returned by _GUICtrlSAPIListBox_Create.
; $text - String that is to be added.
; Return values .: On Success - Returns True.
; On Failure - Returns False.
; Author ........: seangriffin
; Modified.......:
; Remarks .......:
; Related .......:
; Link ..........:
; Example .......: Yes
;
; ;==========================================================================================
Func _GUICtrlSAPIListBox_AddString($SAPIListBox, $text)$SAPIListBox.AddItem ($text)
[/autoit] [autoit][/autoit] [autoit]Return True
[/autoit] [autoit][/autoit] [autoit]
EndFunc; #FUNCTION# ;===============================================================================
[/autoit] [autoit][/autoit] [autoit]
;
; Name...........: _GUICtrlSAPIListBox_DeleteString()
; Description ...: Deletes a string from the SAPI ListBox control.
; Syntax.........: _GUICtrlSAPIListBox_DeleteString($SAPIListBox, $index)
; Parameters ....: $SAPIListBox - The control identifier (controlID) as returned by _GUICtrlSAPIListBox_Create.
; $index - Zero-based index of the string to be deleted.
; Return values .: On Success - Returns True.
; On Failure - Returns False.
; Author ........: seangriffin
; Modified.......:
; Remarks .......:
; Related .......:
; Link ..........:
; Example .......: Yes
;
; ;==========================================================================================
Func _GUICtrlSAPIListBox_DeleteString($SAPIListBox, $index)$SAPIListBox.RemoveItem ($index)
[/autoit] [autoit][/autoit] [autoit]Return True
[/autoit] [autoit][/autoit] [autoit]
EndFunc; #FUNCTION# ;===============================================================================
[/autoit] [autoit][/autoit] [autoit]
;
; Name...........: _GUICtrlSAPIListBox_GetSel()
; Description ...: Returns the selection status of an item.
; Syntax.........: _GUICtrlSAPIListBox_GetSel($SAPIListBox, $index)
; Parameters ....: $SAPIListBox - The control identifier (controlID) as returned by _GUICtrlSAPIListBox_Create.
; $index - Zero-based index of the index to get the selection status for.
; Return values .: On Success - Returns the selection status of an item.
; On Failure - Returns False.
; Author ........: seangriffin
; Modified.......:
; Remarks .......:
; Related .......:
; Link ..........:
; Example .......: Yes
;
; ;==========================================================================================
Func _GUICtrlSAPIListBox_GetSel($SAPIListBox, $index)Return $SAPIListBox.Selected ($index)
[/autoit] [autoit][/autoit] [autoit]
EndFunc; #FUNCTION# ;===============================================================================
[/autoit] [autoit][/autoit] [autoit]
;
; Name...........: _GUICtrlSAPIListBox_InsertString()
; Description ...: Inserts a string into a SAPI ListBox control.
; Syntax.........: _GUICtrlSAPIListBox_InsertString($SAPIListBox, $text, $index)
; Parameters ....: $SAPIListBox - The control identifier (controlID) as returned by _GUICtrlSAPIListBox_Create.
; $text - String that is to be added.
; $index - Specifies the zero based index of the position at which to insert the string.
; Return values .: On Success - Returns True.
; On Failure - Returns False.
; Author ........: seangriffin
; Modified.......:
; Remarks .......:
; Related .......:
; Link ..........:
; Example .......: Yes
;
; ;==========================================================================================
Func _GUICtrlSAPIListBox_InsertString($SAPIListBox, $text, $index)$SAPIListBox.AddItem ($text, $index)
[/autoit] [autoit][/autoit] [autoit]Return True
[/autoit] [autoit][/autoit] [autoit]
EndFunc; #FUNCTION# ;===============================================================================
[/autoit] [autoit][/autoit] [autoit]
;
; Name...........: _GUICtrlSAPIListBox_SetToolTip()
; Description ...: Sets the tooltip for the SAPI ListBox control.
; Syntax.........: _GUICtrlSAPIListBox_SetToolTip($SAPIListBox, $text)
; Parameters ....: $SAPIListBox - The control identifier (controlID) as returned by _GUICtrlSAPIListBox_Create.
; $text - String that is to be added as a tooltip.
; Return values .: On Success - Returns True.
; On Failure - Returns False.
; Author ........: seangriffin
; Modified.......:
; Remarks .......:
; Related .......:
; Link ..........:
; Example .......: Yes
;
; ;==========================================================================================
Func _GUICtrlSAPIListBox_SetToolTip($SAPIListBox, $text)$SAPIListBox.ToolTipText = $text
[/autoit] [autoit][/autoit] [autoit]Return True
[/autoit] [autoit][/autoit] [autoit]
EndFunc; #FUNCTION# ;===============================================================================
[/autoit] [autoit][/autoit] [autoit]
;
; Name...........: _GUICtrlSAPIListBox_AddArray()
; Description ...: Adds an array of strings to the end of a SAPI ListBox control.
; Syntax.........: _GUICtrlSAPIListBox_AddString($SAPIListBox, $array)
; Parameters ....: $SAPIListBox - The control identifier (controlID) as returned by _GUICtrlSAPIListBox_Create.
; $array - A one-dimensional array containing a list of string to be added.
; Return values .: On Success - Returns True.
; On Failure - Returns False.
; Author ........: seangriffin
; Modified.......:
; Remarks .......:
; Related .......:
; Link ..........:
; Example .......: Yes
;
; ;==========================================================================================
Func _GUICtrlSAPIListBox_AddArray($SAPIListBox, $array)for $each in $array
[/autoit] [autoit][/autoit] [autoit]$SAPIListBox.AddItem ($each)
[/autoit] [autoit][/autoit] [autoit]
NextReturn True
[/autoit] [autoit][/autoit] [autoit]
EndFunc; #FUNCTION# ;===============================================================================
[/autoit] [autoit][/autoit] [autoit]
;
; Name...........: _GUICtrlSAPIListBox_GetCurSel()
; Description ...: Retrieve the index of the currently selected item.
; Syntax.........: _GUICtrlSAPIListBox_GetCurSel($SAPIListBox)
; Parameters ....: $SAPIListBox - The control identifier (controlID) as returned by _GUICtrlSAPIListBox_Create.
; Return values .: On Success - Returns a zero based index of the currently selected item.
; On Failure - Returns False.
; Author ........: seangriffin
; Modified.......:
; Remarks .......:
; Related .......:
; Link ..........:
; Example .......: Yes
;
; ;==========================================================================================
Func _GUICtrlSAPIListBox_GetCurSel($SAPIListBox)Return $SAPIListBox.ListIndex
[/autoit] [autoit][/autoit] [autoit]
EndFunc; #FUNCTION# ;===============================================================================
[/autoit] [autoit][/autoit] [autoit]
;
; Name...........: _GUICtrlSAPIListBox_GetCount()
; Description ...: Retrieves the number of items.
; Syntax.........: _GUICtrlSAPIListBox_GetCount($SAPIListBox)
; Parameters ....: $SAPIListBox - The control identifier (controlID) as returned by _GUICtrlSAPIListBox_Create.
; Return values .: On Success - Returns the number of items in the list box.
; On Failure - Returns False.
; Author ........: seangriffin
; Modified.......:
; Remarks .......:
; Related .......:
; Link ..........:
; Example .......: Yes
;
; ;==========================================================================================
Func _GUICtrlSAPIListBox_GetCount($SAPIListBox)Return $SAPIListBox.ListCount
[/autoit] [autoit][/autoit] [autoit]
EndFunc; #FUNCTION# ;===============================================================================
[/autoit] [autoit][/autoit] [autoit]
;
; Name...........: _GUICtrlSAPIListBox_GetText()
; Description ...: Returns the currently selected item (string), or the item (string) at the specified index
; Syntax.........: _GUICtrlSAPIListBox_GetText($SAPIListBox, $index = -1)
; Parameters ....: $SAPIListBox - The control identifier (controlID) as returned by _GUICtrlSAPIListBox_Create.
; $index - Specifies the zero-based index of the string to retrieve
; -1 (default) = return text for the currently selected item.
; Return values .: On Success - Returns the text of the index provided (current selection if -1).
; On Failure - Returns False.
; Author ........: seangriffin
; Modified.......:
; Remarks .......:
; Related .......:
; Link ..........:
; Example .......: Yes
;
; ;==========================================================================================
Func _GUICtrlSAPIListBox_GetText($SAPIListBox, $index = -1)if $index = -1 Then
[/autoit] [autoit][/autoit] [autoit]Return $SAPIListBox.text
[/autoit] [autoit][/autoit] [autoit]
ElseReturn $SAPIListBox.List($index)
[/autoit] [autoit][/autoit] [autoit]
EndIfReturn False
[/autoit] [autoit][/autoit] [autoit]
EndFunc; #FUNCTION# ;===============================================================================
[/autoit] [autoit][/autoit] [autoit]
;
; Name...........: _GUICtrlSAPIListBox_GetNewIndex()
; Description ...: Returns the index of the most recently added item.
; Syntax.........: _GUICtrlSAPIListBox_GetNewIndex($SAPIListBox)
; Parameters ....: $SAPIListBox - The control identifier (controlID) as returned by _GUICtrlSAPIListBox_Create.
; Return values .: On Success - Returns the index of the most recently added item.
; On Failure - Returns False.
; Author ........: seangriffin
; Modified.......:
; Remarks .......:
; Related .......:
; Link ..........:
; Example .......: Yes
;
; ;==========================================================================================
Func _GUICtrlSAPIListBox_GetNewIndex($SAPIListBox)Return $SAPIListBox.NewIndex
[/autoit] [autoit][/autoit] [autoit]
EndFunc; #FUNCTION# ;===============================================================================
[/autoit] [autoit][/autoit] [autoit]
;
; Name...........: _GUICtrlSAPIListBox_Refresh()
; Description ...: Forces a repaint of the listbox.
; Syntax.........: _GUICtrlSAPIListBox_Refresh($SAPIListBox)
; Parameters ....: $SAPIListBox - The control identifier (controlID) as returned by _GUICtrlSAPIListBox_Create.
; Return values .: On Success - Returns True.
; On Failure - Returns False.
; Author ........: seangriffin
; Modified.......:
; Remarks .......:
; Related .......:
; Link ..........:
; Example .......: Yes
;
; ;==========================================================================================
Func _GUICtrlSAPIListBox_Refresh($SAPIListBox)Return $SAPIListBox.Refresh()
[/autoit] [autoit][/autoit] [autoit]
EndFunc; #FUNCTION# ;===============================================================================
[/autoit] [autoit][/autoit] [autoit]
;
; Name...........: _GUICtrlSAPIListBox_ResetContent()
; Description ...: Removes all items from the SAPI list box
; Syntax.........: _GUICtrlSAPIListBox_ResetContent($SAPIListBox)
; Parameters ....: $SAPIListBox - The control identifier (controlID) as returned by _GUICtrlSAPIListBox_Create.
; Return values .: On Success - Returns True.
; On Failure - Returns False.
; Author ........: seangriffin
; Modified.......:
; Remarks .......:
; Related .......:
; Link ..........:
; Example .......: Yes
;
; ;==========================================================================================
Func _GUICtrlSAPIListBox_ResetContent($SAPIListBox)$SAPIListBox.Clear()
[/autoit] [autoit][/autoit] [autoit]Return False
[/autoit] [autoit][/autoit] [autoit]
EndFunc; #FUNCTION# ;===============================================================================
[/autoit] [autoit][/autoit] [autoit]
;
; Name...........: _GUICtrlSAPIListBox_CurSelChanged()
; Description ...: Returns an indication as to whether the current selection in the listbox has changed (since the last time function was run).
; Syntax.........: _GUICtrlSAPIListBox_CurSelChanged($SAPIListBox)
; Parameters ....: $SAPIListBox - The control identifier (controlID) as returned by _GUICtrlSAPIListBox_Create.
; Return values .: On Success - Returns a zero based index of the currently selected item.
; On Failure - Returns False.
; Author ........: seangriffin
; Modified.......:
; Remarks .......: I didn't want to write this function, but I currently don't know of any other
; way in AutoIT to detect if a SAPIlistbox has changed. Traditional methods,
; such as using a "WM_COMMAND" function or a "if $msg = $SAPIListBox then"
; check in the main message loop of the GUI, don't get triggered.
; Related .......:
; Link ..........:
; Example .......: Yes
;
; ;==========================================================================================
Func _GUICtrlSAPIListBox_CurSelChanged($SAPIListBox)if $curr_speech_list_index <> $SAPIListBox.ListIndex() Then
[/autoit] [autoit][/autoit] [autoit]$curr_speech_list_index = $SAPIListBox.ListIndex()
[/autoit] [autoit][/autoit] [autoit]
Return True
EndIfReturn False
[/autoit] [autoit][/autoit] [autoit]
EndFunc; #FUNCTION# ;===============================================================================
[/autoit] [autoit][/autoit] [autoit]
;
; Name...........: _SAPI_SpeechProperties()
; Description ...: Opens the SAPI Speech Properties control panel applet.
; Syntax.........: SAPI_SpeechProperties()
; Parameters ....:
; Return values .: On Success - Returns True.
; On Failure - Returns False.
; Author ........: seangriffin
; Modified.......:
; Remarks .......:
; Related .......:
; Link ..........:
; Example .......: Yes
;
; ;==========================================================================================
Func _SAPI_SpeechProperties()Run("cmd.exe /c control.exe """ & @CommonFilesDir & "\Microsoft Shared\Speech\sapi.cpl""", @SystemDir, @SW_HIDE)
[/autoit] [autoit][/autoit] [autoit]Return True
[/autoit] [autoit][/autoit] [autoit][/autoit]
EndFunc
Ansonsten ist Microsoft Speech SDK minimum 5.1 nötig(das Activex-Objekt muss auf dem >Rechner registriert sein!)
Downloadlink: http://www.microsoft.com/downloads/info.aspx?na=46&SrcFamilyId=5E86EC97-40A7-453F-B0EE-6583171B4530&SrcDisplayLang=en&u=http%3a%2f%2fdownload.microsoft.com%2fdownload%2fB%2f4%2f3%2fB4314928-7B71-4336-9DE7-6FA4CF00B7B3%2fSpeechSDK51.exe -
@Matthias es fast schon süß das gerade sowas von dir kommt!
Ich finds viel amüsanter, dass die besagte Person unter dem nicknamen EliteMatthias ganze sections im nem gewissen forum unterhalten hat... -
n kumpel von mir hat gemeint dass das online nicht funktioniert

Naja, bei manchen Leuten funktioniert das fast nicht
BB, you know what I mean?^^ -
also das mit dem explorerfenster stimmt
danke schonmal, ich schau mir den beitrag in dem forum mal an.
Edit:
Sehr schön!
Einfach bei dem Key Userinit den Pfad zu der Exe eingeben und den Wert vom Shellkey bei explorer.exe lassen.
Funktioniert einwandfrei! -
vielleicht dircopy in kombination mit if @error ?
kanns grad nicht testen -
Hallo,
[autoit]
ich möchte, dass mein Programm gestartet wird, bevor explorer.exe auftaucht. also direkt nach dem systemstart.
dazu hab ich in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon den Wert von Shell auf meinen Programmnamen bzw. Pfad geändert.
Das Programm wird auch gleich beim Systemstart ausgeführt.
Exemplarisch so etwas:Msgbox(0, "Hallo", "Hallo"& @username)
[/autoit]
Shellexecute("explorer.exe")
Beim Blick in den Taskmanager existiert der Prozess explorer.exe dann auch. Nur leider ist keine Taskleiste zu sehen, Desktopsymbole werden auch nicht dargestellt.
...Das Skript is mit 32 Bit kompiliert, passt also ....
Was sollte man ändern, damit alles klappt? -
die guictrl-frage war aber auch doof...
-
Hier eine weitere Möglichkeit, ohne Skalierung
[autoit]
#include <ButtonConstants.au3>
[/autoit]
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include<gdiplus.au3>
Global Const $SS_REALSIZEIMAGE = 0x0800
$viewer = GUICreate("viewer", 633, 447, 0, 0)
$Button1 = GUICtrlCreateButton("Button1", 0, 420, 192, 24, $WS_GROUP)
GUISetState(@SW_SHOW)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
case $Button1
$path= FileOpenDialog("Wählen Sie ein Bild.", @DesktopDir & "\", "(*.jpg;*.png)")
$Pic1 = GUICtrlCreatePic($path, 0,0, 0, 0, $SS_REALSIZEIMAGE)
_gdiplus_startup()
$Imagegdi = _GDIPlus_ImageLoadFromFile($Path)
$Width = _GDIPlus_ImageGetWidth($Imagegdi)
$Height = _GDIPlus_ImageGetHeight($Imagegdi)
winmove("viewer", "", "", "", $width, $height+50)
guictrldelete($button1)
$button1= guictrlcreatebutton("Bild hinzufügen", 0, $height, 100, 20)
EndSwitch
WEnd -
kleine frage, was sollen das für passwörter sein

-
Das wären dann wohl meine

-
Ein einzelnes Control transparent zu machen, geht ohne weiteres glaub ich nicht. Allerdings kannst via winsettrans die ganze gui transparent machen...
Edit: wieder mal wurde ich verbessert^^ -
Hallo zusammen.
Heute gibts en 5-Minutenskript, auf Verwendung besonderer Switch-Abfragen oder großartiger Arrays hab ich verzichtet..
Wer Tv Total kennt, wird lachen. Jeder andere wahrscheinlich auch^^
-> Die sounds werden mit den Tasten 1-7 abgespielt..Spoiler anzeigen
[autoit]#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
[/autoit]
#AutoIt3Wrapper_outfile=Nippelboard.exe
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#include <GUIConstants.au3>
#include <GDIPlus.au3>
#include <WinAPI.au3>
#include <Misc.au3>
Local $brush[4]
local $1, $2, $3, $4, $5, $6, $7=0
$vUser32DLL = DllOpen("User32.dll")
$iGUIWidth = @DesktopWidth
$iGUIHeight = @DesktopHeight
$tSize = DllStructCreate($tagSIZE)
$pSize = DllStructGetPtr($tSize)
DllStructSetData($tSize, "X", $iGUIWidth)
DllStructSetData($tSize, "Y", $iGUIHeight)
$tSource = DllStructCreate($tagPOINT)
$pSource = DllStructGetPtr($tSource)
$tBlend = DllStructCreate($tagBLENDFUNCTION)
$pBlend = DllStructGetPtr($tBlend)
DllStructSetData($tBlend, "Alpha", 255)
DllStructSetData($tBlend, "Format", 1)
$hWnd = GUICreate("", $iGUIWidth, $iGUIHeight, 0, 0, BitOR(0x80000000, 0x08000000), BitOR(0x00080000, 0x00000008, 0x00000080))
GUISetState()
$hDC_Window = _WinAPI_GetDC($hWnd)
$hDC_Buffer = _WinAPI_CreateCompatibleDC($hDC_Window)
$hBitmap_Buffer = _WinAPI_CreateCompatibleBitmap($hDC_Window, $iGUIWidth, $iGUIHeight)
_WinAPI_SelectObject($hDC_Buffer, $hBitmap_Buffer)
_GDIPlus_Startup()
$hGraphics = _GDIPlus_GraphicsCreateFromHDC($hDC_Buffer)
$brush[0] = _GDIPlus_BrushCreateSolid(0xFFFFFF00)
$brush[1] = _GDIPlus_BrushCreateSolid(0xFFFF0000)
$brush[3]= _gdiplus_brushcreatesolid(0xFF000000)
while 1
for $i= 0 to 600 step 100
_GDIPlus_GraphicsFillEllipse($hgraphics, $i, 0, 60, 60, $brush[1])
next
_GDIPlus_GraphicsFillEllipse($hgraphics, 15, 15, 30, 30, $brush[$1])
_GDIPlus_GraphicsFillEllipse($hgraphics, 115, 15, 30, 30, $brush[$2])
_GDIPlus_GraphicsFillEllipse($hgraphics, 215, 15, 30, 30, $brush[$3])
_GDIPlus_GraphicsFillEllipse($hgraphics, 315, 15, 30, 30, $brush[$4])
_GDIPlus_GraphicsFillEllipse($hgraphics, 415, 15, 30, 30, $brush[$5])
_GDIPlus_GraphicsFillEllipse($hgraphics, 515, 15, 30, 30, $brush[$6])
_GDIPlus_GraphicsFillEllipse($hgraphics, 615, 15, 30, 30, $brush[$7])
If _ispressed(31, $vuser32dll) then
$1= 3
Soundplay(@scriptdir&"\Das geht doch nicht.wma")
else
$1=0
EndIf
If _ispressed(32, $vuser32dll) then
$2= 3
Soundplay(@scriptdir&"\Der Hodensack.wma")
else
$2=0
EndIf
If _ispressed(33, $vuser32dll) then
$3= 3
Soundplay(@scriptdir&"\Der Döner.wma")
else
$3=0
EndIf
If _ispressed(34, $vuser32dll) then
$4= 3
Soundplay(@scriptdir&"\Spaß.wma")
else
$4=0
EndIf
If _ispressed(35, $vuser32dll) then
$5= 3
Soundplay(@scriptdir&"\Eier.wma")
else
$5=0
EndIf
If _ispressed(36, $vuser32dll) then
$6= 3
Soundplay(@scriptdir&"\Definitiv nein.wma")
else
$6=0
EndIf
If _ispressed(37, $vuser32dll) then
$7= 3
Soundplay(@scriptdir&"\Viele Namen.wma")
else
$7=0
EndIf
_WinAPI_UpdateLayeredWindow($hWnd, $hDC_Window, 0, $pSize, $hDC_Buffer, $pSource, 0, $pBlend, 2)
wend
Der Download mit den notwendigen Sounds ist im Anhang hinzugefügt -
Also das hat jetzt aber mal Spaß gemacht^^
Hab alles rausbekommen, nur die Guictrl... frage war bisschen stange... -
1. Dann wird die Testzeit aber vorerst nochmals wiederholt^^
2. Während der Testzeit kann der User nix machen, da sich das Skript in dieser Schleife befindet.
-> also in die Hauptschleife der GUI reinziehn... -
die keys und die dazugehörigen dateien auf der festplatte...
-
ziemlich naheliegend:
[autoit]dirremove
[/autoit] -
Für langfristige Trials wären Inis oder Registryeinträge zu empfehln..
-
Naja, einen unifarbenen Hintergrund erstellst ja mit
[autoit]GUISetBkColor(0xFFFFFF)
[/autoit]Mit dem Colorpicker bekommst die RGB-Farbtöne.
[autoit]
Ein richtiges Hintergrundbild kriegst mitGuictrlcreatepic(..)
[/autoit]hin
-
was genau meinst mit background? ein hintergrundbild?