Jump to content
Sign in to follow this  
TheFridgeMaster

Gui help

Recommended Posts

TheFridgeMaster

Hey guys,

i am bored so i thought i would try some harder stuff in auto it (noobie)

i want to be able to make so when i put an input in and press a button,

what ever is in the input fields is sent to a command promt window in a specific order.

would appreciate some help

cheers,

Kyle.

Share this post


Link to post
Share on other sites
enaiman

GUICtrlRead - to get the info from inputboxes

open cmd

Send - send commands to cmd window (be sure to keep active that window or send will fail)


SNMP_UDF ... for SNMPv1 and v2c so far, GetBulk and a new example script

wannabe "Unbeatable" Tic-Tac-Toe

Paper-Scissor-Rock ... try to beat it anyway :)

Share this post


Link to post
Share on other sites
TheFridgeMaster

thanks man

one more thing,

how exactly would i write it out?

like an example of send something to cmd via input box.

cheers,

Kyle.

Share this post


Link to post
Share on other sites
enaiman

Use Koda (SciTE - Tools - Koda) to design your GUI. After that use the help to read about commands.

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

Opt("GUIOnEventMode", 1)
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 156, 105, 193, 125)
GUISetOnEvent($GUI_EVENT_CLOSE, "Form1Close")
$Button1 = GUICtrlCreateButton("Button1", 40, 64, 75, 25, 0)
GUICtrlSetOnEvent(-1, "Button1Click")
$Input1 = GUICtrlCreateInput("Input1", 16, 24, 121, 21)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    Sleep(100)
WEnd

Func Button1Click()
    Run("cmd.exe")
    Sleep(1000)
    Send(GUICtrlRead($Input1))
EndFunc
Func Form1Close()
    Exit
EndFunc

SNMP_UDF ... for SNMPv1 and v2c so far, GetBulk and a new example script

wannabe "Unbeatable" Tic-Tac-Toe

Paper-Scissor-Rock ... try to beat it anyway :)

Share this post


Link to post
Share on other sites
TheFridgeMaster

OH MY GOD!!!

cheers man

i've been playing around with it and getting my head around it

i'm nearly done with my program

only 1 bug, when i run it, it maxes out my cpu :S

once again, thanks man.

Share this post


Link to post
Share on other sites
enaiman

Maxing the CPU usage is a known issue when you don't have any Sleep in your main loop.

In my example if you comment the Sleep(100) line it will bring your CPU to 100%.


SNMP_UDF ... for SNMPv1 and v2c so far, GetBulk and a new example script

wannabe "Unbeatable" Tic-Tac-Toe

Paper-Scissor-Rock ... try to beat it anyway :)

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.