Jump to content

Useful program


Kreatorul
 Share

Recommended Posts

hi! I wanted to make a program for a faster login On Yahoo Messenger and I did it but there is a problem with the buttons...I am not experienced in GUI's so please help solve this Here is the code

#include <GuiConstants.au3>
$r=RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Y!M", "Y!M")
$r2=RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Y!M", "Y!M2")
$r3=RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Y!M", "Y!M3")
If $r="" or $r2="" or $r3="" Then 
    GuiCreate("Fast Y!M Login", 220, 110)
    GuiSetState()
    GuiGetMsg()
    $file=FileOpenDialog("Path to Yahoo Messenger exe", "", "Exe (*.exe)")
    $label1=GuiCtrlCreateLabel("Enter the ID", 5, 10)
    $label2=GuiCtrlCreateLabel("Enter the password",110, 10)
    $label3=GuiCtrlCreateLabel("Press untill it works",130, 75)
    $id=GUICtrlCreateInput("", 5, 35, 100)
    $pass=GuiCtrlCreateInput("", 110, 35, 100)
    $button=GuiCtrlCreateButton("Remember ID and PASS", 5, 70)
    While GuiGetMsg() <> $GUI_EVENT_CLOSE
    If GuiGetMsg()=$button Then 
    RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Y!M", "Y!M", "REG_SZ", GuiCtrlRead($id))
    RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Y!M", "Y!M2", "REG_SZ", GuiCtrlRead($pass))
    RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Y!M", "Y!M3", "REG_SZ", $file)
    MsgBox(0, "Restart", "Now restart the program")
    ExitLoop
    EndIf
    Wend

    Else 
    GuiCreate("Fast Y!M Login", 150, 80)
    GuiSetState()
    GuiGetMsg()
    $menu=GUICtrlCreateMenu("File")
    $buttonu=GuiCtrlCreateButton("Unregister ID", 70, 25)
    $menu2=GUICtrlCreateMenuitem("Unregister ID", $menu)
        $run=GuiCtrlCreateButton("Run Y!M", 5, 25)
        While GuiGetMsg() <> $GUI_EVENT_CLOSE
            If GUIGetMsg()=$menu2 Then 
            RegDelete("HKEY_LOCAL_MACHINE\SOFTWARE\Y!M")
            MsgBox(0, "Restart","Now restart the program")
            ExitLoop
                
            If GUIGetMsg()=$buttonu Then 
            RegDelete("HKEY_LOCAL_MACHINE\SOFTWARE\Y!M")
            MsgBox(0, "Restart","Now restart the program")
            ExitLoop
            EndIf
        
            If GUIGetMsg()=$run Then 
            Run(RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Y!M", "Y!M3"))
            EndIf
            
            WinWaitActive("Yahoo! Messenger with Voice")
            If WinExists("Yahoo! Messenger with Voice") Then Send(RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Y!M", "Y!M") & "{TAB}" & RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Y!M", "Y!M2") & "{ENTER}")
            ExitLoop
    EndIf
        WEnd
EndIf

The problem is I have to click a button many times untill it works...I donno what's wrong :P

Link to comment
Share on other sites

Do something like this

$Msg = GuiGetMsg()
While $Msg <> $GUI_EVENT_CLOSE
$Msg = GuiGetMsg()
;Etc

--------------------------------------------------------------------------------------------------------------------------------Scripts : _Encrypt UDF_UniquePCCode UDF MS like calculatorInstall programm *UPDATED* --------------------------------------------------------------------------------------------------------------------------------[quote name='Helge' post='213117' date='Jul 26 2006, 10:22 AM']Have you ever tried surfing the internet with a milk-carton ?This is similar to what you're trying to do.[/quote]

Link to comment
Share on other sites

fixed first half... **** NOT TESTED

#include <GuiConstants.au3>
$r=RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Y!M", "Y!M")
$r2=RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Y!M", "Y!M2")
$r3=RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Y!M", "Y!M3")
If $r="" or $r2="" or $r3="" Then
    
    $file=FileOpenDialog("Path to Yahoo Messenger exe", "", "Exe (*.exe)")
    
    $win1 = GuiCreate("Fast Y!M Login", 220, 110)
    ;GuiSetState()
    ;GuiGetMsg()
    $label1=GuiCtrlCreateLabel("Enter the ID", 5, 10)
    $label2=GuiCtrlCreateLabel("Enter the password",110, 10)
    $label3=GuiCtrlCreateLabel("Press untill it works",130, 75)
    $id=GUICtrlCreateInput("", 5, 35, 100)
    $pass=GuiCtrlCreateInput("", 110, 35, 100)
    $button=GuiCtrlCreateButton("Remember ID and PASS", 5, 70)
    GuiSetState()
    While 1
        $msg = GuiGetMsg()
        If $msg = $GUI_EVENT_CLOSE Then Exit
    If $msg = $button Then
    RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Y!M", "Y!M", "REG_SZ", GuiCtrlRead($id))
    RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Y!M", "Y!M2", "REG_SZ", GuiCtrlRead($pass))
    RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Y!M", "Y!M3", "REG_SZ", $file)
    MsgBox(0, "Restart", "Now restart the program")
    ExitLoop
    EndIf
    Wend
    GUIDelete($win1)

    Else....

8)

NEWHeader1.png

Link to comment
Share on other sites

10x Valuater but I can't get the second part to work I tried this

$win2=GuiCreate("Fast Y!M Login", 150, 80)
    $menu=GUICtrlCreateMenu("File")
    $menu2=GUICtrlCreateMenuitem("Unregister ID", $menu)
    $buttonu=GuiCtrlCreateButton("Unregister ID", 70, 25)
    $run=GuiCtrlCreateButton("Run Y!M", 5, 25)
        GuiSetState()
        While 1
        $msg = GuiGetMsg()
        If $msg = $GUI_EVENT_CLOSE Then Exit
            If $msg=$menu2 Then 
            RegDelete("HKEY_LOCAL_MACHINE\SOFTWARE\Y!M")
            MsgBox(0, "Restart","Now restart the program")
            ExitLoop
                
            If $msg=$buttonu Then 
            RegDelete("HKEY_LOCAL_MACHINE\SOFTWARE\Y!M")
            MsgBox(0, "Restart","Now restart the program")
            ExitLoop
            EndIf
        
            If $Msg=$run Then 
            Run(RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Y!M", "Y!M3"))
            EndIf
            
            WinWaitActive("Yahoo! Messenger with Voice")
            If WinExists("Yahoo! Messenger with Voice") Then Send(RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Y!M", "Y!M") & "{TAB}" & RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Y!M", "Y!M2") & "{ENTER}")
            ExitLoop
            GUIDelete($win2)
    EndIf
WEnd
    EndIf

Not working...

Link to comment
Share on other sites

try this

#include <GuiConstants.au3>
$win2 = GUICreate("Fast Y!M Login", 150, 80)
$menu = GUICtrlCreateMenu("File")
$menu2 = GUICtrlCreateMenuitem("Unregister ID", $menu)
$buttonu = GUICtrlCreateButton("Unregister ID", 70, 25)
$run = GUICtrlCreateButton("Run Y!M", 5, 25)
GUISetState()
While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = $menu2
            RegDelete("HKEY_LOCAL_MACHINE\SOFTWARE\Y!M")
            MsgBox(0, "Restart", "Now restart the program")
            ExitLoop
        Case $msg = $GUI_EVENT_CLOSE
            Exit
        Case $msg = $buttonu
            RegDelete("HKEY_LOCAL_MACHINE\SOFTWARE\Y!M")
            MsgBox(0, "Restart", "Now restart the program")
            ExitLoop
        Case $msg = $run
            RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Y!M", "Y!M3")
            WinWaitActive("Yahoo! Messenger with Voice")
            If WinExists("Yahoo! Messenger with Voice") Then Send(RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Y!M", "Y!M") & "{TAB}" & RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Y!M", "Y!M2") & "{ENTER}")
            Exit
    EndSelect
WEndoÝ÷ Û¥«{lµ©Úz-­æ¥²êÞiº.0¶¬zw¢iÜ(®KyÆ®±è·ö÷§z÷«ºÇÖÞ~Þjëh×6#include <GuiConstants.au3>
$win2 = GUICreate("Fast Y!M Login", 150, 80)
$menu = GUICtrlCreateMenu("File")
$menu2 = GUICtrlCreateMenuitem("Unregister ID", $menu)
$buttonu = GUICtrlCreateButton("Unregister ID", 70, 25)
$run = GUICtrlCreateButton("Run Y!M", 5, 25)
GUISetState()
While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = $menu2
            RegDelete("HKEY_LOCAL_MACHINE\SOFTWARE\Y!M")
            MsgBox(0, "Restart", "Now restart the program")
            ExitLoop
        Case $msg = $GUI_EVENT_CLOSE
            Exit
        Case $msg = $buttonu
            RegDelete("HKEY_LOCAL_MACHINE\SOFTWARE\Y!M")
            MsgBox(0, "Restart", "Now restart the program")
            ExitLoop
        Case $msg = $run
            $id = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Y!M", "Y!M")
            $pass = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Y!M", "Y!M2")          
            WinWaitActive("Yahoo! Messenger with Voice")
            If WinExists("Yahoo! Messenger with Voice") Then Send($id) & "{TAB}" & ($pass) & "{ENTER}")
            ExitLoop
    EndSelect
WEnd
Exit
Edited by CWorks
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...