Jump to content

treeview help


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

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...