Jump to content

MvGulik

Active Members
  • Posts

    2,526
  • Joined

  • Last visited

  • Days Won

    7

MvGulik last won the day on December 9 2014

MvGulik had the most liked content!

Profile Information

  • Interests
    [... Lost in Space ...]

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

MvGulik's Achievements

  1. *Scratches head*. ... http://www.mediawiki.org/wiki/Help:Tables Oops. Brain lock on wrong language.
  2. Mmm, Think I found a/the solution. (After just trying out some of the GUICtrlToolbar functions, and seeing what I got returned.) _GUICtrlToolbar_IndexToCommand() ... Yep, that did it. ... Local $hTaskbar = ControlGetHandle('[CLASS:Shell_TrayWnd]', '', '[CLASS:ToolbarWindow32;INSTANCE:3]') ;; Win-XP! Local $iTaskCount = _GUICtrlToolbar_ButtonCount($hTaskbar) Local $iC, $sTask, $sText_out = '' For $i = 0 to $iTaskCount-2 step 2 $iC = _GUICtrlToolbar_IndexToCommand($hTaskbar, $i) $sTask = _GUICtrlToolbar_GetButtonText($hTaskbar, $iC) If $sTask == $sName_in Then ;; note: case sensitive string compare. $iC = _GUICtrlToolbar_IndexToCommand($hTaskbar, $i+1) $sText_out = _GUICtrlToolbar_GetButtonText($hTaskbar, $iC) ExitLoop EndIf Next ...
  3. Output from Au3Info on the application-buttons in my taskbar. (Order: Task name followed by the task-text/tip for that task.) (Seeing "N:" as first number column here.) Using the following code-parts I can retrieve the task-name and the task-text data. (Win-Xp) $hTaskbar = ControlGetHandle('[CLASS:Shell_TrayWnd]', '', '[CLASS:ToolbarWindow32;INSTANCE:3]') ;; Win-XP! $iTaskCount = _GUICtrlToolbar_ButtonCount($hTaskbar) $sTask = _GUICtrlToolbar_GetButtonText($hTaskbar, $i) $sText = _GUICtrlToolbar_GetButtonText($hTaskbar, $i+1) But, the retrieved data in this case is ordered according to the second number column in the Au3Info data. (rendering it kinda unusable as a task and it text are not guaranteed to be grouped together.) I figure there must be some additional/other way/data that Au3Info is using to link the right task with its related text. But how ... ??? (Its probably something simple, but I'm not seeing it.) *spelling*
  4. Aha, there we go. I did had a general personal include that was using ESC in a hotkey. Disabling that include made the script flow normally again. (Its a old script, but I should have thought about possible ESC hotkey conflicts here.) Time to take a closer look at that part. (pending slapping a solved tag on the topic) Edit: Yep, that definitely was it. *Solved* Thanks JohnOne.
  5. Checked, by forcing a Opt("GUICloseOnESC", 0). Nope. Still exits on sending a ESC. Although I use GUICreate in my script, its only used to force a single instance. My script is a command line tool that is interacting(do some stuff and exit) with a other application(active focus) when the ESC is send. Edit: A older autoit compiled version is not having this issue. Think its using v3.3.0.0.
  6. Erm. Is there some odd case known where sending Send("{ESC}") makes your script just exit ? - Accessing some other application menu-bar options. - exit code: +>00:59:55 AutoIT3.exe ended.rc:0 >Exit code: 0 Time: 3.174 [v3.3.12.0 on WinXp(32)(Classic)] ... Guess I'm off finding a fix/workaround. Edit: Right ... Send("{ESC}", 1) doing the job. (Erm, nope. But at least no script exit.) Edit: O dear. {ALT} is used/redirected to a application function. (seems I run out of menu closing options. )
  7. Mmm. Unless I'm doing something wrong here, there seems to be no workaround to do a Static array resize in v3.3.8.1. Both cases do work when it comes to the array resizing part, but also trigger a critical error on the next function use after the resize of the Static array. "==> Array maximum size exceeded." Static_Array_Redim_3381() Static_Array_Redim_3381(4) Static_Array_Redim_3381() ;; *1 ==> Array maximum size exceeded. Func Static_Array_Redim_3381($iSize = 0) Local Static $aArray[1] ;; *1 ==> Array maximum size exceeded. If $iSize > 0 And $iSize <> UBound($aArray, 1) Then Switch 1 Case 1 ByRef_Array_Redim($aArray, $iSize) Case 2 Local $aArray_Copy = $aArray ReDim $aArray_Copy[$iSize] $aArray = $aArray_Copy EndSwitch EndIf ConsoleWrite('UBound($aArray,1) = ' & UBound($aArray, 1) & @CRLF) EndFunc Func ByRef_Array_Redim(ByRef $aArray, $iSize) ReDim $aArray[$iSize] EndFunc
  8. When really needed, you could always switch to a faster local variable copy to speed crucial code parts up. Using smart byref, when possible, could help to.
  9. + Fixed missing constant. Will see about some example code later. (Like guinness example better than my own.) "__CODEBOX_0__" ... bye bye backup. Not working for spaces anyway. (temp) #4 - Usage code example for this function. (guinness) #10 - Smaller function code example. (JohnOne) #11 + #12 - Optional v3.3.8.1 workaround for resizing a Static array. (wraithdu) #19 - Dictionary use example(v1). (JohnOne) #22 - Dictionary use example(v2). (JohnOne) (move up)
  10. Playing around a bit with this idea. Note: Needs at least AutoIt version 3.3.9.0 (#1257: Fix bugs in Static array handling) Func My_Statics($sName, $vData = '') ;; parameter checkups If 1 Then ;; ... If Not IsString($sName) Then Return SetError(2) ;; name -> string only. If Not $sName Then Return SetError(3) ;; name -> no empty string. ;If StringInStr($sName, ' ') then Return SetError(4) ;; block spaces in names. ... etc ;; not checking for additional odd name cases. (presuming general valid variable name cases.) ;; note: name string are not case-sensitive in this case. EndIf Local Enum $_ind_ ;; array index field. (make global when warranted.) Local Static $asNames[1] = [0] Local Static $avData[1] = [0] Local $iSize = $asNames[$_ind_] Local $out = '' Local $err = 0 If @NumParams > 1 Then ;; data input mode. Do ;; used as name-found bailout point. For $i = 1 To $iSize If $asNames[$i] = $sName Then $avData[$i] = $vData ExitLoop 2 EndIf Next ;; Name not found. Add new name entry. $iSize += 1 ReDim $asNames[1 + $iSize] ReDim $avData[1 + $iSize] ; $asNames[$_ind_] = $iSize $avData[$_ind_] = $iSize ; $asNames[$iSize] = $sName $avData[$iSize] = $vData Until 1 Else ;; recall $err = 1 For $i = 1 To $asNames[$_ind_] If $asNames[$i] = $sName Then $out = $avData[$i] $err = 0 ExitLoop EndIf Next EndIf Return SetError($err, 0, $out) EndFunc (Only tested with strings and a array. But seems ok so far.) Error 1 (+empty string): Name not found, recall mode only. Error 2+3: Name parameter hickup. - Fixed missing constant.
  11. @guinness Are you planning to document this "Local declaration use at root level" some more at the wiki ? I think it would not be a bad idea. Yes or No will do.
  12. Valik argument was not targeted, or limited, to the actual behavior of AutoIt. But at coding practice/logic in general.
  13. (Local use at code root level) Aha. Got it. ​ (other sub-topic) "globals are bad" -> http://en.wikipedia.org/wiki/Global_variable (header section) seems to contain some good general "why" 's to me.
×
×
  • Create New...