Jump to content

Yoriz

Active Members
  • Posts

    346
  • Joined

  • Last visited

Recent Profile Visitors

1,022 profile views

Yoriz's Achievements

Universalist

Universalist (7/7)

7

Reputation

  1. Sorry not used autoit or been on forum in a while, the download still works ok for me.
  2. You could give my GDIPlusDispose UDF a try and not have to worry about the disposing, it will be done automatically see the link in signature.
  3. Hi, What about putting the text in an edit control so it takes care of the scrollbars for you. #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <TabConstants.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Tabbed Notebook Dialog", 623, 442, 192, 124) $Tab1 = GUICtrlCreateTab(8, 8, 609, 425) $TabSheet1 = GUICtrlCreateTabItem("TabSheet1") $TabSheet2 = GUICtrlCreateTabItem("TabSheet2") GUICtrlSetState(-1,$GUI_SHOW) $Edit1 = GUICtrlCreateEdit("", 16, 40, 593, 385) GUICtrlSetData(-1, StringFormat("\r\n\r\n\r\n\r\n hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh\r\n hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh\r\n\r\n\r\n\r\n\r\n\r\nhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh\r\n hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh\r\n\r\n\r\n\r\n\r\n hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh\r\n\r\n\r\n\r\nhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh\r\n\r\n\r\n\r\nhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh\r\n\r\n hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh\r\n")) $TabSheet3 = GUICtrlCreateTabItem("TabSheet3") GUICtrlCreateTabItem("") GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd
  4. Hi, Here is a way of doing it, have a TimerInit() before the start of the windows msg loop, check for it reaching a idle maximum duration as one of the cases, after any other case reset the timmer. i made a little example that has two button that will reset the timmer and a status to show the idle time in seconds. #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <GuiStatusBar.au3> #include <WindowsConstants.au3> _Form1() Func _Form1() #Region ### START Koda GUI section ### Form= Local $Form1 = GUICreate("Form1", 196, 94, -1, -1) Local $hButton1 = GUICtrlCreateButton("Button1", 20, 24, 75, 25) Local $hButton2 = GUICtrlCreateButton("Button2", 100, 24, 75, 25) Local $hStatusBar1 = _GUICtrlStatusBar_Create($Form1) _GUICtrlStatusBar_SetSimple($hStatusBar1) _GUICtrlStatusBar_SetText($hStatusBar1, "Idle Time: ") GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### Local $iTimmer = TimerInit() Local $iTimmerDuraction = 20000 Local $sStatusText While 1 $nMsg = GUIGetMsg() Select Case $nMsg = $GUI_EVENT_CLOSE Exit Case $nMsg = $hButton1 MsgBox(0, "Button1", "Idle timmer reset") $iTimmer = TimerInit() Case $nMsg = $hButton2 MsgBox(0, "Button2", "Idle timmer reset") $iTimmer = TimerInit() Case TimerDiff($iTimmer) >= $iTimmerDuraction MsgBox(0, "Times up", "Idle time limit reached") ExitLoop Case Else Local $sNewTimeText = "Idle Time: " & Round(TimerDiff($iTimmer) / 1000) If $sStatusText <> $sNewTimeText Then $sStatusText = $sNewTimeText _GUICtrlStatusBar_SetText($hStatusBar1, $sStatusText) EndIf EndSelect WEnd EndFunc ;==>_Form1
  5. Hi , welcome to the forum, there are examples in this thread.
  6. Hey, Your code looks like it might be getting stuck on one of the WinWait or WinWaitActive. you could use the optional timeout parameter to give your code a way out if something it is waiting for doesn't happen. If WinWaitActive($title, "", 10) Then MsgBox(0, "Good", "It didn't time out so i can continue with the normal code") Else MsgBox(0, "Doh", "It timed out , what should i do instead?, maybe just exit") Exit EndIf
  7. Hey, You should use the 3rd parameter of random to ensure you get a whole number. ToolTip( "Riveting story", Random(0, 1680, 1), Random(0, 1050, 1), "Cool Story Bro")
  8. Your welcome , One thing to note when importing, watch out for any of the data having coma's it will throw the delimeter all out of wack.
  9. SQLite> testimport.db SQLite> .separator , SQLite> .import importdata.csv testdata = _SQLite_SQLiteExe($sDatabaseFilePath, ".separator ," & @CRLF & ".import '" & FileGetShortName($hImportFilePath) & "' TableName" & @CRLF, $sOutputFile) #include <File.au3> #include <SQLite.au3> _CreateDatabaseFile() _ImportTxtToSql() _ReadArrayToSql() Func _CreateDatabaseFile() Local $hFile = @ScriptDir & "\Test.Txt" If FileExists($hFile) Then Return Local $iArraysize = 1000, $aArray[$iArraysize] For $i = 0 To $iArraysize - 1 Step 1 $aArray[$i] = $i & "-One," & $i & "-Two," & $i & "-Three," & $i & "-Four" Next _FileWriteFromArray($hFile, $aArray) EndFunc ;==>_CreateDatabaseFile Func _ImportTxtToSql() Local $sDatabaseFile = @ScriptDir & "\Test.Db", $sOutputFile Local $hFile = @ScriptDir & "\Test.Txt" If FileExists($sDatabaseFile) Then FileDelete($sDatabaseFile) _SQLite_SQLiteExe($sDatabaseFile, "CREATE TABLE test (ColOne,ColTwo,ColThree,ColFour);", $sOutputFile) Local $iTimmer = TimerInit() _SQLite_SQLiteExe($sDatabaseFile, ".mode csv" & @CRLF & ".import '" & FileGetShortName($hFile) & "' test" & @CRLF, $sOutputFile) ConsoleWrite(TimerDiff($iTimmer) & " :Time to import file" & @CR) EndFunc ;==>_ImportTxtToSql Func _ReadArrayToSql() Local $sDatabaseFile = @ScriptDir & "\Test.Db", $sOutputFile Local $hFile = @ScriptDir & "\Test.Txt" If FileExists($sDatabaseFile) Then FileDelete($sDatabaseFile) Local $aArray _FileReadToArray($hFile, $aArray) _SQLite_Startup() _SQLite_Open($sDatabaseFile) _SQLite_Exec(-1, "CREATE TABLE test (ColOne,ColTwo,ColThree,ColFour);") Local $iTimmer = TimerInit() _SQLite_Exec(-1, "Begin") For $i = 1 To $aArray[0] Step 1 _SQLite_Exec(-1, "INSERT INTO test values ('" & StringReplace($aArray[$i], ",", "','") & "');") Next _SQLite_Exec(-1, "END ;") ConsoleWrite(TimerDiff($iTimmer) & " :Time to read & insert array" & @CR) _SQLite_Close() _SQLite_Shutdown() EndFunc ;==>_ReadArrayToSql
  10. 24th December, 2008 - v3.3.0.0 AutoIt: Added: New flag for StringSplit() to not return the count in element 0. UDFs: Removed: _StringSplit, no longer needed Looks like StringSplit was possibly made to work like _StringSplit so check the parameters your giving and you might just have remove the _ from your function calls.
  11. Set the max number of characters that can be in an editbox with func GUICtrlSetLimit
  12. Link: is there a function for reading images into 2d arrays?
  13. Is this any good ? #include <GuiImageList.au3> #include <GuiListView.au3> #include <ListViewConstants.au3> $hGUI = GUICreate("") $hGUIListView = _GUICtrlListView_Create($hGUI, "", 0, 0, 212, 300, BitOR($LVS_LIST, $LVS_ICON, $LVS_SINGLESEL, $LVS_SHOWSELALWAYS)) $hImageList = _GUIImageList_Create(24, 24, 5) _GUIImageList_AddIcon($hImageList, "icon.ico", 0, True) _GUICtrlListView_SetImageList($hGUIListView, $hImageList, 1) _GUICtrlListView_AddItem($hGUIListView, "1", 0) _GUICtrlListView_AddItem($hGUIListView, "2", 0) _GUICtrlListView_AddItem($hGUIListView, "3", 0) GUISetState() MsgBox(0, "", "moving index 2 to index 0 position") _guiCtrlListViewMoveIndex($hGUIListView, 2, 0) MsgBox(0, "", "moving index 1 to index 2 position") _guiCtrlListViewMoveIndex($hGUIListView, 1, 2) While 1 If GUIGetMsg() = -3 Then Exit WEnd Func _guiCtrlListViewMoveIndex($hWnd, $iCurrentIndex, $iNewIndex) $sText = _GUICtrlListView_GetItemText($hWnd, $iCurrentIndex) _GUICtrlListView_DeleteItem($hWnd, $iCurrentIndex) _GUICtrlListView_InsertItem($hWnd, $sText, $iNewIndex) EndFunc ;==>_guiCtrlListViewMoveIndex
  14. Link: is there a function for reading images into 2d arrays?
  15. I dont know what _Crypt_HashData returns but the code checks the password is correct with this line so alter it to suit. Case $sPassword = "Correct" To have ESC key and when user hits OK just leaving the input box blank count as an attempt to login just comment out the following. Case $sPassword = "" If @error = 1 Then Return 0 Locking the mouse/keyboard sounds a bit harsh, why not just set that user to disabled , then once that user account has been investigated it can be reanabled or lock it out for a certain time or something.
×
×
  • Create New...