Jump to content

All Activity

This stream auto-updates     

  1. Past hour
  2. Look at the last parameter, $SEND_RAW, in the help file under ControlSend.
  3. You are right.. AdlibRegister .. is more simble I didn't know about it
  4. buymeapc, Personally I would do it like this: #include <GUIScrollBars_Ex.au3> $iLeft = 5 ; The distance of the labels from the left edge of the window $iTop = 40 ; First label's distance from the top edge of the window $iWidth = 100 ; Width of labels $iHeight = 25 ; Height of labels $iSpacing = 30 ; Vertical distance between the labels $hGUI = GUICreate('Calculate exact scrollheight for dynamic labels after maximize window', 500, 500, -1, -1, BitOR($GUI_SS_DEFAULT_GUI, $WS_MAXIMIZEBOX, $WS_MINIMIZEBOX)) GUICtrlCreateTab(2, 2, 496, 496) GUICtrlSetResizing(-1, $GUI_DOCKLEFT + $GUI_DOCKTOP + $GUI_DOCKRIGHT + $GUI_DOCKBOTTOM) GUICtrlCreateTabItem("Example") $hGUI2 = GUICreate("", 488, 464, $iLeft, 26, $WS_POPUP, $WS_EX_MDICHILD, $hGUI) For $i = 1 To 50 GUICtrlCreateLabel('Label ' & $i, $iLeft, $iTop, $iWidth, $iHeight) GUICtrlSetBkColor(-1, 0xFFFFFF) GUICtrlSetResizing(-1, $GUI_DOCKALL) ; Prevent resizing $bot = $iTop + $iHeight ; Bottom edge of the last label $iTop = $bot + $iSpacing ; Top of next label Next $cButton = GUICtrlCreateButton("Maximize", 400, 40, 50, 30) GUICtrlCreateTabItem("") $iMaxScrollHeight = $iTop _GUIScrollbars_Generate($hGUI2, 0, $iMaxScrollHeight) GUISetState(@SW_SHOW, $hGUI) GUISetState(@SW_SHOW, $hGUI2) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $GUI_EVENT_MAXIMIZE, $GUI_EVENT_RESTORE ; Get new GUI size Local $aGUI_Size = WinGetClientSize($hGUI) ; Get current scroll bar position $iPos = _GUIScrollBars_GetScrollInfoPos($hGUI2, $SB_VERT) ; And set scrollbar to top _GUIScrollBars_SetScrollInfoPos($hGUI2, $SB_VERT, 0) ; Resize scroll GUI WinMove($hGUI2, "", Default, Default, ($aGUI_Size[0] - 14), ($aGUI_Size[1] - 34)) ; Reset scrollbar position _GUIScrollBars_SetScrollInfoPos($hGUI2, $SB_VERT, $iPos) Case $cButton GUISetState(@SW_MAXIMIZE) EndSwitch Wend And was there any particular reason why you did not post this in the UDF thread so that I would be guaranteed to see it? M23
  5. @AuScripter The best I found was using GDI+ to create a black overlay to hide that my screen was on. I used this as a template. Both Windows 7 and 10 seem to do this 😕 (FYI: I'm downloading invoices at work and my monitor heats up and does the old TV thing of "staining" pixels for a short while.)
  6. excuse me, Where is the location of the chrome browser defined? If my chrome browser is not in the default installation location【C:\ Program Files (x86)\ Google\ Chrome\ Application\ 71.0.3578.98\ chrome.exe】, how should I specify the specific path to "chrome.exe" in my code?
  7. Hello I try use ControlSend("MyAppli", "", 0, "198745,845843" ) But Autoit Send &ç_è'(,_'(_'" i don't find how fix my problem but i thinks is esay for You Thanks for your help
  8. Today
  9. Also, you might consider cutting down your loop timing... if you Sleep(1000), your code just looks like a fancy message box Consider an example something a bit more like this: #Region Example Local $counter = 1 While True _Loop_Task("_Test()", 1, 1000) ConsoleWrite("Counter: " & $counter & @CRLF) $counter += 1 Sleep(100) Wend Func _Test() MsgBox(0, 0, 0) EndFunc #EndRegion Example Which shows your code being evaluated, but not executing the _Test function each loop
  10. So out of curiosity, what does this buy someone rather than doing AdlibRegister?
  11. Not the cleanest example yet but serves it well #include <Array.au3> MsgBox(262144, 'is_FullMatch', _Match("ABCDEFGHIJKLMOPQRSTUVWXYZ", "HELLO")) Func _Match($sStringFrom, $sWord) Local $aWord = StringSplit($sWord, "", 3) $sWord = _ArrayToString(_ArrayUnique($aWord, 0, 0, 0, 0), "") Local $iLen = StringLen($sStringFrom) - StringLen($sWord) Local $Ret = UBound(StringRegExp("|" & _ArrayToString(StringSplit($sStringFrom, "", 3)), "(?i:[|" & $sWord & "])+\w", 3)) MsgBox(262144, "", StringLen($sStringFrom) - $Ret & " Matches from " & StringLen($sWord)) Return StringLen($sWord) = StringLen($sStringFrom) - $Ret EndFunc ;==>_Match Deye
  12. Hey gang, I've taken advantage of Melba's excellent scrollbar UDF for my GUI and I'm having a great time with it, but I'm encountering an issue that I'm hoping to get some help on. Once the GUIs are loaded, things work great. However, if I scroll all the way to the bottom, then maximize the window, the scrollbar stays where it is and the secondary window is proportioned properly, but I can now scroll up into basically empty space. I'm not quite sure how to remedy this. Here's a quick reproducer to show what I'm talking about. All you need to do to replicate is scroll the scrollbar to the bottom of the window, then maximize the window. You'll see the scrollbar at the bottom of the window and the controls that were at the top, are now in view and I can now scroll up into nothingness. Any help would be greatly appreciated. Thanks!! #include <GUIScrollBars_Ex.au3> $iLeft = 5 ; The distance of the labels from the left edge of the window $iTop = 40 ; First label's distance from the top edge of the window $iWidth = 100 ; Width of labels $iHeight = 25 ; Height of labels $iSpacing = 30 ; Vertical distance between the labels $hGUI = GUICreate('Calculate exact scrollheight for dynamic labels after maximize window', 500, 500, -1, -1, BitOR($GUI_SS_DEFAULT_GUI, $WS_MAXIMIZEBOX, $WS_MINIMIZEBOX)) GUICtrlCreateTab(2, 2, 496, 496) GUICtrlSetResizing(-1, $GUI_DOCKLEFT + $GUI_DOCKTOP + $GUI_DOCKRIGHT + $GUI_DOCKBOTTOM) GUICtrlCreateTabItem("Example") $hGUI2 = GUICreate("", 488, 464, $iLeft, 26, $WS_POPUP, $WS_EX_MDICHILD, $hGUI) For $i = 1 To 50 GUICtrlCreateLabel('Label ' & $i, $iLeft, $iTop, $iWidth, $iHeight) GUICtrlSetBkColor(-1, 0xFFFFFF) GUICtrlSetResizing(-1, $GUI_DOCKALL) ; Prevent resizing $bot = $iTop + $iHeight ; Bottom edge of the last label $iTop = $bot + $iSpacing ; Top of next label Next $cButton = GUICtrlCreateButton("Maximize", 400, 40, 50, 30) GUICtrlCreateTabItem("") $iMaxScrollHeight = $iTop _GUIScrollbars_Generate($hGUI2, 0, $iMaxScrollHeight) GUISetState(@SW_SHOW, $hGUI) GUISetState(@SW_SHOW, $hGUI2) GUIRegisterMsg($WM_SIZE, "_WM_SIZE") While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $cButton GUISetState(@SW_MAXIMIZE) EndSwitch Wend Func _WM_SIZE($hWnd, $iMsg, $wParam, $lParam) #forceref $iMsg, $wParam, $lParam If $hWnd = $hGUI Then ; Get new GUI size Local $aGUI_Size = WinGetClientSize($hGUI) ; Resize scroll GUI WinMove($hGUI2, "", Default, Default, ($aGUI_Size[0] - 14), ($aGUI_Size[1] - 34)) ; Create scrollbar if needed If $aGUI_Size[1] < $iMaxScrollHeight Then _GUIScrollbars_Generate($hGUI2, 0, $iMaxScrollHeight) EndIf EndIf EndFunc ;==>_WM_SIZE
  13. Indeed . Don't know if it's for laziness or for conenience, but I prefer don't reinvent the wheel when I can
  14. I've got it partially figured out using #include <Clipboard.au3> While True $Clip = _ClipBoard_GetDataEx($CF_UNICODETEXT) _ClipBoard_SetDataEx($Clip, $CF_UNICODETEXT) Sleep(100) WEnd But still lose some data, specifically cell sizing. Edit: Disregard, sleep(100) seems to have screwed it up somehow when I was testing before. Works fine.
  15. in the array returned by this function you will have: in column 1, elements belonging only to array 1; in column 2, elements belonging only to array 2; in column 3, elements belonging to both arrays p.s. it's a case sensitive function #include <Array.au3> Local $sAlphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" $aAlphabet = StringSplit($sAlphabet, "", 2) Local $sWord = "HELLO" ; "hello" ; "Hello" ; $aWord = StringSplit($sWord, "", 2) _ArrayDisplay(_Separate($aAlphabet, $aWord)) Func _Separate(ByRef $in0, ByRef $in1) $in0 = _ArrayUnique($in0, 0, Default, Default, 0) $in1 = _ArrayUnique($in1, 0, Default, Default, 0) Local $z[2] = [UBound($in0), UBound($in1)], $low = 1 * ($z[0] > $z[1]), $aTemp[$z[Not $low]][3], $aOut = $aTemp, $aNdx[3] For $i = 0 To $z[Not $low] - 1 If $i < $z[0] Then $aTemp[$i][0] = $in0[$i] If $i < $z[1] Then $aTemp[$i][1] = $in1[$i] Next For $i = 0 To $z[$low] - 1 $x = _ArrayFindAll($aTemp, $aTemp[$i][$low], 0, 0, 1, 0, Not $low) If Not @error Then ; both For $j = 0 To UBound($x) - 1 $aTemp[$x[$j]][2] = 1 Next $aOut[$aNdx[2]][2] = $aTemp[$i][$low] $aNdx[2] += 1 Else ; only in $low $aOut[$aNdx[$low]][$low] = $aTemp[$i][$low] $aNdx[$low] += 1 EndIf Next For $i = 0 To $z[Not $low] - 1 If $aTemp[$i][2] <> 1 Then $aOut[$aNdx[Not $low]][Not $low] = $aTemp[$i][Not $low] $aNdx[Not $low] += 1 EndIf Next ReDim $aOut[_ArrayMax($aNdx)][3] Return $aOut EndFunc ;==>_Separate reference: https://www.autoitscript.com/forum/topic/164728-compare-2-arrays-with-3-arrays-as-a-result/?do=findComment&comment=1202060
  16. That still removes formatting. User 5 Data 1 4/18 User 2 Data 2 4/15 user 3 Data 3 4/18 User 4 Data 4 4/19 Data 5 4/19 instead of User 5 Data 1 4/18 User 2 Data 2 4/15 user 3 Data 3 4/18 User 4 Data 4 4/19 Data 5 4/19
  17. @rcmaehl You could do something like this: #include <MsgBoxConstants.au3> #include <StringConstants.au3> Global $varClipContent = ClipGet() MsgBox($MB_ICONINFORMATION, "Before:", $varClipContent & @CRLF & "User 1 will become now User 5") $varClipContent = StringRegExpReplace($varClipContent, 'User 1', 'User 5') MsgBox($MB_ICONINFORMATION, "After:", $varClipContent & @CRLF & "User 1 is now User 5") ClipPut($varClipContent)
  18. Hi all, I'm having an issue in which if the clipboard contains special formatting it does not pass to ClipPut. I've included a sample script and data below. While True $Clip = ClipGet() ClipPut($Clip) Sleep(100) WEnd Input: User 1 Data 1 4/18 User 2 Data 2 4/15 user 3 Data 3 4/18 User 4 Data 4 4/19 Data 5 4/19 Output: User 1 Data 1 4/18 User 2 Data 2 4/15 User 3 Data 3 4/18 User 4 Data 4 4/19 Data 5 4/19 Is there any way to modify the clipboard data while keeping special formatting? Thanks!
  19. This behavior might not be 100% kosher #include<array.au3> local $aLphabet[8] = ['A','B','D','F','G','H','I' ,'O'] local $aWord[5] = ['H','E','L','L','O'] _ArrayDisplay(StringRegExp(_ArrayToString($aWord , ',') , _ArrayToString($aLphabet , '|') , 3) , 'Matches')
  20. Hopefully the text you want to look for is in a specific control, as that would be rather simple using the array returned from ControlGetPos() If the text you are looking for is only part of a big edit box, or blob of text then as Nine said, you will need OCR. I posted something I did for this here: google tesseract ocr
  21. ok..figured out some of it...When the unit reboots, it sends the name, serial number, and other info back to the script...I didnt filter that info out so it actually was getting added to the show stat array....causing the error...Thanks @Jojo-OP2, used the console....working now to filter the response from the unit! Thanks @jdelaney, still learning the error checking of arrays!!
  22. Possible workaround: ControlClick($hWnd, '', '[CLASS:TPageControl; INSTANCE:1]', 'primary', 1, $g_aGuiLoc[$LOC_TAB_2][$COORD_X], $g_aGuiLoc[$LOC_TAB_2][$COORD_Y]) Where $g_aGuiLoc contains coordinates to (somewhere inside) concerning tab header (relative to TPageControl's location). Address controls by INSTANCE. First activation of each tab changes INSTANCE number of controls (cycle through all tabs first for INSTANCE to consistently relate to same control). Now it should be possible to address controls by for example [CLASS:TEdit; INSTANCE:25] (even if another tab than containing one is visible). Not all GUICtrl...() functions work for Delphi controls (most cases solvable using workarounds however).
  23. ConsoleWrite($sResult) $srString = StringReplace($sResult, @CRLF & @CRLF, @CRLF) $srString = StringReplace($srString, "SHOW STAT", "") $srString = StringReplace($srString, "ATTN", "") $srString = StringReplace($srString, ">", "") $srString = StringReplace($srString, @CRLF, "|") $srString = StringStripWS($srString, $STR_STRIPLEADING + $STR_STRIPTRAILING + $STR_STRIPSPACES) ConsoleWrite($srString & @CRLF) $aSTATtemp = StringSplit($srString, "|", 2) Can you insert the 2 Consolewrite lines and check if the output is correct ? And since you use $cols for your columms you should also use it for your loop instead of Ubound($cell, 1) - 1 Edit : Unless you expect a diffrent number of cells every time* Local $cols = 3 Local $arr[1][$cols] Local $cell For $ii = 0 To UBound($aSTATtemp, 1) - 1 $cell = StringSplit($aSTATtemp[$ii], " ", 2) ReDim $arr[UBound($arr, 1) + 1][$cols] For $jj = 0 To $cols - 1 ; <===== use $cols $arr[$ii][$jj] = $cell[$jj] Next Next _ArrayDelete($arr, UBound($arr, 1) - 1) _ArrayColDelete($arr, 0)
  1. Load more activity
×
×
  • Create New...