Jump to content

Recommended Posts

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.


A cross-platform implementation of the AutoIt language

My contributions to the AutoIt Community ##AutoIt at freenode, real-time chat

3fHNZJ.gif

Spoiler

If I have hurt or offended you in anyway, Please accept my apologies, I never (regardless of the situation) intend to do that to anybody.

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

A cross-platform implementation of the AutoIt language

My contributions to the AutoIt Community ##AutoIt at freenode, real-time chat

3fHNZJ.gif

Spoiler

If I have hurt or offended you in anyway, Please accept my apologies, I never (regardless of the situation) intend to do that to anybody.

Share this post


Link to post
Share on other sites

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

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By nooneclose
      Why can I not click on either of my input fields?
      #Region ### START Koda GUI section ### Form= Global $Form1 = GUICreate("Form1", 730, 437, 192, 124) ;GUISetFont(14, 800, 0, "MS Sans Serif") GUISetBkColor(0xC0DCC0) Global $Label1 = GUICtrlCreateLabel("Enter your Password. UserName is auto filled", 62, 40, 604, 41, $SS_CENTER) GUICtrlSetFont(-1, 26, 800, 0, "MS Sans Serif") Global $Label2 = GUICtrlCreateLabel("User Name:", 120, 130, 604, 31, $SS_LEFT) GUICtrlSetFont(-1, 20, 800, 0, "MS Sans Serif") Global $Label3 = GUICtrlCreateLabel("Password:", 135, 210, 604, 31, $SS_LEFT) GUICtrlSetFont(-1, 20, 800, 0, "MS Sans Serif") Global $Input1 = GUICtrlCreateInput(@UserName, 274, 130, 185, 32) GUICtrlSetFont(-1, 14, 800, 1, "MS Sans Serif") Global $Input2 = GUICtrlCreateInput("Password", 274, 210, 185, 32, $ES_PASSWORD) GUICtrlSetFont(-1, 14, 800, 0, "MS Sans Serif") Global $OK = GUICtrlCreateButton("OK", 274, 270, 185, 57) GUICtrlSetFont(-1, 20, 800, 0, "MS Sans Serif") GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $OK Global $UserName = GUICtrlRead($Input1) Global $PassWord = GUICtrlRead($Input2) ExitLoop EndSwitch WEnd ; Delete the GUI window GUIDelete()  
    • By matwachich
      Hi AutoIters!
      Here is my new UDF about GUIs: it's an enhanced mixture of Advanced InputBox (deprecated) and KODA Parser (deprecated), with additional functions.
      What you can do with it:
      Parse KODA files and directly create GUIs (_GUIUtils_CreateFromKODA) Parse a simple JSON form definition to simply create advanced InputBoxes with any amount/type of input controls (_GUIUtils_CreateFromJSON) Created GUIs are returned as Scripting.Dictionary objects, and you have helper functions to access GUIs controls by their names (_GUIUtils_HWnd, _GUIUtils_CtrlID, _GUIUtils_HCtrl ...) A function that can make a GUI created from KODA/JSON (defined by it's $oForm object) and make it a modal InputDialogBox (just like InputBox, but returns all entered data as Scripting.Dictionary object) Functions are documented, and there are some examples.
      Consider this UDF as beta, but since I'm currently using it in a small commercial project, it should become production ready in near future.
      To always get the latest code version, get it from Github (more up to date than this topic).
      Update 04/02/2020:
      New simple application example Fixed focused control handling in _GUIUtils_InputDialog Reset input values before returning from _GUIUtils_InputDialog Fixed CloseOnEsc in _GUIUtils_InputDialog Fixed Input not reset Fixed all ListBox items are selected Project now on GitHub https://github.com/matwachich/autoit-guiutils/
      Update 05/02/2020:
      Support for nodate for Date and Time input controls (pass null value) New handling of focused control _GUIUtils_InputDialog: Now, you can specify the focused control in $oInitialData by setting "controlName:focus" = True Updated documentation of _GUIUtils_InputDialog Update 07/02/2020:
      Bug corrected when setting Data input control Added: abillity to read a single input control New functions (_GUIUtils_GetInputs, _GUIUtils_WriteInputs), documentation completion. Readme file and screenshots on Github Page  
      GUIUtils.zip
    • By matwachich
      DEPRECATED: see this new UDF
       
    • By robertocm
      I'm trying to use some inputboxes as radio buttons.
      This code seems to work ok, but don't know if there's is a better 'option'
      #include <GUIConstantsEx.au3> #include <GuiConstants.au3> GUIRegisterMsg($WM_COMMAND, "WM_COMMAND") Global $aInput[4] $hGUI = GUICreate("Test", 500, 500) $aInput[0] = GUICtrlCreateInput("Some text 1a", 10, 10, 200, 24) $aInput[1] = GUICtrlCreateInput("Some text 1b", 10, 40, 200, 24) $aInput[2] = GUICtrlCreateInput("Some text 2a", 10, 80, 200, 24) $aInput[3] = GUICtrlCreateInput("Some text 2b", 10, 110, 200, 24) GUISetState(@SW_SHOW, $hGUI) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd Func WM_COMMAND($hWnd, $msg, $wParam, $lParam) Local $nNotifyCode = BitShift($wParam, 16) ; high word Local $nID = BitAND($wParam, 0xFFFF) ; low word Local $hCtrl = $lParam Switch $nID Case $aInput[0] Switch $nNotifyCode Case $EN_SETFOCUS GUICtrlSetBkColor($aInput[0], 0x98FB98) GUICtrlSetBkColor($aInput[1], 0xD3D3D3) EndSwitch Case $aInput[1] Switch $nNotifyCode Case $EN_SETFOCUS GUICtrlSetBkColor($aInput[0], 0xD3D3D3) GUICtrlSetBkColor($aInput[1], 0x98FB98) EndSwitch Case $aInput[2] Switch $nNotifyCode Case $EN_SETFOCUS GUICtrlSetBkColor($aInput[2], 0x98FB98) GUICtrlSetBkColor($aInput[3], 0xD3D3D3) EndSwitch Case $aInput[3] Switch $nNotifyCode Case $EN_SETFOCUS GUICtrlSetBkColor($aInput[2], 0xD3D3D3) GUICtrlSetBkColor($aInput[3], 0x98FB98) EndSwitch EndSwitch ; Proceed the default Autoit3 internal message commands. ; You also can complete let the line out. ; !!! But only 'Return' (without any value) will not proceed ; the default Autoit3-message in the future !!! Return $GUI_RUNDEFMSG EndFunc ;==>WM_COMMAND Would you recommend using _WinAPI_GetFocus instead?
       
       
      Thanks,
       
    • By Ackerz
      Hi guys,
      So I am trying to automate a task and this task has an input box with an already set character "9". 
      I have just decided that I don't really need the input as an option but it's good to leave however for this instance I would like it to run past this point automatically. I've tried numerous ways to try and automate the use of the "OK" button using ControlClick and various other options. I just can't seem to see where this point in the script is. Scoured the forums for anything similar but didn't have any luck finding anything. Sorry to be a pain and I hope someone can help, if I haven't explained in enough detail please don't hesitate to ask for more.
      Many thanks,
      Ackerz
       
      Local $len Local $n Local $buff Local $aMyDate $Len = InputBox("Test",$msgPrompt,"9") $len = StringStripWS($len,$STR_STRIPALL) ;Check that user has entered a vaild password length if not StringIsDigit($len) or $len = 0 Then MsgBox(48,"Error","Invaild Integer was entered" & @CRLF & "Program will now exit.") Exit EndIf ;This creates the random password. for $i = 1 to $Len ;Pick a random char between 1 and the pwsMask Length $n = int(random(1,StringLen($pwsMask))) ;Concat each char that has been picked out of pwsMask to $buff $buff = $Buff & StringMid($pwsmask,$n,1) Next  
×
×
  • Create New...