Sign in to follow this  
Followers 0
XInFisk

Ned help with some GUICtrlCreateInput

5 posts in this topic

hey.. i got a little problem that i can't fix. I've tried to figure it out in one hour now... But i can't, that's why i ask here.

I got this code:

HotKeySet("{ENTER}", "sendcmd")

$Cmd = GUICtrlCreateInput("", 1, 240, 616, 21, 0)

Func sendcmd()
    If GUICtrlRead($cmd) = "" Then 
        GUICtrlSetData($Console , GUICtrlRead($Console) & @CRLF & "Ops! You need to write something" & @CRLF)
        Else
        _ConsoleWrite(GUICtrlRead($Console) & @CRLF & GUICtrlRead($cmd))
        _Done()
        GUICtrlSetData($cmd , "")
    EndIf
EndFunc

Func _Done()
If GUICtrlRead($cmd) = "ClipPut" Then
    $ClipPut = ClipPut($ClipPutValue)
    _ConsoleWrite("Done! Clipboard is now: " & $ClipPutValue)
EndIf
EndFunc

Okay.. I need to be able to write ex. ClipPut chickens in the water.

and then it should set "Chikens in the water" to a variable called $ClipPutValue

I hope someone can help me out.

-XInFisk

Share this post


Link to post
Share on other sites



Hello.

I'm a newbe myself.

1st I recognize, that I had to change "_consolewrite" to "consolewrite": Maybe your are not using the latest version?

HotKeySet("{ENTER}", "sendcmd")

$Cmd = GUICtrlCreateInput("", 1, 240, 616, 21, 0)

Func sendcmd()
    If GUICtrlRead($cmd) = "" Then 
        GUICtrlSetData($Console , GUICtrlRead($Console) & @CRLF & "Ops! You need to write something" & @CRLF)
        Else
        _ConsoleWrite(GUICtrlRead($Console) & @CRLF & GUICtrlRead($cmd))
        _Done()
        GUICtrlSetData($cmd , "")
    EndIf
EndFunc

Func _Done()
If GUICtrlRead($cmd) = "ClipPut" Then
    $ClipPut = ClipPut($ClipPutValue)
    _ConsoleWrite("Done! Clipboard is now: " & $ClipPutValue)
EndIf
EndFuncoÝ÷ Ûú®¢×¶Ö(¹×wº×hnz-ºÇ¿o*.®Ü(~éܶ*'±«­¢+Ù!½Ñ-åMÐ ÅÕ½Ðíí9QIôÅÕ½Ðì°ÅÕ½Ðí͹µÅÕ½Ðì¤((ÀÌØí
µôU%
Ñɱ
ÉÑ%¹ÁÕÐ ÅÕ½ÐìÅÕ½Ðì°Ä°ÈÐÀ°ØÄØ°ÈÄ°À¤()չ͹µ ¤(í½±±ÁÍ)¹Õ¹()Õ¹}½¹ ¤(í½±±ÁÍ)¹Õ¹oÝ÷ ÛzÝ«ÞjZ(«mè^âà +k*Þj×­jëh×6#include <GUIConstants.au3>

GUICreate(" My GUI input acceptfile", 320,120, @DesktopWidth/2-160, @DesktopHeight/2-45, -1, 0x00000018); WS_EX_ACCEPTFILES
$file = GUICtrlCreateInput ( "", 10,  5, 300, 20)
GUICtrlSetState(-1,$GUI_ACCEPTFILES)
GUICtrlCreateInput ("", 10,  35, 300, 20)   ; will not accept drag&drop files
$btn = GUICtrlCreateButton ("Ok", 40,  75, 60, 20)

GUISetState () 

$msg = 0
While $msg <> $GUI_EVENT_CLOSE
       $msg = GUIGetMsg()
       Select
           Case $msg = $btn
               exitloop
       EndSelect
Wend

MsgBox (4096, "drag drop file", GUICtrlRead($file))

Regards, Rudi.


Earth is flat, pigs can fly, and Nuclear Power is SAFE!

Share this post


Link to post
Share on other sites

Hello.

I'm a newbe myself.

1st I recognize, that I had to change "_consolewrite" to "consolewrite": Maybe your are not using the latest version?

HotKeySet("{ENTER}", "sendcmd")

$Cmd = GUICtrlCreateInput("", 1, 240, 616, 21, 0)

Func sendcmd()
    If GUICtrlRead($cmd) = "" Then 
        GUICtrlSetData($Console , GUICtrlRead($Console) & @CRLF & "Ops! You need to write something" & @CRLF)
        Else
        _ConsoleWrite(GUICtrlRead($Console) & @CRLF & GUICtrlRead($cmd))
        _Done()
        GUICtrlSetData($cmd , "")
    EndIf
EndFunc

Func _Done()
If GUICtrlRead($cmd) = "ClipPut" Then
    $ClipPut = ClipPut($ClipPutValue)
    _ConsoleWrite("Done! Clipboard is now: " & $ClipPutValue)
EndIf
EndFuncoÝ÷ Ûú®¢×¶Ö(¹×wº×hnz-ºÇ¿o*.®Ü(~éܶ*'±«­¢+Ù!½Ñ-åMÐ ÅÕ½Ðíí9QIôÅÕ½Ðì°ÅÕ½Ðí͹µÅÕ½Ðì¤((ÀÌØí
µôU%
Ñɱ
ÉÑ%¹ÁÕÐ ÅÕ½ÐìÅÕ½Ðì°Ä°ÈÐÀ°ØÄØ°ÈÄ°À¤()չ͹µ ¤(í½±±ÁÍ)¹Õ¹()Õ¹}½¹ ¤(í½±±ÁÍ)¹Õ¹oÝ÷ ÛzÝ«ÞjZ(«mè^âà +k*Þj×­jëh×6#include <GUIConstants.au3>

GUICreate(" My GUI input acceptfile", 320,120, @DesktopWidth/2-160, @DesktopHeight/2-45, -1, 0x00000018); WS_EX_ACCEPTFILES
$file = GUICtrlCreateInput ( "", 10,  5, 300, 20)
GUICtrlSetState(-1,$GUI_ACCEPTFILES)
GUICtrlCreateInput ("", 10,  35, 300, 20)   ; will not accept drag&drop files
$btn = GUICtrlCreateButton ("Ok", 40,  75, 60, 20)

GUISetState () 

$msg = 0
While $msg <> $GUI_EVENT_CLOSE
       $msg = GUIGetMsg()
       Select
           Case $msg = $btn
               exitloop
       EndSelect
Wend

MsgBox (4096, "drag drop file", GUICtrlRead($file))

Regards, Rudi.


Earth is flat, pigs can fly, and Nuclear Power is SAFE!

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Sorry... I was really tired that night.. So i didn't really get it. Just one thing.. Please don't call me stupid in that way... it dosn't really help me. Btw. "_consolewrite" works just fine with my other code.

ops.. i didn't write my whole script. Just needed help with storing the input from GuiCtrlCreateInput into more variables..

-XInFisk

Edited by XInFisk

Share this post


Link to post
Share on other sites

It's 'Oops' with two o's :whistle:

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  
Followers 0