AutoIt
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
;#include <Browser.au3>
If $CmdLine[0] <> "3" Then
MsgBox(16, "Fehler", "Inkorrekter Programmaufruf")
Exit
EndIf
$Username = $CmdLine[1]
$password = $CmdLine[2]
$contactname = $CmdLine[3]
$status = "offline"
$name = "Vorname Nachname"
#Region ### START Koda GUI section ### Form=Forms\singlechat.kxf
$Form1 = GUICreate("Olfibits WebChat - Einzelchat", 362, 524, 192, 124)
$Label1 = GUICtrlCreateLabel($name, 40, 5, 312, 17)
$Icon1 = GUICtrlCreateIcon("Images\singleuser.ico", -1, 2, 2, 32, 32)
$Label2 = GUICtrlCreateLabel($status, 40, 20, 88, 17)
$Text = GUICtrlCreateEdit("", 0, 424, 321, 89)
$Send = GUICtrlCreateButton("S"&@CRLF&"E"&@CRLF&"N"&@CRLF&"D"&@CRLF&"E"&@CRLF&"N", 320, 424, 40, 89, $BS_MULTILINE)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
#include <Inet.au3>
; #FUNCTION# ====================================================================================================================
; Name ..........: _Browser
; Description ...: Creates a ActiveX object to show the chat history
; Syntax ........: _Browser($mode, $requestString)
; Parameters ....: $mode - String: group | single
; $requestString - PHP-Request-String:
; -> group: username, password, groupname
; -> single: username, password, name
; Return values .: url
; Author ........: Florian
; Modified ......: 13/05/2017
; Remarks .......:
; Related .......:
; Link ..........:
; Example .......: $Browser = _Browser("group", "user=" & $username & "&password=" & $password & "&groupname=" & $groupname)
; ===============================================================================================================================;browser.au3
Func _Browser($mode, $requestString)
$url = "http://localhost/chat_2.0/"
If $mode = "group" Then
$file = $url & "chat.groupchat.php?" & $RequestString
$obj = ObjCreate("shell.Explorer.2")
Global $object = GUICtrlCreateObj($obj, 0, 40, 360, 360)
$obj.navigate($file)
ElseIf $mode = "single" Then
$file = $url & "chat.singlechat.php?" & $RequestString
$obj = ObjCreate("shell.Explorer.2")
Global $object = GUICtrlCreateObj($obj, 0, 40, 360, 360)
$obj.navigate($file)
EndIf
Dim $Return[3]
$Return[1] = $obj
$Return[2] = $file
Return $Return
EndFunc
Func _Refresh($Arr)
$Arr[1].navigate($Arr[2])
EndFunc
; #FUNCTION# ====================================================================================================================
; Name ..........: _Write
; Description ...: Writes a text message to a specified user/group
; Syntax ........: _Write($mode, $name, $text)
; Parameters ....: $mode - String: group | single
; $name - String: the group-name or user-name
; $text - Text message to write
; Return values .: int $error [0 = SUCCESS | 1 = INPUT_ERROR | 2 = INTERNAL_ERROR]
; Author ........: Florian
; Modified ......: 13/05/2017
; Remarks .......:
; Related .......:
; Link ..........:
; Example .......: $Write = _Write("single", "olfibits", "Servus, das ist ein Test! :-)")
; ===============================================================================================================================
Func _Write($mode, $name, $text)
$req = "username="&$Username
$req &= "&password="&$password
$req &= "&name="&$contactname
$req &= "&text="&$text
$url = "http://localhost/chat_2.0/"
If $mode = "group" Then
$file = $url & "chat.writegroupchat.php?" & $req
MsgBox(0, "", $file)
_INetGetSource($file)
ElseIf $mode = "single" Then
$file = $url & "chat.writesinglechat.php?" & $req
MsgBox(0, "", $file)
_INetGetSource($file)
Else
Return 1
EndIf
If @error Then
Return 2
EndIf
EndFunc
$req = "username="&$Username
$req &= "&password="&$password
$req &= "&name="&$contactname
$Browser = _Browser("single", $req)
Func _Refresh_()
_Refresh($Browser)
EndFunc
;AdlibRegister("_Refresh_", 2000)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Object
MsgBox(64, "", "h") ; das ist ein Test
Case $Send
$Txt = GUICtrlRead($Text)
If $Txt <> "" Then
_Write("single", $contactname, $Txt)
Else
MsgBox(16, "Fehler", "Leerer Text")
EndIf
EndSwitch
WEnd
Alles anzeigen
Sorry, so siehts aus.
Würde gerne wissen wie ich das $Object anspreche.