Tutorial
@Bei falscher Sektion ..sry
Auto IT V3
Was es ist : _Date_Time_FileTimeToLocalFileTime
Was es ist : _GUICtrlComboBoxEx_GetItem
Was es ist : counter with msgbox(e)
Was es ist : Tooltip (oben)
Was es ist : BMPToJPG /BMP Datei in JPG Datei (Bild)
Was es macht : encrypt/decrypt
Hilfe (von) : AutoIt
Das wars erstmal für AutoIt
Weiter geht´s mit Visual Basic..
Visual Basic
Was es macht : Progressbar ohne Timer laden lassen
Was es macht : Internet(URL)-seiten ,Programme(exe) oder Dateipfad öffnen
Was es macht : Wenn Textbox1 .text richtig geschrieben ist Label´s Text ändern (automatisch)
-> Quelltext für Automatisch bei / in Textbox eingeben (Quelltext Textbox)
Was es macht : Linklabel1´s text = Webbrowsers URL..(Seite)
Das gleiche nochmal mit Form .text
Was es macht : Eine Internetseite (im Webbrowser) anzeigen ..(sofort hinführen)
Was es macht : WebBrowser soll zur Startseite (z.B Google)
Nun eine Seite zurück
Eine Seite vor
Was es macht : Textbox´s text(z.B [Only registered and activated users can see links. Click Here To Register...]) suchen und beim WebBrowser anzeigen
Was es macht : Quelltext einer Seite zeigen (im Msgbox)
Was es macht : Ausgewählte Dateipfad in der Textbox anzeigen
Ich glaub die Code´s die nun kommen weiss jeder^^
Textbox1 text in Listbox´s Items einfügen
Listbox´s Items leeren
Textbox´s leeren
Programm beenden xDD
oder einzelnde Forme schließen
oder ...
Label5 soll die Items von Listbox zählen
Label7 soll Datum (mit Zeit) zeigen
Form Farbe ändern
oder
oder
oder mehrere ..
Einfach wo Color.OrangeRed steht ändern in z.B
Color.Blue
Nächste Form öffnen
Msgbox zeigen
Msgbox zeigen + Style
Msgbox zeigen + Style + Msgbox Name
Windows Status (Minimiert)
Windows Status (Normal)
Windows Status (Maximal)
Checkbox´s Farbe ändern
Das müssen nicht alle können xDDD :
Task Manager (in Programm)
Prozess beenden
Passwort eingeben..
Ist es aber 3 mal falsch dann Programm beenden ;D
WARNUNG :
Das funktioniert NICHT immer
Standby (Bildschirm = aus)
CMD
Passwort ändern (ohne den alten zu wissen)
Das * muss dabei sein!
Hilfe
Mehr ..
@Release...
Next :
Mehr über AutoIt
@Edit
Sorry hab viele Rechtschreib-und Grammatikfehler
Schnell gemacht^^
Für Hilfe ,Fehler (QuellText/Code (s)) korregieren /bescheid sagen..
Viel Spaß!
@Bei falscher Sektion ..sry
Auto IT V3
Was es ist : _Date_Time_FileTimeToLocalFileTime
Code:
#include <GuiConstantsEx.au3>
#include <Date.au3>
#include <WindowsConstants.au3>
Global $iMemo
_Main()
Func _Main()
Local $hGUI, $tFile, $tLocal
; Create GUI
$hGUI = GUICreate("Time", 400, 300)
$iMemo = GUICtrlCreateEdit("", 2, 2, 396, 296, $WS_VSCROLL)
GUICtrlSetFont($iMemo, 9, 400, 0, "Courier New")
GUISetState()
; Get system time
$tSystem = _Date_Time_GetSystemTime()
$tFile = _Date_Time_SystemTimeToFileTime(DllStructGetPtr($tSystem))
; --------------------------------------
$tLocal = _Date_Time_FileTimeToLocalFileTime(DllStructGetPtr($tFile))
MemoWrite("Local file time .: " & _Date_Time_FileTimeToStr($tLocal))
; Loop until user exits
Do
Until GUIGetMsg() = $GUI_EVENT_CLOSE
EndFunc ;==>_Main
; Write a line to the memo control
Func MemoWrite($sMessage)
GUICtrlSetData($iMemo, $sMessage & @CRLF, 1)
EndFunc ;==>MemoWrite
Was es ist : _GUICtrlComboBoxEx_GetItem
Code:
#include <GuiComboBoxEx.au3>
#include <GuiImageList.au3>
#include <GuiConstantsEx.au3>
Opt('MustDeclareVars', 1)
$Debug_CB = False ; Check ClassName being passed to ComboBox/ComboBoxEx functions, set to True and use a handle to another control to see it work
Global $iMemo
_Main()
Func _Main()
Local $hGUI, $hImage, $aItem, $hCombo
; Create GUI
$hGUI = GUICreate("ComboBoxEx Get Item", 400, 300)
$hCombo = _GUICtrlComboBoxEx_Create ($hGUI, "", 2, 2, 394, 100)
$iMemo = GUICtrlCreateEdit("", 2, 32, 396, 266, 0)
GUICtrlSetFont($iMemo, 9, 400, 0, "Courier New")
GUISetState()
$hImage = _GUIImageList_Create (16, 16, 5, 3)
_GUIImageList_AddIcon ($hImage, @SystemDir & "\shell32.dll", 110)
_GUIImageList_AddIcon ($hImage, @SystemDir & "\shell32.dll", 131)
_GUIImageList_AddIcon ($hImage, @SystemDir & "\shell32.dll", 165)
_GUIImageList_AddIcon ($hImage, @SystemDir & "\shell32.dll", 168)
_GUIImageList_AddIcon ($hImage, @SystemDir & "\shell32.dll", 137)
_GUIImageList_AddIcon ($hImage, @SystemDir & "\shell32.dll", 146)
_GUIImageList_Add ($hImage, _GUICtrlComboBoxEx_CreateSolidBitMap ($hCombo, 0xFF0000, 16, 16))
_GUIImageList_Add ($hImage, _GUICtrlComboBoxEx_CreateSolidBitMap ($hCombo, 0x00FF00, 16, 16))
_GUIImageList_Add ($hImage, _GUICtrlComboBoxEx_CreateSolidBitMap ($hCombo, 0x0000FF, 16, 16))
_GUICtrlComboBoxEx_SetImageList ($hCombo, $hImage)
For $x = 0 To 8
_GUICtrlComboBoxEx_AddString ($hCombo, StringFormat("%03d : Random string", Random(1, 100, 1)), $x, $x)
Next
;Set Item indent
_GUICtrlComboBoxEx_SetItemIndent ($hCombo, 1, 1)
$aItem = _GUICtrlComboBoxEx_GetItem ($hCombo, 1)
MemoWrite("Item Text : " & $aItem[0])
MemoWrite("Item Len ..........................: " & $aItem[1])
MemoWrite("# image widths to indent ..........: " & $aItem[2])
MemoWrite("Zero based item image index .......: " & $aItem[3])
MemoWrite("Zero based item state image index .: " & $aItem[4])
MemoWrite("Zero based item image overlay index: " & $aItem[5])
MemoWrite("Item application defined value ....: " & $aItem[6])
Do
Until GUIGetMsg() = $GUI_EVENT_CLOSE
EndFunc ;==>_Main
; Write a line to the memo control
Func MemoWrite($sMessage)
GUICtrlSetData($iMemo, $sMessage & @CRLF, 1)
EndFunc ;==>MemoWrite
Code:
; ; AutoIt Version: 3.0 ; Language: English ; Platform: Win9x/NT ; Author: Jonathan Bennett (jon at hiddensoft com) ; ; Script Function: ; Counts to 5 using a "for" loop ; Prompt the user to run the script - use a Yes/No prompt (4 - see help file) $answer = MsgBox(4, "AutoIt Example", "This script will count to 5 using a 'For' loop. Run?") ; Check the user's answer to the prompt (see the help file for MsgBox return values) ; If "No" was clicked (7) then exit the script If $answer = 7 Then MsgBox(0, "AutoIt Example", "OK. Bye!") Exit EndIf ; Execute the loop 5 times For $count = 1 To 5 ; Print the count MsgBox(0, "AutoIt Example", "Count is: " & $count) Next ; Finished! MsgBox(0, "AutoIt Example", "Finished!")
Code:
; AutoIt 3.1.1.x beta version
;
; COM Test file
;
; Test usage of AutoItX from within AutoItCOM
$oAutoIt = ObjCreate("AutoItX3.Control")
if @error then
Msgbox(0,"AutoItX Test","Failed to open AutoItX. Error code: " & hex(@error,8))
exit
endif
$oAutoIt.ClipPut("I am copied to the clipboard")
$text = $oAutoIt.ClipGet()
Msgbox(0,"Clipboard test","Clipboard contains: " & $text)
; This will create a tooltip in the upper left of the screen
Msgbox(0,"Tooltip test","Press OK to create a tooltip in the upper left corner.")
$oAutoIt.ToolTip("This is a tooltip", 0, 0)
$oAutoIt.Sleep(1000) ; Sleep to give tooltip time to display
$var = $oAutoIt.RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion", "ProgramFilesDir")
Msgbox(0,"RegRead Test","Program files are in:" & $var)
Was es ist : BMPToJPG /BMP Datei in JPG Datei (Bild)
Code:
#include <GDIPlus.au3>
Opt("MustDeclareVars", 1)
; ===============================================================================================================================
; Description ...: Shows how to convert a BMP file to JPG
; Author ........: Paul Campbell (PaulIA)
; Notes .........:
; ===============================================================================================================================
; ===============================================================================================================================
; Global variables
; ===============================================================================================================================
Global $sImage, $hImage, $sCLSID
; Get BMP file to convert
$sImage = InputBox("BMP to JPG", "Enter File Name:", @MyDocumentsDir & "\Image.bmp", "", 200, 130)
if @Error or not FileExists($sImage) then Exit
; Initialize GDI+ library
_GDIPlus_StartUp()
; Load image
$hImage = _GDIPlus_ImageLoadFromFile($sImage)
; Get JPG encoder CLSID
$sCLSID = _GDIPlus_EncodersGetCLSID("JPG")
; Save image as JPG
_GDIPlus_ImageSaveToFileEx($hImage, @MyDocumentsDir & "\AutoItImage.jpg", $sCLSID)
; Shut down GDI+ library
_GDIPlus_ShutDown()
Hilfe (von) : AutoIt
Code:
;====================================================
;============= Encryption Tool With GUI =============
;====================================================
; AutoIt version: 3.0.103
; Language: English
; Author: "Wolvereness"
;
; ----------------------------------------------------------------------------
; Script Start
; ----------------------------------------------------------------------------
#include <GUIConstantsEx.au3>
#include <String.au3>
;#include files for encryption and GUI constants
Opt('MustDeclareVars', 1)
_Main()
Func _Main()
Local $WinMain, $EditText, $InputLevel, $InputPass, $UpDownLevel
Local $EncryptButton, $DecryptButton, $string
#forceref $UpDownLevel
;~~
$WinMain = GUICreate('Encryption tool', 400, 400)
; Creates window
;~~
$EditText = GUICtrlCreateEdit('', 5, 5, 380, 350)
; Creates main edit
;~~
$InputPass = GUICtrlCreateInput('', 5, 360, 100, 20, 0x21)
; Creates the password box with blured/centered input
;~~
$InputLevel = GUICtrlCreateInput(1, 110, 360, 50, 20, 0x2001)
$UpDownLevel = GUICtrlSetLimit(GUICtrlCreateUpdown($InputLevel), 10, 1)
; These two make the level input with the Up|Down ability
;~~
$EncryptButton = GUICtrlCreateButton('Encrypt', 170, 360, 105, 35)
$DecryptButton = GUICtrlCreateButton('Decrypt', 285, 360, 105, 35)
; Encryption/Decryption buttons
;~~
GUICtrlCreateLabel('Password', 5, 385)
GUICtrlCreateLabel('Level', 110, 385)
; Simple text labels so you know what is what
;~~
GUISetState()
; Shows window
;~~
While 1
Switch GUIGetMsg()
Case $GUI_EVENT_CLOSE
ExitLoop
Case $EncryptButton
; When you press Encrypt
;~~
GUISetState(@SW_DISABLE, $WinMain)
; Stops you from changing anything
;~~
$string = GUICtrlRead($EditText)
; Saves the editbox for later
;~~
GUICtrlSetData($EditText, 'Please wait while the text is Encrypted/Decrypted.')
; Friendly message
;~~
GUICtrlSetData($EditText, _StringEncrypt(1, $string, GUICtrlRead($InputPass), GUICtrlRead($InputLevel)))
; Calls the encryption. Sets the data of editbox with the encrypted string
;~~
GUISetState(@SW_ENABLE, $WinMain)
; This turns the window back on
;~~
Case $DecryptButton
; When you press Decrypt
;~~
GUISetState(@SW_DISABLE, $WinMain)
; Stops you from changing anything
;~~
$string = GUICtrlRead($EditText)
; Saves the editbox for later
;~~
GUICtrlSetData($EditText, 'Please wait while the text is Encrypted/Decrypted.')
; Friendly message
;~~
GUICtrlSetData($EditText, _StringEncrypt(0, $string, GUICtrlRead($InputPass), GUICtrlRead($InputLevel)))
; Calls the encryption. Sets the data of editbox with the encrypted string
;~~
GUISetState(@SW_ENABLE, $WinMain)
; This turns the window back on
;~~
EndSwitch
WEnd
EndFunc ;==>_Main
Weiter geht´s mit Visual Basic..
Visual Basic
Was es macht : Progressbar ohne Timer laden lassen
Code:
For i As Integer = 1 To 100
ProgressBar1.Value += 1
System.Threading.Thread.Sleep(250)
If ProgressBar1.Value = 100 Then
MsgBox("Download abgeschlossen", MsgBoxStyle.Exclamation, "Info")
ProgressBar1.Value = 0
End If
Next
Code:
Dim x As New Process
x.StartInfo.FileName = (TextBox1.Text)
Try
x.Start()
Catch ex As Exception
MsgBox(ex.Message, MsgBoxStyle.Critical, "Error")
End Try
-> Quelltext für Automatisch bei / in Textbox eingeben (Quelltext Textbox)
Code:
If TextBox1.Text = ("Elitepvpers*Coders") Then
Label2.Text = ("Benutzername ist richtig..")
Else
Label2.Text = ("Der Benutzername ist falsch..")
End If
Code:
LinkLabel1.Text = WebBrowser1.DocumentTitle
Code:
Me.Text = WebBrowser1.DocumentTitle
Code:
WebBrowser1.Navigate("www.youtube.com")
Code:
WebBrowser1.GoHome()
Code:
WebBrowser1.GoBack
Code:
WebBrowser1.GoForward()
Code:
WebBrowser1.Navigate(TextBox1.Text)
Code:
MsgBox(WebBrowser1.DocumentText)
Was es macht : Ausgewählte Dateipfad in der Textbox anzeigen
Code:
Using Fb As New FolderBrowserDialog
With Fb
If .ShowDialog() = Windows.Forms.DialogResult.OK Then
TextBox1.Text = .SelectedPath
End If
End With
End Using
Ich glaub die Code´s die nun kommen weiss jeder^^
Textbox1 text in Listbox´s Items einfügen
Code:
ListBox1.Items.Add(TextBox1.Text)
Code:
ListBox1.Items.Clear()
Code:
TextBox1.Clear()
Code:
End
Code:
Close
Code:
Me.Close
Code:
Label5.Text = ListBox1.Items.Count
Code:
Label7.Text = DateTimePicker1.Value
Code:
Me.BackColor = Color.Yellow
Code:
Me.BackColor = Color.BlueViolet
Code:
Me.BackColor = Color.OrangeRed
Einfach wo Color.OrangeRed steht ändern in z.B
Color.Blue
Nächste Form öffnen
Code:
Form2.show()
Code:
Msgbox("Halluu")
Code:
MsgBox("Hallu", MsgBoxStyle.Exclamation)
Code:
MsgBox("Hallu", MsgBoxStyle.Exclamation, "Hallu??")
Code:
Me.WindowState = FormWindowState.Minimized
Code:
Me.WindowState = FormWindowState.Normal
Code:
Me.WindowState = FormWindowState.Maximized
Code:
CheckBox1.ForeColor = Color.Black
Task Manager (in Programm)
Code:
' Liste aller Prozesse ermitteln
Private Sub Button1_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles Button1.Click
Dim oItem As ListViewItem
With ListView1
' ListView-Inhalt löschen
.Items.Clear()
' alle Prozesse durchlaufen
For Each oProcess As Process In Process.GetProcesses
' Prozess-Infos ermitteln und im ListView anzeigen
oItem = .Items.Add(oProcess.ProcessName)
Try
oItem.SubItems.Add(oProcess.MainModule.FileName)
Catch
oItem.SubItems.Add("")
End Try
oItem.SubItems.Add(oProcess.Id.ToString)
Next
End With
Button1.Text = "Aktuallisieren"
End Sub
Code:
' Prozess beenden
Private Sub Button8_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles Button6.Click
With ListView1
If .SelectedItems.Count > 0 Then
If MsgBox("Aktuellen Prozess wirklich beenden?", _
MsgBoxStyle.Question Or MsgBoxStyle.YesNo) = MsgBoxResult.Yes Then
' Prozess-Objekt anhand Prozess-ID erstellen
Dim oProccess As Process = Process.GetProcessById( _
Val(.SelectedItems(0).SubItems(2).Text))
Try
' Prozess beenden/zerstören
oProccess.Kill()
Catch ex As Exception
' Fehlermeldung...
MsgBox("Fehler beim Beenden des Prozess." & vbCrLf & ex.Message.ToString, MsgBoxStyle.Critical)
End Try
End If
End If
End With
Dim oItem As ListViewItem
With ListView1
' ListView-Inhalt löschen
.Items.Clear()
' alle Prozesse durchlaufen
For Each oProcess As Process In Process.GetProcesses
' Prozess-Infos ermitteln und im ListView anzeigen
oItem = .Items.Add(oProcess.ProcessName)
Try
oItem.SubItems.Add(oProcess.MainModule.FileName)
Catch
oItem.SubItems.Add("")
End Try
oItem.SubItems.Add(oProcess.Id.ToString)
Next
End With
Button1.Text = "Aktuallisieren"
Passwort eingeben..
Ist es aber 3 mal falsch dann Programm beenden ;D
Code:
Private x As Integer
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
If TextBox1.Text = "55122" Then
MsgBox("Richtiges Passwort", MsgBoxStyle.Information, "Richtiges Passwort")
MsgBox("Willkommen :D!", MsgBoxStyle.Information, "Viel Spaß!")
Form9.Show()
Else
MsgBox("Falsches Passwort", MsgBoxStyle.Critical, "Falsches Passwort!")
MsgBox("Falsches Passwort!", MsgBoxStyle.Exclamation, "Falsches Passwort!")
MsgBox("Nur noch ..Versuche", MsgBoxStyle.Critical, "Fehler")
x += 1
If x = 3 Then
End
End If
End If
WARNUNG :
Das funktioniert NICHT immer
Standby (Bildschirm = aus)
Code:
#Region "StandBy"
' Timer-Objekt für das Einschalten des Monitors
Dim WithEvents oTimer As Timer
''' <summary>
''' Klasse für Zugriff auf API-Funktion "SendMessage"
''' </summary>
Public Class Monitor
''' <summary>
''' DLL-Deklaration der SendMessage-API
''' </summary>
<DllImport("user32.dll", EntryPoint:="SendMessageA")> _
Private Shared Sub SendMessage( _
ByVal hWnd As IntPtr, _
ByVal uMsg As Int32, _
ByVal wParam As Int32, _
ByVal lParam As Int32)
End Sub
''' <summary>
''' Benötigte Konstanten für die SendMessage API-Funktion
''' </summary>
Private Enum Params As Int32
SC_MONITORPOWER = &HF170 ' wParam
WM_SYSCOMMAND = &H112 ' uMsg
TURN_MONITOR_OFF = 2 ' Monitor ausschalten
TURN_MONITOR_ON = -1 ' Monitor einschalten
End Enum
''' <summary>
''' Schaltet den Monitor entweder ein- oder aus
''' </summary>
''' <param name="Index">off = ausschalten / on = einschalten</param>
''' <param name="Handle">Handle der aufrufenden Anwendung</param>
Public Shared Sub SetMonitorState(ByVal Index As String, ByVal Handle As IntPtr)
Select Case Index
Case "off"
' Schaltet den Monitor aus
SendMessage(Handle, Params.WM_SYSCOMMAND, Params.SC_MONITORPOWER, _
Params.TURN_MONITOR_OFF)
Case "on"
' Schaltet den Monitor wieder ein
SendMessage(Handle, Params.WM_SYSCOMMAND, Params.SC_MONITORPOWER, _
Params.TURN_MONITOR_ON)
End Select
End Sub
End Class
#End Region
Code:
Monitor.SetMonitorState("off", Me.Handle)
CMD
Passwort ändern (ohne den alten zu wissen)
Code:
net user
Code:
net user EUER BENUTZER *
Hilfe
Code:
help
Code:
net
@Release...
Next :
Mehr über AutoIt
@Edit
Sorry hab viele Rechtschreib-und Grammatikfehler
Schnell gemacht^^
Für Hilfe ,Fehler (QuellText/Code (s)) korregieren /bescheid sagen..
Viel Spaß!