Leaderboard
Popular Content
Showing content with the highest reputation on 03/19/2013 in all areas
-
Hi! Today I want to show you my current AutoIt project: The ISN AutoIt Studio. The ISN AutoIt Studio is a complete IDE made with AutoIt, for AutoIt! It includes a GUI designer, a code editor (with syntax highlighting, auto complete & intelisense), a file viewer, a backup system, trophies and a lot more features!! Here are some screenshots: Here some higlights: -> easy to create/manage/public your AutoIt-projects! ->integrated GUI-Editor (ISN Form Studio 2) ->integrated - file & projectmanager ->auto backupfunction for your Projects ->extendable with plugins! ->available in several languages ->trophies ->Syntax highlighting /Autocomplete / Intelisense ->Dynamic Script ->detailed overview of the project (total working hours, total size...) And much more!!! -> -> Click here to download ISN AutoIt Studio <- <- Here is the link to the german autoit forum where I posted ISN AutoIt Studio the first time: http://autoit.de/index.php?page=Thread&threadID=29742&pageNo=1 For more information visit my Homepage: https://www.isnetwork.at So….have fun with ISN AutoIt Studio! PS: Sorry for my bad English! ^^1 point
-
The idea of a re-producer is to create a small script that everyone else can run and see your problem, we dont have the files to run that above. Here's why it's a good idea for you to create a runnable script with just the issue you have. 1. More people will run it without having to read through tons of code to see what is supposed to be happening. 2. More times that not, a person will realize the problem when creating a small re-producer.1 point
-
Detecting External Hard Drives
abaddon7734 reacted to BrewManNH for a topic
This shows my second internal hard drive and a USB hard drive as external. @careca This function isn't designed to detect thumb drives, only external hard drives.1 point -
Sample script to read a whole file to an array, loop through the array and change some content, then write the array to another file:#include <Array.au3> Global $aFileIn _FileReadToArray("path of file to read from goes here", $aFileIn) For $iIndex = 1 To $aFileIn[0] If $aFileIn[$iIndex] = "Old value...." Then $aFileIn[$iIndex] = "New value" Next _FileWriteFromArray("path of file to write to goes here", $aFileIn)1 point
-
Detecting External Hard Drives
abaddon7734 reacted to wraithdu for a topic
I believe you can check the state of the 'Windows Management Instrumentation' (Winmgmt) service.1 point -
If the window title of the second exe is unique then you could use function WinGetProcess to get the PID which then can be monitoried with function ProcessExists.1 point
-
regwrite not working in windows 7
Tripredacus reacted to JohnOne for a topic
Need admin for this in 7 add #RequireAdmin to script.1 point -
1 point
-
1 point
-
Interesting ! Works well I have tried to simplify you code a bit. #include <Array.au3> $aExternalDrives = _FindExtHdd() _ArrayDisplay ( $aExternalDrives, "EXTERNAL DRIVES LIST" ) Func _FindExtHdd() Local $iPid, $sStdout, $iTotalSize, $sGetSpace, $addspace, $externaldrives $iPid = Run ( @ComSpec & ' /c wmic diskdrive get PNPDeviceID, size /format:csv | find /v "USBSTOR"', '', @SW_HIDE, 2 ) While ProcessExists ( $iPid ) $sStdout &= StdoutRead ( $iPid ) Wend $sStdout = StringSplit($sStdout, ",") $iTotalSize = $sStdout[$sStdout[0]] / 1024 / 1024 / 1024 ; GB Do $iTotalSize = StringTrimRight($iTotalSize, 1 ) Until Not StringInStr($iTotalSize, ".") Local $aDriveList = DriveGetDrive("FIXED") For $w = 1 To UBound($aDriveList) - 1 $sGetSpace = DriveSpaceTotal($aDriveList[$w]) / 1024 Do $sGetSpace = StringTrimRight($sGetSpace, 1 ) Until Not StringInStr($sGetSpace, ".") $addspace += $sGetSpace If $addspace > $iTotalSize Then $externaldrives &= $aDriveList[$w] & "," Next $externaldrives = StringTrimRight($externaldrives, 1) If $externaldrives Then Return StringSplit($externaldrives, ",", 1) EndFunc ;==>_FindExtHdd1 point
-
Detecting External Hard Drives
abaddon7734 reacted to wraithdu for a topic
There's nothing wrong with your method at all. Some might say it's not foolproof because it relies on WMI being enabled on the target system (which is the default, but can be disabled). I wrote a UDF for a different purpose some time ago, but it can gather the information you need, it even has an _IsUSBHDD test to do exactly what you want. Maybe you'll find it useful as well.1 point -
An another solution with $WM_NOTIFY:;Autor Bugfix http://www.autoit.de/index.php?page=Thread&postID=117453#post117453 #include <ListViewConstants.au3> #include <StructureConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <GUIListView.au3> $gui = GUICreate('test') $hListView = GUICtrlCreateListView('Spalte1|Spalte2', 10, 10, 300, 200) _GUICtrlListView_SetColumnWidth($hListView, 0, 146) _GUICtrlListView_SetColumnWidth($hListView, 1, $LVSCW_AUTOSIZE_USEHEADER) For $i = 1 To 10 GUICtrlCreateListViewItem('Zeile ' & $i & ' Spalte 1|Zeile ' & $i & ' Spalte 2', $hListView) Next GUISetState() GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY") Do $msg = GUIGetMsg() Until $msg = $GUI_EVENT_CLOSE Func ListView_HOTTRACK($iSubItem) Local $HotItem = _GUICtrlListView_GetHotItem($hListView) If $HotItem <> -1 Then _ToolTipMouseExit("Überfahrenes Item: " & $HotItem & " SubItem: " & $iSubItem & @CRLF & _ 'Inhalt: ' & _GUICtrlListView_GetItemText($hListView, $HotItem, $iSubItem), 500) EndFunc ;==>ListView_HOTTRACK Func _ToolTipMouseExit($TEXT, $TIME=-1, $x=-1, $y=-1, $TITLE='', $ICON=0, $OPT='') If $TIME = -1 Then $TIME = 3000 Local $start = TimerInit(), $pos0 = MouseGetPos() If ($x = -1) Or ($y = -1) Then ToolTip($TEXT, $pos0[0], $pos0[1], $TITLE, $ICON, $OPT) Else ToolTip($TEXT, $x, $y, $TITLE, $ICON, $OPT) EndIf Do Sleep(50) $pos = MouseGetPos() Until (TimerDiff($start) > $TIME) Or _ (Abs($pos[0] - $pos0[0]) > 10 Or _ Abs($pos[1] - $pos0[1]) > 10) ToolTip('') EndFunc ;_ToolTipMouseExit Func WM_NOTIFY($hWnd, $iMsg, $iwParam, $ilParam) Local $hWndFrom, $iIDFrom, $iCode, $tNMHDR, $hWndListView $hWndListView = $hListView If Not IsHWnd($hListView) Then $hWndListView = GUICtrlGetHandle($hListView) $tNMHDR = DllStructCreate($tagNMHDR, $ilParam) $hWndFrom = HWnd(DllStructGetData($tNMHDR, "hWndFrom")) $iIDFrom = DllStructGetData($tNMHDR, "IDFrom") $iCode = DllStructGetData($tNMHDR, "Code") Switch $hWndFrom Case $hWndListView Switch $iCode Case $LVN_HOTTRACK ; Sent by a list-view control when the user moves the mouse over an item Local $tInfo = DllStructCreate($tagNMLISTVIEW, $ilParam) ListView_HOTTRACK(DllStructGetData($tInfo, "SubItem")) EndSwitch EndSwitch Return $GUI_RUNDEFMSG EndFunc ;==>WM_NOTIFY1 point
-
Another Example so that The header is not counted as the Item 0 #include <GUIConstantsEx.au3> #include <Array.au3> #include <WindowsConstants.au3> #include <GuiListView.au3> #include <WinAPI.au3> Opt('MustDeclareVars', 1) Global $mylist, $hGUI, $tPoint = DllStructCreate($tagPoint) Example() Func Example() Local $MESSAGE = "The following buttons have been clicked" Local $add, $clear, $close, $msg $hGUI = GUICreate("My GUI list", 500, 400) ; will create a dialog box that when displayed is centered Local $iListView = GUICtrlCreateListView("buttons|clicked", 10, 10, 400, 200) $mylist = GUICtrlGetHandle(-1) Local $id = GUICtrlCreateListViewItem("this is another|line which is larger than the list box", $iListView) GUICtrlCreateListViewItem("Again another|Line", $iListView) GUISetState() $msg = 0 While $msg <> $GUI_EVENT_CLOSE $msg = GUIGetMsg() Switch $msg Case $GUI_EVENT_MOUSEMOVE SetMousePos() TimerFunc() EndSwitch WEnd EndFunc ;==>Example Func TimerFunc() Local Static $iIndex_old = -1 Local $iIndex = _GUICtrlListView_HitTest($mylist) If HoveringOnHeader() Or $iIndex[0] < 0 Then $iIndex_old = -1 Return ToolTip('') EndIf If $iIndex[0] = $iIndex_old Then Return ToolTip("ListView Row No." & $iIndex[0]) $iIndex_old = $iIndex[0] EndFunc ;==>TimerFunc Func SetMousePos() DllStructSetData($tPoint, 1, MouseGetPos(0)) DllStructSetData($tPoint, 2, MouseGetPos(1)) EndFunc ;==>SetMousePos Func HoveringOnHeader() Local $tRect = DllStructCreate($tagRect) Local $aPos = WinGetPos(_GUICtrlListView_GetHeader($mylist)) $aPos[2] = $aPos[0] + $aPos[2] $aPos[3] = $aPos[1] + $aPos[3] If @error Then Return SetError(1, 0, 0) For $i = 1 To 4 DllStructSetData($tRect, $i, $aPos[$i - 1]) Next Return _WinAPI_PtInRect($tRect, $tPoint) EndFunc ;==>HoveringOnHeader Thumbs up if it helped. Regards1 point
-
Rough Example#include <GUIConstantsEx.au3> #include <Array.au3> #include <WindowsConstants.au3> #include <GuiListView.au3> #include <WinAPI.au3> Opt('MustDeclareVars', 1) Global $mylist, $hGUI Example() Func Example() Local $MESSAGE = "The following buttons have been clicked" Local $add, $clear, $close, $msg $hGUI = GUICreate("My GUI list", 500, 400) ; will create a dialog box that when displayed is centered Local $iListView = GUICtrlCreateListView("buttons|clicked", 10, 10, 400, 200) $mylist = GUICtrlGetHandle(-1) Local $id = GUICtrlCreateListViewItem("this is another|line which is larger than the list box", $iListView) GUICtrlCreateListViewItem("Again another|Line", $iListView) GUISetState() $msg = 0 While $msg <> $GUI_EVENT_CLOSE $msg = GUIGetMsg() Switch $msg Case $GUI_EVENT_MOUSEMOVE TimerFunc() EndSwitch WEnd EndFunc ;==>Example Func TimerFunc() Local Static $iIndex_old = -1 Local $iIndex = _GUICtrlListView_HitTest($mylist) If $iIndex[0] < 0 Then $iIndex_old = -1 Return ToolTip('') EndIf If $iIndex[0] = $iIndex_old Then Return ToolTip("ListView Row No." & $iIndex[0]) $iIndex_old = $iIndex[0] EndFunc ;==>TimerFunc1 point
-
I see lots of people bitching here. How about this: Instead of complaining about how a dev stopped helping how about you sharpen your skills and become a dev yourself so you can CONTRIBUTE to the language?1 point
-
It's more than likely the forum software ate the backslashes when the script was posted or edited. Unfortunately it's a too common experience, so you'll have to reinsert them where they belong.1 point
-
Command and Execute
Noviceatthis reacted to PhoenixXL for a topic
This might help you#include <File.au3> #include <StaticConstants.au3> #include <GUIConstants.au3> If Not FileExists(@AutoItExe) Then MsgBox(0, "", "You Must have AutoIt Software Installed to run this Program") Exit EndIf $s_HelpFile = StringReplace(@AutoItExe,"Autoit3.exe","Autoit3.chm") $Form1_1 = GUICreate("AutoIt Command Prompt", 616, 278, 195, 135) GUISetBkColor(0xC0C0C0) $Label1 = GUICtrlCreateLabel("AutoIt Command Prompt", 8, 8, 598, 33, BitOR($SS_CENTER, $SS_CENTERIMAGE, $SS_SUNKEN)) GUICtrlSetFont(-1, 18, 800, 4, "MS Sans Serif") GUICtrlSetBkColor(-1, 0x99B4D1) $Input1 = GUICtrlCreateInput("", 8, 104, 601, 28) GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif") $Label2 = GUICtrlCreateLabel("Enter Commands/Script Path below:", 8, 56, 212, 28, BitOR($SS_CENTER, $SS_CENTERIMAGE, $SS_SUNKEN)) GUICtrlSetFont(-1, 14, 400, 0, "MS Sans Serif") GUICtrlSetBkColor(-1, 0x99B4D1) $Button1 = GUICtrlCreateButton("Execute Command", 8, 160, 300, 57) GUICtrlSetFont(-1, 12, 800, 0, "MS Sans Serif") $Button3 = GUICtrlCreateButton("Execute Script", 308, 160, 300, 57) GUICtrlSetFont(-1, 12, 800, 0, "MS Sans Serif") $Button2 = GUICtrlCreateButton("Help", 8, 232, 601, 33) GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif") GUISetState(@SW_SHOW) $file = @TempDir & "\command.tmp" While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE FileDelete($file) Exit Case $Button1 Execute( GUICtrlRead( $Input1 ) ) Case $Button3 _ExecuteFile( GUICtrlRead( $Input1 )) Case $Button2 If FileExists($s_HelpFile ) Then ShellExecute($s_HelpFile) Else ShellExecute("http://www.autoitscript.com/wiki/Function_list") EndIf EndSwitch WEnd Func _ExecuteFile($sText) Local $hFile, $PID, $s_TempFile $s_TempFile = _TempFile() $hFile = FileOpen($s_TempFile, 2) FileWrite($hFile, $sText) FileClose($hFile) $PID = Run('"' & @AutoItExe & '" /AutoIt3ExecuteScript "' & $s_TempFile & '"') Sleep(300) FileDelete($s_TempFile) Return $PID EndFunc ;==>_ExecuteFile1 point