Jump to content

PLZ help with tree view


emoyasha
 Share

Recommended Posts

Hello,

Basically i need help making my tree view interactive

i want when somones name is moused over for a tip to come up with a place for a picture, and text (i've tryed with tool tip and such but didnt get far, got nowhere)

i also want when you double click a user's name for a msgbox to pop up caontainign the name of the user that was doube clicked (so i can write a code to make instant message boxes pop up)

any help would be greatly appriciated.

code:

#include <GUIConstants.au3>
#include <WindowsConstants.au3>
#include <EditConstants.au3>
#include <ButtonConstants.au3>
#include <inet.au3>
#include <string.au3>
SplashImageOn("verified","verified.gif", 285, 70)
$picloc = IniRead("sets.ini", "prof", "pic", "")
$usern = IniRead("sets.ini", "prof", "login", "UserName")
$passw = IniRead("sets.ini", "prof", "pass", "")
$pass2 = _StringEncrypt(0, $passw, "yourspace")
$ads = _INetGetSource("http://notmyspace.info/messenger/ads.ym")
$adaray = stringsplit($ads, "|")
$countx = UBound($adaray)
$county = Random(1, $countx)
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("YourSpace Messenger", 320, 698, 277, 174)
GUISetCursor (3)
GUISetBkColor(0x00FFFF)

$Pic1 = GUICtrlCreatePic("bg.bmp", 0, 0, 320, 698)
GUICtrlSetState($pic1, $GUI_DISABLE)
$Input1 = GUICtrlCreateInput($usern , 58, 294, 209, 21)
$Input2 = GUICtrlCreateInput($pass2 , 58, 320, 209, 21, $ES_PASSWORD)
$Pic2 = GUICtrlCreatePic("Untitled-1.gif", 50, 24, 220, 204 )
$Pic3 = GUICtrlCreatePic($picloc, 58, 35, 204, 180)
$Button1 = GUICtrlCreateButton("Sign In", 122, 350, 75, 25, $BS_DEFPUSHBUTTON )
$adr = $adaray[$county]
$wmp = _wmpcreate(1, 10, 510, 300, 180);creates object
GUICtrlSetState($wmp, $GUI_DISABLE)
_wmpvalue( $wmp, "nocontrols" );hides controls
_wmploadmedia( $wmp, $adr);loads media
SplashOff()
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Button1
            GUICtrlSetState($Input1, $GUI_DISABLE)
            GUICtrlSetState($Input2, $GUI_DISABLE)
            GUICtrlSetState($Button1, $GUI_DISABLE)
            $pass = _MD5(GUICtrlRead($input2))
                        $login = _INetGetSource("http://notmyspace.info/check2.php?login="&GUICtrlRead($Input1)&"&pass="&$pass)
            $login = StringSplit($login,"\")
            $picdl = StringSplit($login[2],".")
            

            if $login[1] = "YES" Then
                            inetget($login[2], "pic."&$picdl[3])
            IniWrite("sets.ini","prof","pic","pic."&$picdl[3])
            IniWrite("sets.ini","prof","login",GUICtrlRead($Input1))
            IniWrite("sets.ini","prof","pass",_StringEncrypt(1, GUICtrlRead($Input2), "yourspace"))
            SoundPlay("newemail.wma", 1)
                $contacts = _INetGetSource("http://notmyspace.info/check2.php?login="&GUICtrlRead($Input1)&"&pass="&$pass&"&act=cont2")
                MsgBox(0, "", $contacts)
                GUIDelete()
        

#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("YourSpace Messenger", 232, 537, 193, 125)
$TreeView = GUICtrlCreateTreeView(0, 0, 232, 537)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
    $online = GUICtrlCreateTreeViewItem("online", $treeview)
    GUICtrlSetColor(-1, 0x0000C0)
    $offline = GUICtrlCreateTreeViewItem("offline", $treeview)
    GUICtrlSetColor(-1, 0xff0000)
    $contactsx = StringSplit($contacts, " ")
    $contactsy = UBound($contactsx)
    $xy = 2
while $xy < $contactsy
    $onlineuser = GUICtrlCreateTreeViewItem($contactsx[$xy], $online)
    $xy = $xy + 1
    WEnd
GUICtrlSetState($online, BitOR($GUI_EXPAND, $GUI_DEFBUTTON))

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit

    EndSwitch
WEnd

                
                Else
                msgbox(64, "No", "login unsucessfull")
            exit
            EndIf

    EndSwitch
WEnd


Func _wmpcreate($show, $left, $top, $width = 100, $height = 100)
$oWMP = ObjCreate("WMPlayer.OCX")
If $oWMP = 0 Then Return 0
$oWMP.settings.autoStart = "False"
If $show = 1 Then
    GUICtrlCreateObj($oWMP, $left, $top, $width, $height)
EndIf
Return $oWMP
EndFunc

Func _wmploadmedia( $object, $URL, $autostart = 1 )
    $object.URL = $URL
    While Not $object.controls.isAvailable("play")
        Sleep(1)
    WEnd
    If $autostart = 1 Then $object.controls.play()
EndFunc

Func _wmpvalue( $object, $setting, $para=1 )
        Select
            Case $setting = "play"
            If $object.controls.isAvailable("play") Then $object.controls.play()
        Case $setting = "stop"
            If $object.controls.isAvailable("stop") Then $object.controls.stop()
        Case $setting = "pause"
            If $object.controls.isAvailable("pause") Then $object.controls.pause()
        Case $setting = "invisible"
            $object.uiMode = "invisible"
        Case $setting = "controls"
            $object.uiMode = "mini"
        Case $setting = "nocontrols"
            $object.uiMode = "none"
        Case $setting = "fullscreen"
            $object.fullscreen = "true"
        Case $setting = "step"
            If $object.controls.isAvailable("step") Then $object.controls.step($para)
        Case $setting = "fastForward"
            If $object.controls.isAvailable("fastForward") Then $object.controls.fastForward()
        Case $setting = "fastReverse"
            If $object.controls.isAvailable("fastReverse") Then $object.controls.fastReverse()
        Case $setting = "volume"
            $object.settings.volume = $para
        Case $setting = "rate"
            $object.settings.rate = $para
        Case $setting = "playcount"
            $object.settings.playCount = $para
        Case $setting = "setposition"
            $object.controls.currentPosition = $para
        Case $setting = "getposition"
            Return $object.controls.currentPosition
        Case $setting = "getpositionstring";Returns HH:MM:SS
            Return $object.controls.currentPositionString
        Case $setting = "getduration"
            Return $object.currentMedia.duration
    EndSelect
EndFunc

func _MD5($stext)
    $s_url = "http://notmyspace.info/messenger/md5.php?text="&$stext
    $s_header = ''
    Local $h_DLL = DllOpen("wininet.dll")

    Local $ai_IRF, $md5 = ''

    Local $ai_IO = DllCall($h_DLL, 'int', 'InternetOpen', 'str', "AutoIt v3", 'int', 0, 'int', 0, 'int', 0, 'int', 0)
    If @error Or $ai_IO[0] = 0 Then
        DllClose($h_DLL)
        SetError(1)
        Return ""
    EndIf

    Local $ai_IOU = DllCall($h_DLL, 'int', 'InternetOpenUrl', 'int', $ai_IO[0], 'str', $s_URL, 'str', $s_Header, 'int', StringLen($s_Header), 'int', 0x80000000, 'int', 0)
    If @error Or $ai_IOU[0] = 0 Then
        DllCall($h_DLL, 'int', 'InternetCloseHandle', 'int', $ai_IO[0])
        DllClose($h_DLL)
        SetError(1)
        Return ""
    EndIf

    Local $v_Struct = DllStructCreate('udword')
    DllStructSetData($v_Struct, 1, 1)

    While DllStructGetData($v_Struct, 1) <> 0
        $ai_IRF = DllCall($h_DLL, 'int', 'InternetReadFile', 'int', $ai_IOU[0], 'str', '', 'int', 256, 'ptr', DllStructGetPtr($v_Struct))
        $md5 &= StringLeft($ai_IRF[2], DllStructGetData($v_Struct, 1))
    WEnd

    DllCall($h_DLL, 'int', 'InternetCloseHandle', 'int', $ai_IOU[0])
    DllCall($h_DLL, 'int', 'InternetCloseHandle', 'int', $ai_IO[0])
    DllClose($h_DLL)
    Return $md5

EndFunc

func _RegisterProtocol($pname,$pcommandloc)
$tkey="HKEY_CLASSES_ROOT\"&$pname
RegWrite($tkey)
sleep(10)
RegWrite($tkey,"","REG_SZ","URL: "&$pname&" protocol")
sleep(10)
RegWrite($tkey,"URL Protocol","REG_SZ","")
sleep(10)

RegWrite($tkey&"\shell")
sleep(10)
RegWrite($tkey&"\shell\open")
sleep(10)
RegWrite($tkey&"\shell\open\command")
sleep(10)
RegWrite($tkey&"\shell\open\command","","REG_SZ",'"'&$pcommandloc&'" %1')
sleep(10)

MsgBox(0,"Fin","protocol "&$pname&": registered.",2)
Exit
EndFunc

Func _SpeakToWAV($sText,$sFile)
    $ObjVoice=ObjCreate("Sapi.SpVoice")
    $ObjFile=ObjCreate("SAPI.SpFileStream.1")
    $objFile.Open($sFile,3)
    $objVoice.AudioOutputStream = $objFile
    $objVoice.Speak ($sText)
EndFunc

Func _GoogleTranslate($sText, $sFrom = "en", $sTo = "ja")
    Local Const $FileName = "Translation.jsn"
    Local Const $Pattern = '"translatedText":"([^"]+)"'
    Local $GoogleURL = "http://ajax.googleapis.com/ajax/services/language/translate?v=1.0&q=%s&langpair=%s%%7C%s"
    Local $File
    
    $GoogleURL = StringFormat($GoogleURL, $sText, $sFrom, $sTo)
    
    If Not InetGet($GoogleURL, $FileName, 1) Then Return SetError(1, 0, 0)
        
    $File = FileOpen($FileName, 4)
    FileGetSize($FileName)
    $Translation = FileRead($File, FileGetSize($FileName))
    FileClose($File)
    FileDelete($FileName)
    
    $Translation = BinaryToString($Translation, 4)

    If StringRegExp($Translation , $Pattern) Then
        $Translation = StringRegExp($Translation , $Pattern, 1)
        $Translation = $Translation[0]
        
        Return $Translation
    EndIf
EndFunc
Spoiler

Admin Of:http://notmyspace.info [Under Development, looking for volunteers to help improve]http://PSNetCards.co.ukhttp://ZacnAndLindsey.com [Under development, not quite sure what to do with it yet]http://revelm.com------------------------------------Radio Streams:http://75.185.53.88:8000 [128kb/s 44kHz]http://75.185.53.88:8002 [22kb/s 22kHz](works on mobile phones)-----------------------------------My Server:Owned By: http://jumpline.comIP:66.84.19.220Bandwidth:200GBStorage Space:1TBNetwork Connection: 1GB/S[up and down]Operating System: Red Hat LinuxInstalled Apps:Webmail, phpBB, Majordomo, phpMyAdmin, MySQL, Active Server Pages, FrontPage Extensions 2002, GraphicsMagick, Mod Perl, Perl, PHP: Hypertext Preprocessor, Python(want cheap good webhosting, or need a place to park your domain? contact me)-----------------------------------

 

Link to comment
Share on other sites

Reserved

Edited by emoyasha
Spoiler

Admin Of:http://notmyspace.info [Under Development, looking for volunteers to help improve]http://PSNetCards.co.ukhttp://ZacnAndLindsey.com [Under development, not quite sure what to do with it yet]http://revelm.com------------------------------------Radio Streams:http://75.185.53.88:8000 [128kb/s 44kHz]http://75.185.53.88:8002 [22kb/s 22kHz](works on mobile phones)-----------------------------------My Server:Owned By: http://jumpline.comIP:66.84.19.220Bandwidth:200GBStorage Space:1TBNetwork Connection: 1GB/S[up and down]Operating System: Red Hat LinuxInstalled Apps:Webmail, phpBB, Majordomo, phpMyAdmin, MySQL, Active Server Pages, FrontPage Extensions 2002, GraphicsMagick, Mod Perl, Perl, PHP: Hypertext Preprocessor, Python(want cheap good webhosting, or need a place to park your domain? contact me)-----------------------------------

 

Link to comment
Share on other sites

bump

Spoiler

Admin Of:http://notmyspace.info [Under Development, looking for volunteers to help improve]http://PSNetCards.co.ukhttp://ZacnAndLindsey.com [Under development, not quite sure what to do with it yet]http://revelm.com------------------------------------Radio Streams:http://75.185.53.88:8000 [128kb/s 44kHz]http://75.185.53.88:8002 [22kb/s 22kHz](works on mobile phones)-----------------------------------My Server:Owned By: http://jumpline.comIP:66.84.19.220Bandwidth:200GBStorage Space:1TBNetwork Connection: 1GB/S[up and down]Operating System: Red Hat LinuxInstalled Apps:Webmail, phpBB, Majordomo, phpMyAdmin, MySQL, Active Server Pages, FrontPage Extensions 2002, GraphicsMagick, Mod Perl, Perl, PHP: Hypertext Preprocessor, Python(want cheap good webhosting, or need a place to park your domain? contact me)-----------------------------------

 

Link to comment
Share on other sites

please.

i want to retreive the datta of the control clicked int he treeview... everything loosk right but it wont work!

also how to i asign a pic to each item (in this example contacts) in the tree view?

and an icon to the onlien section and offline sections

ans lastley when i split my array a blank is left at the end that is added to the treeview how do i remove this.

here is my code: (sorrys its a bit messy just i tryed to irganize it the best i could)

[autoit];-----------------

#include <GUIConstants.au3>

#include <WindowsConstants.au3>

#include <EditConstants.au3>

#include <ButtonConstants.au3>

#include <inet.au3>

#include <string.au3>

#include <Constants.au3>

#include <Array.au3>

#include <Color.au3>

#include <GDIPlus.au3>

#include <Misc.au3>

#include <GuiTreeView.au3>

#include <TreeViewConstants.au3>

;------------------

;------------------

$GUIWidth = 320

$guiheight = 698

$red = 0

$green = 100

$blue = 225

Global $iColor[2] = ["0xFFFF00","0x0000FF"], $Label[2], $Button[2]

Global $Direction = 0

;------------------

;------------------

opt("GUIResizeMode",$GUI_DOCKAUTO)

Opt("TrayMenuMode", 1)

Opt("TrayOnEventMode", 1)

Opt("GUIEventOptions", 1)

Opt("GUICloseOnESC", 1)

;-------------------

;-------------------

SplashImageOn("verified","verified.gif", 285, 70)

;-------------------

;--------------------

$site = "http://notmyspace.info"

$picloc = IniRead("data.dll", "prof", "pic", "")

$usern = IniRead("data.dll", "prof", "login", "UserName")

$passw = IniRead("data.dll", "prof", "pass", "")

$version = IniRead("data.dll", "system", "version", "0.0.1.2")

$welcome = IniRead("data.dll", "system", "message", "YourSpace Messenger")

$pass2 = _StringEncrypt(0, $passw, "yourspace")

;--------------------

;--------------------

TrayCreateItem("Show")

TrayItemSetOnEvent(-1, "show")

TrayCreateItem("")

TrayCreateItem("Exit")

TrayItemSetOnEvent(-1, "Terminate")

TraySetToolTip("YourSpace Messenger "&$Version)

TraySetOnEvent($TRAY_EVENT_PRIMARYDOUBLE, "show")

TraySetClick(16)

;--------------------

;--------------------

$ads = _INetGetSource($site&"/messenger/ads.ym")

$adaray = stringsplit($ads, "|")

$countx = UBound($adaray)

$county = Random(1, $countx)

;--------------------

#Region ### START Koda GUI section ### Form=

$Form1 = GUICreate("YourSpace Messenger", $GUIWidth, $GUIHeight, 277, 174,BitOR($GUI_SS_DEFAULT_GUI, $WS_MAXIMIZEBOX, $WS_SIZEBOX))

GUISetCursor (3)

GUISetBkColor(0x00FFFF)

$Button3 = GUICtrlCreateButton("V", 300, 20, 20, 25, $BS_FLAT)

$Graphic = GUICtrlCreateGraphic (0,0, $GUIWidth, $GUIHeight)

GUICtrlSetState(-1, $GUI_DISABLE)

GUICtrlSetResizing(-1, $GUI_DOCKBORDERS)

;=============

GradientFill($Graphic, 0, 0, $GUIWidth, $GUIHeight, _ArrayCreate($blue,$green,$red), _ArrayCreate(255,255,255));

GUICtrlSetGraphic($Graphic,$GUI_GR_REFRESH)

;=============

$Input1 = GUICtrlCreateInput($usern , 58, 294, 209, 21)

$Input2 = GUICtrlCreateInput($pass2 , 58, 320, 209, 21, $ES_PASSWORD)

$Pic2 = GUICtrlCreatePic("frame.gif", 50, 24, 220, 204 )

$Pic3 = GUICtrlCreatePic($picloc, 58, 35, 204, 180)

$Button1 = GUICtrlCreateButton("Sign In", 122, 350, 75, 25, $BS_DEFPUSHBUTTON )

$adr = $adaray[$county]

$wmp = _wmpcreate(1, 10, 510, 300, 180);creates object

GUICtrlSetState($wmp, $GUI_DISABLE)

_wmpvalue( $wmp, "nocontrols" );hides controls

_wmploadmedia( $wmp, $adr);loads media

; -----------------

$File = GUICtrlCreateMenu("&File")

$LogOff = GUICtrlCreateMenuItem("Log Off", $File)

$Info = GUICtrlCreateMenuItem("Info", $File)

$com = GUICtrlCreateMenuItem("Commands", $File)

$form = GUICtrlCreateMenuItem("formating tags", $File)

$sets = GUICtrlCreateMenuItem("change text to speech settings", $File)

GUICtrlCreateMenuItem("", $File)

$Exit = GUICtrlCreateMenuItem("Exit", $File)

$ContactsMenu = GUICtrlCreateMenu("&Contacts")

$AddContact = GUICtrlCreateMenuItem("Add a contact", $ContactsMenu)

$DelContact = GUICtrlCreateMenuItem("Delete a contact", $ContactsMenu)

GUICtrlCreateMenuItem("", $ContactsMenu)

$Import = GUICtrlCreateMenuItem("Import contacts from file", $ContactsMenu)

$Export = GUICtrlCreateMenuItem("Export contacts to file", $ContactsMenu)

For $x = $LogOff To $Export

GUICtrlSetState($x, $GUI_DISABLE)

Next

GUICtrlSetState($Exit, $GUI_ENABLE)

GUICtrlSetState($ContactsMenu, $GUI_ENABLE)

;--------------------

SplashOff()

GUISetState(@SW_SHOW)

#EndRegion ### END Koda GUI section ###

;------------------------

TextEffect($welcome, 0, 0, 17, 17, 1, 1, 0x00ff00, 0xff0000, 25, 25, 1, 1)

;------------------------

While 1

$nMsg = GUIGetMsg()

Switch $nMsg

Case $Exit

DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $Form1, "int", 200, "long", 0x00090000)

Exit

CASE $Button3

$Clr = _ChooseColor(2, 0, 2, $Form1)

$blue = _ColorGetBlue($clr)

$green = _ColorGetGreen($clr)

$red = _ColorGetRed($clr)

GradientFill($Graphic, 0, 0, $GUIWidth, $GUIHeight, _ArrayCreate($blue,$green,$red), _ArrayCreate(255,255,255));

GUICtrlSetGraphic($Graphic,$GUI_GR_REFRESH)

GUICtrlSetBkColor($Button3, $Clr)

Case $GUI_EVENT_CLOSE

Exit

Case $Button1

;------------------

GUICtrlSetState($Input1, $GUI_DISABLE)

GUICtrlSetState($Input2, $GUI_DISABLE)

GUICtrlSetState($Button1, $GUI_DISABLE)

;------------------

;------------------

$pass = _MD5(GUICtrlRead($input2))

;------------------

$login = _INetGetSource($site&"/messenger/check2.php?login="&GUICtrlRead($Input1)&"&pass="&$pass&"&act=signin")

$login = StringSplit($login,"\")

if $login[1] = "YES" Then

TraySetIcon("show.ico")

$picdl = StringSplit($login[2],".")

inetget($login[2], "pic."&$picdl[3])

IniWrite("data.dll","prof","pic","pic."&$picdl[3])

IniWrite("data.dll","prof","login",GUICtrlRead($Input1))

IniWrite("data.dll","prof","pass",_StringEncrypt(1, GUICtrlRead($Input2), "yourspace"))

SoundPlay("newemail.wma", 1)

$on = _INetGetSource($site&"/messenger/check2.php?login="&GUICtrlRead($Input1)&"&pass="&$pass&"&act=online")

$off = _INetGetSource($site&"/messenger/check2.php?login="&GUICtrlRead($Input1)&"&pass="&$pass&"&act=offline")

GUIDelete()

#Region ### START Koda GUI section ### Form=

$Form1 = GUICreate("YourSpace Messenger", 232, 537, 193, 125)

$TreeView = GUICtrlCreateTreeView(0, 0, 232, 537)

GUICtrlSetOnEvent(-1, "_TreeViewItem_Read")

GUISetState(@SW_SHOW)

#EndRegion ### END Koda GUI section ###

$online = GUICtrlCreateTreeViewItem("online", $treeview)

GUICtrlSetTip(-1, "Online Users")

GUICtrlSetOnEvent(-1, "_TreeViewItem_Read")

GUICtrlSetColor(-1, 0x0000C0)

$offline = GUICtrlCreateTreeViewItem("offline", $treeview)

GUICtrlSetOnEvent(-1, "_TreeViewItem_Read")

GUICtrlSetColor(-1, 0xff0000)

$onlinex = StringSplit($on, " ")

$onliney = UBound($onlinex)

$onliney = $onliney - 1

For $i = 1 To $onliney

$friend = $onlinex[$i]

if $friend = "" Then

elseif $friend = " " Then

elseif $friend = " " Then

elseif $friend = " " Then

elseif $friend = "

Spoiler

Admin Of:http://notmyspace.info [Under Development, looking for volunteers to help improve]http://PSNetCards.co.ukhttp://ZacnAndLindsey.com [Under development, not quite sure what to do with it yet]http://revelm.com------------------------------------Radio Streams:http://75.185.53.88:8000 [128kb/s 44kHz]http://75.185.53.88:8002 [22kb/s 22kHz](works on mobile phones)-----------------------------------My Server:Owned By: http://jumpline.comIP:66.84.19.220Bandwidth:200GBStorage Space:1TBNetwork Connection: 1GB/S[up and down]Operating System: Red Hat LinuxInstalled Apps:Webmail, phpBB, Majordomo, phpMyAdmin, MySQL, Active Server Pages, FrontPage Extensions 2002, GraphicsMagick, Mod Perl, Perl, PHP: Hypertext Preprocessor, Python(want cheap good webhosting, or need a place to park your domain? contact me)-----------------------------------

 

Link to comment
Share on other sites

  • Moderators

please.

i want to retreive the datta of the control clicked int he treeview... everything loosk right but it wont work!

also how to i asign a pic to each item (in this example contacts) in the tree view?

and an icon to the onlien section and offline sections

ans lastley when i split my array a blank is left at the end that is added to the treeview how do i remove this.

here is my code: (sorrys its a bit messy just i tryed to irganize it the best i could)

[autoit];-----------------

#include <GUIConstants.au3>

#include <WindowsConstants.au3>

#include <EditConstants.au3>

#include <ButtonConstants.au3>

#include <inet.au3>

#include <string.au3>

#include <Constants.au3>

#include <Array.au3>

#include <Color.au3>

#include <GDIPlus.au3>

#include <Misc.au3>

#include <GuiTreeView.au3>

#include <TreeViewConstants.au3>

;------------------

;------------------

$GUIWidth = 320

$guiheight = 698

$red = 0

$green = 100

$blue = 225

Global $iColor[2] = ["0xFFFF00","0x0000FF"], $Label[2], $Button[2]

Global $Direction = 0

;------------------

;------------------

opt("GUIResizeMode",$GUI_DOCKAUTO)

Opt("TrayMenuMode", 1)

Opt("TrayOnEventMode", 1)

Opt("GUIEventOptions", 1)

Opt("GUICloseOnESC", 1)

;-------------------

;-------------------

SplashImageOn("verified","verified.gif", 285, 70)

;-------------------

;--------------------

$site = "http://notmyspace.info"

$picloc = IniRead("data.dll", "prof", "pic", "")

$usern = IniRead("data.dll", "prof", "login", "UserName")

$passw = IniRead("data.dll", "prof", "pass", "")

$version = IniRead("data.dll", "system", "version", "0.0.1.2")

$welcome = IniRead("data.dll", "system", "message", "YourSpace Messenger")

$pass2 = _StringEncrypt(0, $passw, "yourspace")

;--------------------

;--------------------

TrayCreateItem("Show")

TrayItemSetOnEvent(-1, "show")

TrayCreateItem("")

TrayCreateItem("Exit")

TrayItemSetOnEvent(-1, "Terminate")

TraySetToolTip("YourSpace Messenger "&$Version)

TraySetOnEvent($TRAY_EVENT_PRIMARYDOUBLE, "show")

TraySetClick(16)

;--------------------

;--------------------

$ads = _INetGetSource($site&"/messenger/ads.ym")

$adaray = stringsplit($ads, "|")

$countx = UBound($adaray)

$county = Random(1, $countx)

;--------------------

#Region ### START Koda GUI section ### Form=

$Form1 = GUICreate("YourSpace Messenger", $GUIWidth, $GUIHeight, 277, 174,BitOR($GUI_SS_DEFAULT_GUI, $WS_MAXIMIZEBOX, $WS_SIZEBOX))

GUISetCursor (3)

GUISetBkColor(0x00FFFF)

$Button3 = GUICtrlCreateButton("V", 300, 20, 20, 25, $BS_FLAT)

$Graphic = GUICtrlCreateGraphic (0,0, $GUIWidth, $GUIHeight)

GUICtrlSetState(-1, $GUI_DISABLE)

GUICtrlSetResizing(-1, $GUI_DOCKBORDERS)

;=============

GradientFill($Graphic, 0, 0, $GUIWidth, $GUIHeight, _ArrayCreate($blue,$green,$red), _ArrayCreate(255,255,255));

GUICtrlSetGraphic($Graphic,$GUI_GR_REFRESH)

;=============

$Input1 = GUICtrlCreateInput($usern , 58, 294, 209, 21)

$Input2 = GUICtrlCreateInput($pass2 , 58, 320, 209, 21, $ES_PASSWORD)

$Pic2 = GUICtrlCreatePic("frame.gif", 50, 24, 220, 204 )

$Pic3 = GUICtrlCreatePic($picloc, 58, 35, 204, 180)

$Button1 = GUICtrlCreateButton("Sign In", 122, 350, 75, 25, $BS_DEFPUSHBUTTON )

$adr = $adaray[$county]

$wmp = _wmpcreate(1, 10, 510, 300, 180);creates object

GUICtrlSetState($wmp, $GUI_DISABLE)

_wmpvalue( $wmp, "nocontrols" );hides controls

_wmploadmedia( $wmp, $adr);loads media

; -----------------

$File = GUICtrlCreateMenu("&File")

$LogOff = GUICtrlCreateMenuItem("Log Off", $File)

$Info = GUICtrlCreateMenuItem("Info", $File)

$com = GUICtrlCreateMenuItem("Commands", $File)

$form = GUICtrlCreateMenuItem("formating tags", $File)

$sets = GUICtrlCreateMenuItem("change text to speech settings", $File)

GUICtrlCreateMenuItem("", $File)

$Exit = GUICtrlCreateMenuItem("Exit", $File)

$ContactsMenu = GUICtrlCreateMenu("&Contacts")

$AddContact = GUICtrlCreateMenuItem("Add a contact", $ContactsMenu)

$DelContact = GUICtrlCreateMenuItem("Delete a contact", $ContactsMenu)

GUICtrlCreateMenuItem("", $ContactsMenu)

$Import = GUICtrlCreateMenuItem("Import contacts from file", $ContactsMenu)

$Export = GUICtrlCreateMenuItem("Export contacts to file", $ContactsMenu)

For $x = $LogOff To $Export

GUICtrlSetState($x, $GUI_DISABLE)

Next

GUICtrlSetState($Exit, $GUI_ENABLE)

GUICtrlSetState($ContactsMenu, $GUI_ENABLE)

;--------------------

SplashOff()

GUISetState(@SW_SHOW)

#EndRegion ### END Koda GUI section ###

;------------------------

TextEffect($welcome, 0, 0, 17, 17, 1, 1, 0x00ff00, 0xff0000, 25, 25, 1, 1)

;------------------------

While 1

$nMsg = GUIGetMsg()

Switch $nMsg

Case $Exit

DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $Form1, "int", 200, "long", 0x00090000)

Exit

CASE $Button3

$Clr = _ChooseColor(2, 0, 2, $Form1)

$blue = _ColorGetBlue($clr)

$green = _ColorGetGreen($clr)

$red = _ColorGetRed($clr)

GradientFill($Graphic, 0, 0, $GUIWidth, $GUIHeight, _ArrayCreate($blue,$green,$red), _ArrayCreate(255,255,255));

GUICtrlSetGraphic($Graphic,$GUI_GR_REFRESH)

GUICtrlSetBkColor($Button3, $Clr)

Case $GUI_EVENT_CLOSE

Exit

Case $Button1

;------------------

GUICtrlSetState($Input1, $GUI_DISABLE)

GUICtrlSetState($Input2, $GUI_DISABLE)

GUICtrlSetState($Button1, $GUI_DISABLE)

;------------------

;------------------

$pass = _MD5(GUICtrlRead($input2))

;------------------

$login = _INetGetSource($site&"/messenger/check2.php?login="&GUICtrlRead($Input1)&"&pass="&$pass&"&act=signin")

$login = StringSplit($login,"\")

if $login[1] = "YES" Then

TraySetIcon("show.ico")

$picdl = StringSplit($login[2],".")

inetget($login[2], "pic."&$picdl[3])

IniWrite("data.dll","prof","pic","pic."&$picdl[3])

IniWrite("data.dll","prof","login",GUICtrlRead($Input1))

IniWrite("data.dll","prof","pass",_StringEncrypt(1, GUICtrlRead($Input2), "yourspace"))

SoundPlay("newemail.wma", 1)

$on = _INetGetSource($site&"/messenger/check2.php?login="&GUICtrlRead($Input1)&"&pass="&$pass&"&act=online")

$off = _INetGetSource($site&"/messenger/check2.php?login="&GUICtrlRead($Input1)&"&pass="&$pass&"&act=offline")

GUIDelete()

#Region ### START Koda GUI section ### Form=

$Form1 = GUICreate("YourSpace Messenger", 232, 537, 193, 125)

$TreeView = GUICtrlCreateTreeView(0, 0, 232, 537)

GUICtrlSetOnEvent(-1, "_TreeViewItem_Read")

GUISetState(@SW_SHOW)

#EndRegion ### END Koda GUI section ###

$online = GUICtrlCreateTreeViewItem("online", $treeview)

GUICtrlSetTip(-1, "Online Users")

GUICtrlSetOnEvent(-1, "_TreeViewItem_Read")

GUICtrlSetColor(-1, 0x0000C0)

$offline = GUICtrlCreateTreeViewItem("offline", $treeview)

GUICtrlSetOnEvent(-1, "_TreeViewItem_Read")

GUICtrlSetColor(-1, 0xff0000)

$onlinex = StringSplit($on, " ")

$onliney = UBound($onlinex)

$onliney = $onliney - 1

For $i = 1 To $onliney

$friend = $onlinex[$i]

if $friend = "" Then

elseif $friend = " " Then

elseif $friend = " " Then

elseif $friend = " " Then

elseif $friend = "

Edited by SmOke_N

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

excuse me but if you search the form you will note a similar topic posted quite a long time ago.

http://www.autoitscript.com/forum/index.ph...mp;highlite=%2B

>

interactive tree view

General Help and Support emoyasha 0 121 13th July 2008 - 09:25 AM

Last post by: emoyasha

a month and 3/4 ago

replicator:

#include <GUIConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("YourSpace Messenger", 232, 537, 193, 125)
$TreeView = GUICtrlCreateTreeView(0, 0, 232, 537)
GUICtrlSetOnEvent(-1, "_TreeViewItem_Read")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
    $online = GUICtrlCreateTreeViewItem("online", $treeview)
    GUICtrlSetTip(-1, "Online Users")
    GUICtrlSetOnEvent(-1, "_TreeViewItem_Read")
    GUICtrlSetColor(-1, 0x0000C0)
    $offline = GUICtrlCreateTreeViewItem("offline", $treeview)
    GUICtrlSetOnEvent(-1, "_TreeViewItem_Read")
    GUICtrlSetColor(-1, 0xff0000)

$onliney = 10
For $i = 1 To $onliney
$friend = "rep"&$i
$onlineuser = GUICtrlCreateTreeViewItem($friend, $online)
    GUICtrlSetOnEvent(-1, "_TreeViewItem_Read")

Next
   
    $offliney = 10
For $i = 1 To $offliney
$friend = "rep"&$i
$onlineuser = GUICtrlCreateTreeViewItem($friend, $offline)
    GUICtrlSetOnEvent(-1, "_TreeViewItem_Read")
Next
GUICtrlSetState($online, BitOR($GUI_EXPAND, $GUI_DEFBUTTON))
While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            
        Exit

    EndSwitch
WEnd
Func _TreeViewItem_Read()
    MsgBox(0, "Item Text", GUICtrlRead(@GUI_CtrlId, 1))
EndFunc
Edited by emoyasha
Spoiler

Admin Of:http://notmyspace.info [Under Development, looking for volunteers to help improve]http://PSNetCards.co.ukhttp://ZacnAndLindsey.com [Under development, not quite sure what to do with it yet]http://revelm.com------------------------------------Radio Streams:http://75.185.53.88:8000 [128kb/s 44kHz]http://75.185.53.88:8002 [22kb/s 22kHz](works on mobile phones)-----------------------------------My Server:Owned By: http://jumpline.comIP:66.84.19.220Bandwidth:200GBStorage Space:1TBNetwork Connection: 1GB/S[up and down]Operating System: Red Hat LinuxInstalled Apps:Webmail, phpBB, Majordomo, phpMyAdmin, MySQL, Active Server Pages, FrontPage Extensions 2002, GraphicsMagick, Mod Perl, Perl, PHP: Hypertext Preprocessor, Python(want cheap good webhosting, or need a place to park your domain? contact me)-----------------------------------

 

Link to comment
Share on other sites

okay then.... i can go another 2 months withotu help.

Spoiler

Admin Of:http://notmyspace.info [Under Development, looking for volunteers to help improve]http://PSNetCards.co.ukhttp://ZacnAndLindsey.com [Under development, not quite sure what to do with it yet]http://revelm.com------------------------------------Radio Streams:http://75.185.53.88:8000 [128kb/s 44kHz]http://75.185.53.88:8002 [22kb/s 22kHz](works on mobile phones)-----------------------------------My Server:Owned By: http://jumpline.comIP:66.84.19.220Bandwidth:200GBStorage Space:1TBNetwork Connection: 1GB/S[up and down]Operating System: Red Hat LinuxInstalled Apps:Webmail, phpBB, Majordomo, phpMyAdmin, MySQL, Active Server Pages, FrontPage Extensions 2002, GraphicsMagick, Mod Perl, Perl, PHP: Hypertext Preprocessor, Python(want cheap good webhosting, or need a place to park your domain? contact me)-----------------------------------

 

Link to comment
Share on other sites

NOT!

Spoiler

Admin Of:http://notmyspace.info [Under Development, looking for volunteers to help improve]http://PSNetCards.co.ukhttp://ZacnAndLindsey.com [Under development, not quite sure what to do with it yet]http://revelm.com------------------------------------Radio Streams:http://75.185.53.88:8000 [128kb/s 44kHz]http://75.185.53.88:8002 [22kb/s 22kHz](works on mobile phones)-----------------------------------My Server:Owned By: http://jumpline.comIP:66.84.19.220Bandwidth:200GBStorage Space:1TBNetwork Connection: 1GB/S[up and down]Operating System: Red Hat LinuxInstalled Apps:Webmail, phpBB, Majordomo, phpMyAdmin, MySQL, Active Server Pages, FrontPage Extensions 2002, GraphicsMagick, Mod Perl, Perl, PHP: Hypertext Preprocessor, Python(want cheap good webhosting, or need a place to park your domain? contact me)-----------------------------------

 

Link to comment
Share on other sites

More examples :)

#include <GuiConstantsEx.au3>
#include <GuiTreeView.au3>
#include <GuiImageList.au3>
#include <WindowsConstants.au3>

$Style = BitOR($TVS_HASBUTTONS, $TVS_HASLINES, $TVS_LINESATROOT, $TVS_DISABLEDRAGDROP, $TVS_SHOWSELALWAYS)

$hGUI = GUICreate("Test", 300, 300)

$hTreeView = _GUICtrlTreeView_Create($hGUI, 10, 10, 280, 280, $Style)

$hImage = _GUIImageList_Create(16, 16, 5, 3)

_GUIImageList_AddIcon($hImage, "shell32.dll", 5)
_GUIImageList_AddIcon($hImage, "shell32.dll", 15)
_GUICtrlTreeView_SetNormalImageList($hTreeView, $hImage)

For $i = 1 To 10
    $hItem = _GUICtrlTreeView_Add($hTreeView, 0, "Item " & $i, 1, 1)
    
    For $j = 1 To 10
        _GUICtrlTreeView_AddChild($hTreeView, $hItem, "Child " & $j, 0, 0)
    Next
Next

GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY")

GUISetState()

Do
Until GUIGetMsg() = $GUI_EVENT_CLOSE

Func WM_NOTIFY($hWnd, $Msg, $wParam, $lParam)
    Local $tNMHDR, $hWndFrom, $iCode
    
    $tNMHDR = DllStructCreate($tagNMHDR, $lParam)
    $hWndFrom = DllStructGetData($tNMHDR, "hWndFrom")
    $iCode = DllStructGetData($tNMHDR, "Code")
    
    Switch $hWndFrom
        Case $hTreeView
            Switch $iCode
                Case $TVN_SELCHANGING
                    Local $tINFO = DllStructCreate($tagNMTREEVIEW, $lParam)
                    Local $hControl = DllStructGetData($tINFO, "NewhItem")
                    
                    ConsoleWrite(_GUICtrlTreeView_GetText($hTreeView, $hControl) & " is selected" & @LF)
            EndSwitch
    EndSwitch
    
    Return $GUI_RUNDEFMSG
EndFunc
Link to comment
Share on other sites

i believe he wanted to use guigetmessage however was trying to follow an example from the form using the on event mode.

here is his code where the treeview is created

#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("YourSpace Messenger", 232, 537, 193, 125)
$TreeView = GUICtrlCreateTreeView(0, 0, 232, 537)
GUICtrlSetOnEvent(-1, "_TreeViewItem_Read")
#EndRegion ### END Koda GUI section ###
displayusers()
GUISetState(@SW_SHOW)

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            $Handle = WinGetHandle("")
                If $Handle = $Form1 Then
                                DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $Form1, "int", 200, "long", 0x00090000)
            TraySetIcon("hidden.ico")
            GUISetState(@SW_HIDE)
                Else
                    For $y = 0 To $MaxChildWindow - 1
                        If $Handle = $ChildWindow[$y] Then
                            GUIDelete($Handle)
                            $ChildWindow[$y] = ""
                            $ChildConversation[$y] = ""
                        EndIf
                    Next
                    For $y = 0 To $MaxChildWindow - 1
                        If $Handle = $SmileyWindow[$y] Then
                            GUIDelete($Handle)
                            $SmileyWindow[$y] = ""
                        EndIf
                    Next
                EndIf
                        Case $GUI_EVENT_MINIMIZE
                $Handle = WinGetHandle("")
                If $Handle = $Form1 Then
                    WinSetState($Form1, "", @SW_MINIMIZE)
                Else
                    For $y = 0 To $MaxChildWindow - 1
                        If $Handle = $ChildWindow[$y] Then
                            WinSetState($Handle, "", @SW_MINIMIZE)
                        EndIf
                    Next
                EndIf
                
                Case $GUI_EVENT_MAXIMIZE, $GUI_EVENT_RESTORE
                Switch $nMsg
                    Case $GUI_EVENT_MAXIMIZE
                        $s = @SW_MAXIMIZE
                    Case $GUI_EVENT_RESTORE
                        $s = @SW_RESTORE
                EndSwitch
                $Handle = WinGetHandle("")
                If $Handle = $Form1 Then
                    WinSetState($Form1, "", $s)
                Else
                    For $y = 0 To $MaxChildWindow - 1
                        If $Handle = $ChildWindow[$y] Then
                            WinSetState($Handle, "", $s)
                        EndIf
                    Next
                EndIf
        

    EndSwitch
WEnd

func displayusers()
        $online = GUICtrlCreateTreeViewItem("online", $treeview)
    GUICtrlSetTip(-1, "Online Users")
    GUICtrlSetOnEvent(-1, "_TreeViewItem_Read")
    GUICtrlSetColor(-1, 0x0000C0)
    $offline = GUICtrlCreateTreeViewItem("offline", $treeview)
    GUICtrlSetOnEvent(-1, "_TreeViewItem_Read")
    GUICtrlSetColor(-1, 0xff0000)
    $onlinex = StringSplit($on, " ")
    $onliney = UBound($onlinex)
    $onliney = $onliney - 1
For $i = 1 To $onliney
$friend = $onlinex[$i]

if $friend = "" Then
elseif $friend = " " Then
elseif $friend = "  " Then
elseif $friend = "      " Then
elseif $friend = " " Then
Else
    
$onlineuser = GUICtrlCreateTreeViewItem($friend, $online)
    GUICtrlSetOnEvent(-1, "_TreeViewItem_Read")
EndIf
Next
    $offlinex = StringSplit($off, " ")
    $offliney = UBound($offlinex)
    $offliney = $offliney - 1
For $i = 1 To $offliney
$friend = $offlinex[$i]

if $friend = "" Then
elseif $friend = " " Then
elseif $friend = "  " Then
elseif $friend = "      " Then
elseif $friend = " " Then
Else
    
$onlineuser = GUICtrlCreateTreeViewItem($friend, $offline)
    GUICtrlSetOnEvent(-1, "_TreeViewItem_Read")
EndIf
Next
endfunc

so just how exactly would you implement double clicking to go to the function startconversation($suser) $suer being the name clicked?

Link to comment
Share on other sites

  • Moderators

also i believe he is using the most current version because this code runs perfectly with the current build perhaps its just not.... optimized yet.

I'm sure you do believe that since you are him.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

I'm sure you do believe that since you are him.

I thought that he was maybe "Firelord" in disguise due to the join date and the nick "ChildOfGod"..

But your comment sheds light on the attitude..

I will do "emoyasha" aka "ChildOfGod" a favor and ignore his/hers/it's posts in future.

Cheers for the heads up..

Link to comment
Share on other sites

emoyasha, if you can still read this, it seems to me that you might be the type of person that would be best served by the type of speedy response that comes from an IRC channel and not the forums. I'm not sure if there is an IRC channel, but I just wanted to mention that.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...