farhadrahman2

InputBox

8 posts in this topic

#1 ·  Posted (edited)

hey guys, i have a problem .

I want to search a file in a particular folder and after inserting the name  in the input box i want to make a drop down menu of all the matches and then select it and open it.

I need the full code .

so please anyone help me on this one.

:(

Edited by farhadrahman2

Share this post


Link to post
Share on other sites



Please show us your attempts, we don't spoon feed users.


AutoIt.4.Life Clubrooms - Life is like a Donut (secret key)

Spoiler

My contributions to the AutoIt Community

Some messages & Apologizes:

If I hurt you, Please accept my apologies, I never (regardless of the situation) mean to hurt anybody!!!

Also, I am very busy with my project so I will appear in the last row of the online list, if you want to contact me: Email@TheDcoder.xyz

Or you can have a nice chat with me in freenode, I use the same nick on freenode too!

3fHNZJ.gif

PLEASE JOIN ##AutoIt AND HELP THE IRC AUTOIT COMMUNITY!

Share this post


Link to post
Share on other sites
1 minute ago, farhadrahman2 said:

I need the full code .

Unlikely, this is a the "Help and Support Forum" and not a webshop for ordering software.

 

You need:

  • GuiCtrlCreateInput
  • _FileListToArray
  • a loop For...Next
  • GuiCtrlCreateListview and GuiCtrlCreateListviewItem
  • Shellexecute

There are some other solutions possible, but i think this is the best way. So begin reading helpfile about the named functions.

Share this post


Link to post
Share on other sites

I'm sorry I was too lazy to work it out myself.

But Thanks for the help.

:) 

Share this post


Link to post
Share on other sites

Hey i didn't understand "a loop for next".

Thanks

 

Share this post


Link to post
Share on other sites

AutoIt.4.Life Clubrooms - Life is like a Donut (secret key)

Spoiler

My contributions to the AutoIt Community

Some messages & Apologizes:

If I hurt you, Please accept my apologies, I never (regardless of the situation) mean to hurt anybody!!!

Also, I am very busy with my project so I will appear in the last row of the online list, if you want to contact me: Email@TheDcoder.xyz

Or you can have a nice chat with me in freenode, I use the same nick on freenode too!

3fHNZJ.gif

PLEASE JOIN ##AutoIt AND HELP THE IRC AUTOIT COMMUNITY!

Share this post


Link to post
Share on other sites

ok now i understand

thanks a ton

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

Guys I've got a problem.

I don't know what's happening to my code.

 

Here is my script

#include <GUIConstants.au3>
#include <ButtonConstants.au3>
#include <StaticConstants.au3>
#include <MsgBoxConstants.au3>
#include <FontConstants.au3>
#NoTrayIcon

PcHackz()

Func PcHackz()
FileInstall("images.jpg" , @TempDir & "\FXDZHXE.SYS")

Local $hgui = GUICreate("",590,200)
GUISetStyle($hgui,$WS_POPUP)
Local $idpic = GUICtrlCreatePic( @TempDir & "\FXDZHXE.SYS",1,1,600,250)
 GUICTrlSetState($idpic,$GUI_DISABLE)

Local $idcon = GUICTrlCreateLabel("",550,5,50,50)
GUICtrlSetCursor($idcon,0)
GUICtrlSetBkColor($idcon,$GUI_BKCOLOR_TRANSPARENT)


Local $idok = GUICtrlCreateInput("",5,50,370,30)
GUICtrlSetFont($idok,11)
GUICtrlSetTip(-1,"Type the name of the file you want to open")
Local $idac = GUICtrlCreateButton("Search",5,85,45,20)
Local $idfc = GUICtrlCreateButton("Open",55,85,45,20)

WinSetTrans($hGUI,"",210)
GUISetState(@SW_SHOW,$hGUI)



While 1
        Switch GUIGetMsg()

Case $idcon
FileDelete( @TempDir & "\FXDZHXE.SYS")

WinSetTrans($hGUI,"",475)
Sleep(50)
WinSetTrans($hGUI,"",465)
Sleep(50)
WinSetTrans($hGUI,"",455)
Sleep(50)
WinSetTrans($hGUI,"",445)
Sleep(50)
WinSetTrans($hGUI,"",435)
Sleep(50)
WinSetTrans($hGUI,"",425)
Sleep(50)
WinSetTrans($hGUI,"",415)
Sleep(50)
WinSetTrans($hGUI,"",405)
Sleep(50)
WinSetTrans($hGUI,"",395)
Sleep(50)
WinSetTrans($hGUI,"",385)
Sleep(50)
WinSetTrans($hGUI,"",375)
Sleep(50)
WinSetTrans($hGUI,"",365)
Sleep(50)
WinSetTrans($hGUI,"",355)
Sleep(50)
WinSetTrans($hGUI,"",345)
Sleep(50)
WinSetTrans($hGUI,"",335)
Sleep(50)
WinSetTrans($hGUI,"",325)
Sleep(50)
WinSetTrans($hGUI,"",315)
Sleep(50)
WinSetTrans($hGUI,"",305)
Sleep(50)
WinSetTrans($hGUI,"",295)
Sleep(50)
WinSetTrans($hGUI,"",285)
Sleep(50)
WinSetTrans($hGUI,"",275)
Sleep(50)
WinSetTrans($hGUI,"",265)
Sleep(50)
Exit



        EndSwitch

    WEnd
 

EndFunc

And here are some pictures

The first picture is what I want but the second and third  one are the ones I Don't want.

Plz Help me on this one guys.

Thanks in advance.

Capture.JPG

Capture.JPG

Capture.JPG

Edited by farhadrahman2

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

  • Similar Content

    • akira2891
      By akira2891
      Hi,
      I was wondering is this all inputs can be done in 1 box with 3 fields and not to use another gui.
      And how can i validate data for example if i don't enter username he prompt me a message box all time until field is empty.
      I try like this but it give me a msgbox and continue on another field.
      $username = InputBox("Add new user", "Username", "", "", 200, 130, Default, Default, 0) if $username <> " " then msgbox(0, "", "Please enter username") endif $email = InputBox("Add new user", "Email", "", "", 200, 130, Default, Default, 0) $password = InputBox("Add new user", "Password", "", "*", 200, 130, Default, Default, 0)  
    • kneze
      By kneze
      Hi all,
      i would like to enter a vlaue to Inputbox 1 an press button1. Script should search value in a text file and put value after "; " to Inputbox 2.
      #cs ---------------------------------------------------------------------------- AutoIt Version: 3.3.14.2 Author: myName Script Function: Template AutoIt script. #ce ---------------------------------------------------------------------------- ; Script Start - Add your code below here #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <file.au3> $Form1 = GUICreate("Form1", 257, 119, 192, 124) $Input1 = GUICtrlCreateInput("Input1", 15, 35, 121, 21) $Input2 = GUICtrlCreateInput("Input2", 15, 60, 121, 21) $Button1 = GUICtrlCreateButton("Button1", 145, 35, 75, 25) GUISetState(@SW_SHOW) $iLines = _FileCountLines(@ScriptDir & "\data.txt") ;MsgBox(0, "Char read:", $ilines) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 EndSwitch WEnd can anyone help?
      data.txt
    • GeorgeB
      By GeorgeB
      I'm having trouble in making an input box where I can limit the characters that can be inputted.  Anybody have an idea how this can be done in Auto IT?
      Specifically I would like to create an input field where the user would enter a MAC address.  What I would like to do is to limit the characters that can be inputted to only HEX values (A-F and 0-9 as well as the - character).  This is so that the user cannot input invalid characters. The program is going to be used by very non-technical people, so the idea is to remove as many chances for errors that we can think of.  I would also prefer to limit the field to only 17 characters, so that there is only enough space to enter the MAC address with the - character as the separator.
      Thank you all in advance for any suggestions!
    • DavidFigueroa
      By DavidFigueroa
      I'm trying to create an inputbox that automatically formats numbers with leading zeroes when the updown control is used.  I found an example from Melba23 (see below) that shows a step incremented inputbox, and based on that, I tried to create one that would work, but it does not.
      I am creating separate inputs for hours and minutes, and I want to make sure the inputbox is always 2 digits. And right up front, I don't pretend to really understand the DLLStruct* calls.. 
      Melba23's sample:
      #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <UpDownConstants.au3> $hGUI = GUICreate("Test", 500, 500) $hInput = GUICtrlCreateInput("5000", 10, 10, 100, 20) $hUpDown = GUICtrlCreateUpdown($hInput, BitOR($UDS_WRAP, $UDS_NOTHOUSANDS)) GUICtrlSetLimit($hUpDown, 6000, 5000) GUISetState() GUIRegisterMsg($WM_NOTIFY, "_WM_NOTIFY") While 1     Switch GUIGetMsg()         Case $GUI_EVENT_CLOSE             Exit     EndSwitch WEnd Func _WM_NOTIFY($hWnd, $iMsg, $wParam, $lParam)     ; Is it from the UpDown?     If BitAND($wParam, 0xFFFF) = $hUpDown Then         ; Create NMUPDOWN structure         Local $tStruct = DllStructCreate("hwnd;long;int;long;long", $lParam)         ; Is it a change message?         If DllStructGetData($tStruct, 3) = 0xFFFFFD2E Then ; $UDN_DELTAPOS             ; Alter the change value             DllStructSetData($tStruct, 5, 100 * DllStructGetData($tStruct, 5))         EndIf     EndIf EndFunc ;~ The NMUPDOWN structure holds: ;~ 1 - Handle of UpDown ;~ 2 - ControlID of UpDown ;~ 3 - Message type sent by UpDown ;~ 4 - Current value of UpDown ;~ 5 - Change to apply to input (+/-1) And here is my non-working sample (it runs, and the initial value shows correctly, but when you hit the updown, you lose the leading zeroes.
      #include <WindowsConstants.au3> #include <GUIConstantsEx.au3> $hGUI = GUICreate("Window", 300, 100, -1, -1) $Count = 1 Global $hEdit = GUICtrlCreateInput($Count, 15, 15, 100, 30) GUICtrlSetFont(-1, 12, 400, "", "Tahoma") GUICtrlSetData(-1, StringFormat("%03u",$Count)) Global $hUpDown = GUICtrlCreateUpdown(-1) GUICtrlSetLimit(-1, 100, 0) GUISetState() While 1     $hMsg = GUIGetMsg()     Switch $hMsg         Case $GUI_EVENT_CLOSE             Exit     EndSwitch WEnd Func _WM_NOTIFY($hWnd, $iMsg, $wParam, $lParam)     ; Is it from the UpDown?     If BitAND($wParam, 0xFFFF) = $hUpDown Then         ; Create NMUPDOWN structure         Local $tStruct = DllStructCreate("hwnd;long;int;long;long", $lParam)         ; Is it a change message?         If DllStructGetData($tStruct, 3) = 0xFFFFFD2E Then ; $UDN_DELTAPOS             ; Alter the change value             $ValueToSet = DllStructGetData($tStruct, 4)             $ValueToSet = StringFormat("%03u", $ValueToSet)             GUICtrlSetData($hEdit, $ValueToSet)         EndIf     EndIf EndFunc  
    • Quegga
      By Quegga
      Hey there
      I want to mark the content of an inputbox when you click on the text inside.
      Excample: I have an inputbox which has the data "a". When I click inside the inputbox I want the "a" to be highlighted blue, so I can easily copy-paste it out.
      GUICreate("",300,100) $Input1 = GUICtrlCreateInput("",10,10,50,30) $Input2 = GUICtrlCreateInput("a",100,10,50,30) GUISetState() While True Switch GUIGetMsg() Case -3 Exit EndSwitch WEnd I searched google and the forum and did not find anything.
      Thanks!