Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 09/24/2019 in all areas

  1. Yirrlaar, I suggest reading the Interrupting a running function tutorial in the Wiki - it explains why this happens and how you can get round it. M23
    1 point
  2. i guess this is the opposite of the srer, but all the others looked weird $str = "[AA]__(BB)_______{CC}__#DD#" $n = 3 msgbox(0, '' , stringregexp($str , "([A-Z]+)" , 3)[$n -1])
    1 point
  3. Can you pass it in through the command line? Use your VBScript to call your AutoIt and and get it from $CmdLine[1] or something similar? If not, write it somewhere, a text file at worst, the registry would likely be best and read it with AutoIt
    1 point
  4. Recently I had to convert a rather large VBS to AutoIt. I did the following replacements using the editor and about 90% of the conversion tasks has been done. Still manual editing is needed but went much faster. About how many lines of code do we talk?
    1 point
  5. I have not seen any attempts at automatic conversion scripts in some time. Even the ones you have probably seen in the past were hit and miss (mostly miss) at best. As far as having to learn all of VBScript to convert, the languages are quite similar. I would suggest giving it a go yourself, rather than trusting to a conversion script and then not understanding if something doesn't work. If you hit any snags, feel free to post the vbscript here, along with a detailed description of what you're trying to do. Not only can forum members assist with syntax conversion, we may be able to suggest a better way to do things.
    1 point
  6. You might try this hook #include <WinAPI.au3> #include <WindowsConstants.au3> Global $hHook Local $hFunc, $pFunc, $hMod HotKeySet('{ESC}', '_Close') $hFunc = DllCallbackRegister('_MouseProc', 'lresult', 'int;int;int') $pFunc = DllCallbackGetPtr($hFunc) $hMod = _WinAPI_GetModuleHandle(0) $hHook = _WinAPI_SetWindowsHookEx($WH_MOUSE_LL, $pFunc, $hMod) While 1 Sleep(20) WEnd Func _MouseProc($iCode, $iwParam, $ilParam) If $iCode < 0 Then Return _WinAPI_CallNextHookEx($hHook, $iCode, $iwParam, $ilParam) Switch $iwParam Case $WM_MBUTTONDOWN, $WM_MBUTTONUP Return 1 ;disable EndSwitch Return _WinAPI_CallNextHookEx($hHook, $iCode, $iwParam, $ilParam) EndFunc ;==>_MouseProc Func _Close() _WinAPI_UnhookWindowsHookEx($hHook) DllCallbackFree($hHook) Exit EndFunc ;==>_Close
    1 point
  7. I'd be happy to. Sorry it's kind of bulky, but it works. Please test the script without altering it for consistency. Once you have tested it please let me know if it crashed for you, so I know if it is just my system. #include <GUIConstants.au3> #include <Constants.au3> #include <WindowsConstants.au3> #include <GuiListView.au3> ;includes. I wasn't sure which ones were required so I copied them from the original script. ; CREATE THE GUI $GUI = GUICreate("_GUICtrlListView_SortItems causes hard crash", 800, 500) $ListView = GUICtrlCreateListView("Item1|Item2|Item3|Item4|Item4|Item5|Item6|Item7", 0, 0, 800, 500) GUISetState(@SW_SHOW) $loop = 0 ;Set a loop variable to tell the script when to stop creating items $d = "|" ; set a divider variable which kind of serves no real purpose other than saving one keypress big woop. MsgBox(0, "Sort items crash", "Please wait until the list has finished being generated, after that, click a header to sort it.", 6) ;just some FYIs for you _GUICtrlListView_RegisterSortCallBack($ListView) Do $chr0 = Chr(Random(33, 126)) $chr1 = Chr(Random(33, 126)) $chr2 = Chr(Random(33, 126)) $chr3 = Chr(Random(33, 126)) $chr4 = Chr(Random(33, 126)) $chr5 = Chr(Random(33, 126)) $chr6 = Chr(Random(33, 126)) ;create random text for an entry $text = $chr0 & $d & $chr1 & $d & $chr2 & $d & $chr3 & $d & $chr4 & $d & $chr5 & $d & $chr6 ;put it all into one var GUICtrlCreateListViewItem($text, $ListView) ;create it Sleep(10) ;allow some cooldown time $loop = $loop + 1 ;add one to the loop (I hate FOR loops) WinSetTitle("_GUICtrlListView_SortItems causes hard crash", "", "_GUICtrlListView_SortItems causes hard crash - Creating list: " & $loop & "/500") ;tell the user how many entries are left Until $loop > 499 WinSetTitle("_GUICtrlListView_SortItems causes hard crash", "", "_GUICtrlListView_SortItems causes hard crash - Waiting for user input") ;more infoz While 1 Switch GUIGetMsg() ;wait for input Case $GUI_EVENT_CLOSE Exit Case $ListView _GUICtrlListView_SortItems($ListView, GUICtrlGetState($ListView)) ;BOOM! EndSwitch WEndList_View_sort.au3
    1 point
×
×
  • Create New...