Jump to content
Sign in to follow this  
Coder_Noob

Whats wrong with this code?

Recommended Posts

Coder_Noob

#include <GuiConstants.au3>

If Not IsDeclared('WS_CLIPSIBLINGS') Then Global $WS_CLIPSIBLINGS = 0x04000000

GuiCreate("MyGUI", 355, 63,(@DesktopWidth-355)/2, (@DesktopHeight-63)/2 , $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS)

$Input_1 = GuiCtrlCreateInput("Type Here!", 60, 10, 180, 20)
$Button_2 = GuiCtrlCreateButton("Go", 250, 10, 100, 20)
$Label_3 = GuiCtrlCreateLabel("Enter the name of a Window (E.G AOL 9.0) and click go", 60, 40, 290, 20)
$Icon_4 = GuiCtrlCreateIcon("Ico1", 0, 10, 10, 32, 40)

GuiSetState()
While 1
    $msg = GuiGetMsg()
    Select
    Case $msg = $GUI_EVENT_CLOSE
        ExitLoop
    Case Else
    ;;;
    Case $guimsg = $Button_2
    while 1
    $Proc WinGetProcess($Input_1)
    tooltip($Proc)
    sleep(100)
    wend
    EndSelect
WEnd
Exit

When i click 'Go' nothing happens, whats wrong?


Avatar made on Gmod for HL2 by me!Name on Gmod: Oclops

Share this post


Link to post
Share on other sites
seandisanti

#include <GuiConstants.au3>

If Not IsDeclared('WS_CLIPSIBLINGS') Then Global $WS_CLIPSIBLINGS = 0x04000000

GuiCreate("MyGUI", 355, 63,(@DesktopWidth-355)/2, (@DesktopHeight-63)/2 , $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS)

$Input_1 = GuiCtrlCreateInput("Type Here!", 60, 10, 180, 20)
$Button_2 = GuiCtrlCreateButton("Go", 250, 10, 100, 20)
$Label_3 = GuiCtrlCreateLabel("Enter the name of a Window (E.G AOL 9.0) and click go", 60, 40, 290, 20)
$Icon_4 = GuiCtrlCreateIcon("Ico1", 0, 10, 10, 32, 40)

GuiSetState()
While 1
    $msg = GuiGetMsg()
    Select
    Case $msg = $GUI_EVENT_CLOSE
        ExitLoop
    Case Else
;;;
    Case $guimsg = $Button_2
    while 1
    $Proc WinGetProcess($Input_1)
    tooltip($Proc)
    sleep(100)
    wend
    EndSelect
WEnd
Exit

When i click 'Go' nothing happens, whats wrong?

your case else is being called, and doing nothing, so the select structure exits before the button case. remove the case else if it does nothing, or move it below the case for the button.

Share this post


Link to post
Share on other sites
SmOke_N

#include <GuiConstants.au3>

If Not IsDeclared('WS_CLIPSIBLINGS') Then Global $WS_CLIPSIBLINGS = 0x04000000

GuiCreate("MyGUI", 355, 63,(@DesktopWidth-355)/2, (@DesktopHeight-63)/2 , $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS)

$Input_1 = GuiCtrlCreateInput("Type Here!", 60, 10, 180, 20)
$Button_2 = GuiCtrlCreateButton("Go", 250, 10, 100, 20)
$Label_3 = GuiCtrlCreateLabel("Enter the name of a Window (E.G AOL 9.0) and click go", 60, 40, 290, 20)
$Icon_4 = GuiCtrlCreateIcon("Ico1", 0, 10, 10, 32, 40)

GuiSetState()
While 1
    $msg = GuiGetMsg()
    Select
    Case $msg = $GUI_EVENT_CLOSE
        ExitLoop
    Case Else
;;;
    Case $guimsg = $Button_2
    while 1
    $Proc WinGetProcess($Input_1)
    tooltip($Proc)
    sleep(100)
    wend
    EndSelect
WEnd
Exit

When i click 'Go' nothing happens, whats wrong?

Case $guimsg = $Button_2

Case $msg = $Button_2

Edit:

Remove the Case Else as camerons dad suggested and:

$Proc WinGetProcess($Input_1)

Is probably going to thro an error too... no '=' sign. 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.

Share this post


Link to post
Share on other sites
seandisanti

Case $msg = $Button_2

Is probably going to thro an error too... no '=' sign.

good eye. i found one issue and stopped looking...my bad

Share this post


Link to post
Share on other sites
Coder_Noob

ty!


Avatar made on Gmod for HL2 by me!Name on Gmod: Oclops

Share this post


Link to post
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
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.