Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 08/21/2015 in all areas

  1. Okay, how about this? #include <WinAPISys.au3> Opt("WinTitleMatchMode", 2) ;1=start, 2=subStr, 3=exact, 4=advanced, -1 to -4=Nocase $windowTitle="Command Prompt" $windowHandle=WinActivate($windowTitle) $keyboard=_WinAPI_GetKeyboardLayout ($windowHandle) MsgBox(0,"Keyboard",$keyboard)
    1 point
  2. This is the same as the code in post 66, but the default code (to browse to the folder) is not executed when you double click or press Enter in the listview. This means that you have to do all the browsing in the treeview, and you can only select the folder in the listview. Windows Explorer example.7z Regards, Lars.
    1 point
  3. OhBobSaget, Try this combined version: #include <MsgBoxConstants.au3> Opt("TrayMenuMode", 3) ; Default tray menu items will not be shown. ; Read fileinto an array - no need to open/close it $lFTPList = FileReadToArray(@ScriptDir & "\FTPHosts.ini") ; Create array to hold trayitem ControlIDs Global $TrayItemFTPHosts[@extended] ; Create the tray items For $i = 0 To UBound($lFTPList) - 1 $TrayItemFTPHosts[$i] = TrayCreateItem($lFTPList[$i]) Next TrayCreateItem("") Local $idExit = TrayCreateItem("Quit") While 1 $iTrayEvent = TrayGetMsg() ; Look to see if it is an FTP item For $i = 0 To UBound($TrayItemFTPHosts) - 2 If $iTrayEvent = $TrayItemFTPHosts[$i] Then MsgBox($MB_SYSTEMMODAL, "Selected", $lFTPList[$i]) ExitLoop EndIf Next ; Check for exit If $iTrayEvent = $idExit Then Exit EndIf WEnd I used this file: FTPHost_0 FTPHost_1 FTPHost_2 FTPHost_3How is that? M23
    1 point
  4. Still confused on my side . Are you trying to detect the keyboard layout for the window with the title "Command Prompt" or are you trying to run your program from the command prompt to find the keyboard layout of another program/window?
    1 point
  5. wklw2005

    ControlSetText help

    Your the best SupaNewb, thank you very much!!!!
    1 point
  6. OhBobSaget, Do we assume that $Array holds the same number of elements as there are items within the tray menu? M23 Edit: Perhaps something along these lines? Opt("TrayMenuMode", 3) ; Default tray menu items will not be shown. $iCount = Number(InputBox("Number", "Choose how many")) Switch $iCount Case 1 To 5 Local $aArray[$iCount], $aDepotDocFTP[$iCount + 1] For $i = 0 To $iCount - 1 $aArray[$i] = $i $aDepotDocFTP[$i] = TrayCreateItem("FTP " & $i) Next TrayCreateItem("") $aDepotDocFTP[$i] = TrayCreateItem("Exit") EndSwitch While 1 $iTrayEvent = TrayGetMsg() For $i = 0 To UBound($aDepotDocFTP) - 2 If $iTrayEvent = $aDepotDocFTP[$i] Then ConsoleWrite("FTP " & $i & @CRLF) ExitLoop EndIf Next If $iTrayEvent = $aDepotDocFTP[UBound($aDepotDocFTP) - 1] Then Exit EndIf WEnd
    1 point
  7. kcvinu, It seems that removing checkboxes from certain TreeViewItems is not an easy task and involves user-drawn imagelists - not something with which I want to get involved as the UDF is complex enough already! But try this Beta code - you cannot select items which should not be returned, so in the example script I posted earlier, although the folders still have checkboxes, they cannot be selected: Any better? M23
    1 point
  8. Thanks. Will have a look on Monday when I return to my office.
    1 point
  9. kcvinu, Pretty obviously you cannot prevent it. if you want to expand a tree and only display a certain file type then you will always get "empty" places where none of the files are found. The only alternative would be to fully expand the tree, determine any completely empty branches, and then eliminate them before displaying the result. But as I found in the early versions of this UDF, expanding the whole tree before display was prohibitively slow - so I changed to the current method which only expands the tree branches when required. As a result you always get all the folders/subfolders within the tree, even when empty. But why do you see this as a problem? M23
    1 point
  10. kcvinu, This example script shows all the .exe files in the AutoIt installation - does it work for you? #include <MsgBoxConstants.au3> #include "ChooseFileFolder.au3" Global $sRootFolder = StringLeft(@AutoItExe, StringInStr(@AutoItExe, "\", Default, -1)) ConsoleWrite($sRootFolder & @CRLF) ; Register handlers Global $sRet = _CFF_RegMsg() If Not $sRet Then MsgBox(16, "Failure!", "Handler not registered") Exit EndIf $sRet = _CFF_Choose("Choose an .exe file", 300, 500, -1, -1, $sRootFolder, "*.exe", 0) If $sRet Then MsgBox($MB_SYSTEMMODAL + $MB_ICONINFORMATION, "Chosen", "Selected:" & @CRLF & @CRLF & $sRet) Else MsgBox($MB_SYSTEMMODAL + $MB_ICONINFORMATION, "Ooh Err", "No Selection") EndIfThere are some empty folders in the expanded tree - because there are no exe files within them. Is that what you meant by "empty items"? If so, then it is a not a bug but just the way that the UDF opens the tree - until a branch is expanded the UDF has no idea what is inside. Any subfolders are obviously shown as there might be other .exe files within them deeper n the tree. M23
    1 point
  11. kcvinu, If you set the $sMask parameter to ""*.exe" you should only get only the exe files displayed - as long as you have the $iDisplay parameter set correctly. Please let me see the code you are using to call the UDF - and if possible a screenshot of what you get returned along with a list of what is actually in there. That way I can try and reproduce the problem (if indeed there is one). M23
    1 point
  12. like water said switch doesn't work that way i guess you should change switch part While 1 $Msg = GUIGetMsg() Switch $Msg Case $GUI_EVENT_CLOSE Exit Case $BilgiGonder $UserData1 = GUICtrlRead($Ext) $UserData2 = GUICtrlRead($Colour) $UserData3 = GUICtrlRead($HexCode) ExitLoop EndSwitch WEndAlso you might need to declare $Test and remove the extra comma at line 19 $HexCode = GUICtrlCreateInput("", 50, 109, 193, 20,)
    1 point
  13. SupaNewb

    ControlSetText help

    ;taking a wild guess here lol. ControlFocus("CAESAR II 2014 - InstallShield Wizard", "&Serial Number:","[CLASS:Edit; INSTANCE:1]") Sleep(100) ControlSend("CAESAR II 2014 - InstallShield Wizard", "&Serial Number:","[CLASS:Edit; INSTANCE:1]", "123456789") ;OR ControlFocus("CAESAR II 2014 - InstallShield Wizard", "&Serial Number:","[CLASS:Edit; INSTANCE:1]") Sleep(100) Send("{NUMPAD1}{NUMPAD2}{NUMPAD3}{NUMPAD4}{NUMPAD5}{NUMPAD6}{NUMPAD7}{NUMPAD8}{NUMPAD9}{ENTER}")
    1 point
  14. LOL. (I heard the hipsters now say "haha"). Yes, I love your music. That said, do you mean something like this? run('cmd.exe') sleep(2000) send('reg query "HKEY_CURRENT_USER\Keyboard Layout\Preload"') send("{enter}")You can also use shellexecute and run but the command line window won't stay open.
    1 point
  15. If you want to make controls disappear/reappear, the best way is to show/hide them You need also to take care to exit loop when you're done #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <ButtonConstants.au3> Global $Form1 = GUICreate("Form1", 806, 456, -1, -1) Global $Button1 = GUICtrlCreateButton("START", 313, 144, 80, 38, $BS_CENTER) $progressbar = GUICtrlCreateProgress(235, 198, 333, 3) GUICtrlSetState(-1, $GUI_HIDE) $label = Guictrlcreatelabel("",235,198,333,1,0x01) Guictrlsetbkcolor(-1, $GUI_BKCOLOR_TRANSPARENT) GUICtrlSetState(-1, $GUI_HIDE) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 pbar() EndSwitch WEnd Func pbar() GUICtrlSetState($progressbar, $GUI_SHOW) GUICtrlSetState($label, $GUI_SHOW) local $i = 0 While Guigetmsg() <> $GUI_EVENT_CLOSE $i = $i+2 GUICtrlSetData($progressbar, $i) GUICtrlSetData($label,$i) Sleep(1) If $i = 100 then Exitloop WEnd msgfinish() EndFunc Func msgfinish() MsgBox(0,"Finish","Finish","") GUICtrlSetState($progressbar, $GUI_HIDE) GUICtrlSetState($label, $GUI_HIDE) EndFunc
    1 point
  16. You're Adele, English is your native language!
    1 point
  17. Look in the registry for the ShellFolders entries, there's a registry key called "!Do not use this registry key" and directs you to "Use the SHGetFolderPath or SHGetKnownFolderPath function instead". That tells me that Windows 10 doesn't use these as anything other than pointers for other programs to use, if you want to set them you should probably be using SHSetKnownFolderPath to change them.
    1 point
  18. I just grabbed the default Firewall settings, via the export option, on both the inbound and outbound rules, from a fresh Windows 10 install, after it was completely updated through 8/18/2015. Both lists are attached. I didn't see some of the ones that you listed, JohnOne. Maybe this will assist in diagnostics? ^.^ inbound.txt outbound.txt
    1 point
×
×
  • Create New...