Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 03/10/2022 in all areas

  1. Here another way to interact with an input box : #include <WinAPISys.au3> #include <GuiEdit.au3> #include <WinAPIConstants.au3> #include <WinAPIProc.au3> Example() Func Example() Local $hProc = DllCallbackRegister(CbtHookProc, "int", "int;int;int") Global $hHook = _WinAPI_SetWindowsHookEx($WH_CBT, DllCallbackGetPtr($hProc), 0, _WinAPI_GetCurrentThreadId()) Local $iRet = InputBox("Test", "Test") ConsoleWrite(StringLen($iRet) & @CRLF) _WinAPI_UnhookWindowsHookEx($hHook) DllCallbackFree($hProc) EndFunc ;==>Example Func CbtHookProc($nCode, $wParam, $lParam) If $nCode = 5 Then ; 5=HCBT_ACTIVATE $hWnd = HWnd($wParam) ControlSetText($hWnd, "", "Static1", "Cooler stuff here") ControlSetText($hWnd, "", "Button1", "Alright now") ControlSetText($hWnd, "", "Button2", "Forget it !") $hCtrl = ControlGetHandle($hWnd, "", "Edit1") ConsoleWrite($hWnd & "/" & $hCtrl & @CRLF) _GUICtrlEdit_SetLimitText($hCtrl, 500) ; does not work EndIf Return _WinAPI_CallNextHookEx($hHook, $nCode, $wParam, $lParam) EndFunc ;==>CbtHookProc As you can see, we can modify pretty much everything we want, except the text limit (although the informations are exact as per au3info ). Which makes me say, that AutoIt truncates it to 255 characters (maybe because of its buffer size). It is in fact 256 (not 255) because you need to have a chr(0) at the end.
    2 points
  2. Hi, Do not be afraid to say something in these cases - I am neither omniscient nor prone to retaliation! M23
    2 points
  3. This will tell you what is in the inputbox all the time it is displayed. Global $handle, $SetTimer Dim $Folder $handle = DllCallbackRegister("_ReadIPBox", "int", "") $SetTimer = DllCall("User32.dll", "int", "SetTimer", "hwnd", 0, "int", 0, "int", 500, "ptr", DllCallbackGetPtr($handle)) $SetTimer = $SetTimer[0] $answer = InputBox("Question", "Where were you born?", "Planet Earth", "", _ -1, -1, 0, 0) DllCallbackFree($handle) DllCall("user32.dll", "int", "KillTimer", "hwnd", 0, "int", $SetTimer) Func _ReadIPBox() If WinExists("Question") Then ConsoleWrite(ControlCommand("Question","Where were you born?","Edit1","GetLine", 1) & @CRLF) EndIf EndFunc
    2 points
  4. Jon

    AutoIt (Latest Stable Version)

    Version v3.3.16.1

    50,304 downloads

    This is the current stable version of AutoIt. What's new: Changelog. Main AutoIt download page (for AutoIt and other tools like the script editor).
    1 point
  5. @SOLVE-SMART_WD_ElementActionEx provides the ability to hover over an element. 😉
    1 point
  6. Yes you are right, that is a MS limitation (sorry AutoIt). Hooks are quite fun. You can achieve many things very elegantly since it based on event notifications. In fact, I just tested another way, very cool result (using your previous idea) Func CbtHookProc($nCode, $wParam, $lParam) If $nCode = 5 Then ; 5=HCBT_ACTIVATE $hWnd = HWnd($wParam) ControlSetText($hWnd, "", "Static1", "Cooler stuff here") ControlSetText($hWnd, "", "Button1", "Alright now") ControlSetText($hWnd, "", "Button2", "Forget it !") $hCtrl = ControlGetHandle($hWnd, "", "Edit1") ConsoleWrite($hWnd & "/" & $hCtrl & @CRLF) _GUICtrlEdit_SetLimitText($hCtrl, 500) ; does not work ElseIf $nCode = 4 Then ; HCBT_DESTROYWND $hWnd = HWnd($wParam) ConsoleWrite(StringLen(ControlGetText($hWnd, "" ,"Edit1")) & @CRLF) ; works perfect when user clicks OK EndIf Return _WinAPI_CallNextHookEx($hHook, $nCode, $wParam, $lParam) EndFunc ;==>CbtHookProc
    1 point
  7. 3 years later ... Added this declaration check: If IsDeclared("iButtonBorder") = $DECLARED_UNKNOWN Then Local $iButtonBorder (It prevents problems if $iButtonBorder is already defined from include file Debug.au3). ; Set lower button border If IsDeclared("iButtonBorder") = $DECLARED_UNKNOWN Then Local $iButtonBorder $iButtonBorder = 40 If $bDebug Then Select Case Not BitAND($iFlags, $ARRAYDISPLAY_NODATALABELDISPLAY) And BitAND($iFlags, $ARRAYDISPLAY_NOBUTTONSDISPLAY) ;Allow border to show data label $iButtonBorder = 20 Case BitAND($iFlags, $ARRAYDISPLAY_NOBUTTONSDISPLAY) ;No border required for buttons or label (see above, NODATALABELDISPLAY = True) $iButtonBorder = 0 Case Not BitAND($iFlags, $ARRAYDISPLAY_ONLYCOPYBUTTONS) ;Allow border to show both copy & exit buttons (& data label if required) $iButtonBorder = 40 Case BitAND($iFlags, $ARRAYDISPLAY_ONLYCOPYBUTTONS) And Not BitAND($iFlags, $ARRAYDISPLAY_NODATALABELDISPLAY) ; Allow border to show copy buttons & data label (no exit button required) $iButtonBorder = 40 Case Not BitAND($iFlags, $ARRAYDISPLAY_NODATALABELDISPLAY) ;Allow border to show copy buttons, data label & exit button (NODATALABELDISPLAY = False) $iButtonBorder = 40 Case BitAND($iFlags, $ARRAYDISPLAY_ONLYCOPYBUTTONS) And BitAND($iFlags, $ARRAYDISPLAY_NODATALABELDISPLAY) ;Allow border to show copy buttons (no data label) $iButtonBorder = 20 Case Else $iButtonBorder = 40 EndSelect Else $iButtonBorder = 20 ;Allow border to show data label as there's no NODATALABELDISPLAY option for _ArrayDisplay() EndIf @argumentumbelated thank you ArrayDisplayInternals.au3
    1 point
  8. Kloud, Try this version of the UDF - I have locked the GUI during the EXITSIZEMOVE handler which has reduced the flicker. There is still one redraw as the scrollbars are regenerated, but not the complete GUI content redraw of earlier: And here is a slightly modified version of your script to show it working - look for the <<<<<<<<<<< lines: #include <WindowsConstants.au3> #include "Table.au3" #include <GUIScrollbars_Ex_Mod.au3> ;----- GUI (Double Buffered) ----- $GUI = GUICreate("", 450, 450, -1, -1, BitOr($WS_SIZEBOX, $WS_SYSMENU)) ; Use BitOR to combine styles <<<<<<<<<<<<<<<<<<<<< createScrollBarsForGUI() ;----- Make sure GUI exists BEFORE creating Tables ----- GUISetState() ;----- Lock GUI until tables drawn ----- GUISetState(@SW_LOCK) ;----- Table Example 1 ----- GUICtrlCreateLabel(" Example 1 ", 25, 7, 100, 13) $Table1 = _GUICtrlTable_Create(25, 27, 55, 13, 4, 4, 1) _GUICtrlTable_Set_ColumnWidth($Table1, 2, 20) _GUICtrlTable_Set_Justify_All($Table1, 1, 1) _GUICtrlTable_Set_TextFont_Row($Table1, 1, 8.5, 800) _GUICtrlTable_Set_CellColor_Row($Table1, 1, 0xEEEEEE) _GUICtrlTable_Set_Text_Row($Table1, 1, "Control|ID|Window|Staus") _GUICtrlTable_Set_Text_Row($Table1, 2, "CheckBox|2|Main|disabled") _GUICtrlTable_Set_Text_Row($Table1, 3, "ListView|3|Child|active") _GUICtrlTable_Set_Text_Row($Table1, 4, "UpDown|4|Child|disabled") ;----- Table Example 2 ----- GUICtrlCreateLabel(" Example 2 ", 260, 7, 100, 13) $Table2 = _GUICtrlTable_Create(260, 27, 80, 18, 7, 2, 0) _GUICtrlTable_Set_Justify_All($Table2, 1, 1) _GUICtrlTable_Set_TextFont_All($Table2, 8.5, 400, 2, "Century Gothic") _GUICtrlTable_Set_TextFont_Column($Table2, 1, 8.5, 800, 0, "Century Gothic") _GUICtrlTable_Set_CellColor_Column($Table2, 1, 0xffd700) _GUICtrlTable_Set_Text_Row($Table2, 1, "Surname|Biochem") _GUICtrlTable_Set_Text_Row($Table2, 2, "Forename|Andy") _GUICtrlTable_Set_Text_Row($Table2, 3, "Age|30") _GUICtrlTable_Set_Text_Row($Table2, 4, "Height|5'8''") _GUICtrlTable_Set_Text_Row($Table2, 5, "Weight|75kg") _GUICtrlTable_Set_Text_Row($Table2, 6, "Eyes|Brown") _GUICtrlTable_Set_Text_Row($Table2, 7, "M/F|M") _GUICtrlTable_Set_Border_Table($Table2) ;----- Table Example 3 ----- GUICtrlCreateLabel(" Example 3 ", 25, 100, 100, 13) $Table3 = _GUICtrlTable_Create(25, 120, 62, 18, 6, 3, 0) _GUICtrlTable_Set_ColumnWidth($Table3, 1, 70) _GUICtrlTable_Set_Justify_Column($Table3, 1, 1, 1) _GUICtrlTable_Set_Justify_Column($Table3, 2, 2, 1) _GUICtrlTable_Set_Justify_Column($Table3, 3, 1, 1) _GUICtrlTable_Set_Justify_Row($Table3, 1, 1, 1) _GUICtrlTable_Set_Border_Row($Table3, 1, 8) _GUICtrlTable_Set_Border_Row($Table3, 5, 8) _GUICtrlTable_Set_Text_Row($Table3, 1, "Transaction|In|Out") _GUICtrlTable_Set_Text_Row($Table3, 6, "Total|£51.01 |-£157.30 ") _GUICtrlTable_Set_Text_Row($Table3, 2, "Petrol||-£35.00 ") _GUICtrlTable_Set_Text_Row($Table3, 3, "Groceries||-£42.30 ") _GUICtrlTable_Set_Text_Row($Table3, 4, "Interest|£51.01 ") _GUICtrlTable_Set_Text_Row($Table3, 5, "Section 5||-£80.00 ") For $row = 2 To 6 For $col = 2 To 3 _GUICtrlTable_Set_TextFont_Cell($Table3, $row, $col, 9, 400, 2) Next Next _GUICtrlTable_Set_TextFont_All($Table3, 8.5, 400, 2, "Tahoma") _GUICtrlTable_Set_TextFont_Row($Table3, 1, 8.5, 600, 0, "Tahoma") ;----- Table Example 4 ----- GUICtrlCreateLabel(" Example 4 ", 25, 250, 100, 13) $Table4 = _GUICtrlTable_Create(35, 268, 62, 18, 8, 6, 0) _GUICtrlTable_Set_RowHeight($Table4, 1, 35) _GUICtrlTable_Set_Justify_All($Table4, 1, 1) _GUICtrlTable_Set_TextFont_All($Table4, 8.5, 800, 0, "Tahoma") _GUICtrlTable_Set_CellColor_Row($Table4, 1, 0x555555) _GUICtrlTable_Set_TextColor_All($Table4, 0x555555) _GUICtrlTable_Set_TextColor_Row($Table4, 1, 0xFFFFFF) For $row = 3 To 10 Step 2 _GUICtrlTable_Set_CellColor_Row($Table4, $row, 0xDDDDDD) Next _GUICtrlTable_Set_Text_Row($Table4, 1, "Fixing|Size|Weight|Net|Gross|Order") _GUICtrlTable_Set_Text_Row($Table4, 2, "Block|20.0|0.01|300|340|No") _GUICtrlTable_Set_Text_Row($Table4, 3, "Screw|8.5|0.3|50|100|No") _GUICtrlTable_Set_Text_Row($Table4, 4, "Rivet|0.1|0.4|10|11|Yes") _GUICtrlTable_Set_Text_Row($Table4, 5, "Rope|300.0|100.0|2|10|No") _GUICtrlTable_Set_Text_Row($Table4, 6, "Tack|10.6|0.3|1000|1011|Yes") _GUICtrlTable_Set_Text_Row($Table4, 7, "Nail|30.3|0.4|400|600|No") _GUICtrlTable_Set_Text_Row($Table4, 8, "Staple|0.3|0.05|10000|12000|No") _GUICtrlTable_Set_Border_Table($Table4, 0x555555) ;----- Table Example 5 ----- GUICtrlCreateLabel(" Example 5 ", 260, 165, 100, 13) $Table5 = _GUICtrlTable_Create(260, 182, 30, 20, 3, 3, 0) _GUICtrlTable_Set_ColumnWidth($Table5, 1, 200) _GUICtrlTable_Set_Text_Row($Table5, 1, "Attribute|x|y") _GUICtrlTable_Set_CellColor_Row($Table5, 1, 0xEEEEEE) _GUICtrlTable_Set_Justify_All($Table5, 1, 1) _GUICtrlTable_Set_TextFont_All($Table5, 8.5, 200) _GUICtrlTable_Set_TextFont_Row($Table5, 1, 9, 800) _GUICtrlTable_Set_Border_Column($Table5, 2, 1, 0xEEEEEE) _GUICtrlTable_Set_Border_Column($Table5, 3, 1, 0xEEEEEE) _GUICtrlTable_Set_Border_Row($Table5, 1, 11) _GUICtrlTable_Set_Border_Table($Table5) _GUICtrlTable_Set_ColumnWidth($Table5, 1, 100) ;----- Unlock GUI to show tables ----- GUISetState(@SW_UNLOCK) ;----- Loop ----- Do Sleep(10) $m = MouseGetPos() _GUICtrlTable_Set_Text_Row($Table5, 2, "Mouse Position|" & $m[0] & "|" & $m[1]) $w = WinGetPos("") _GUICtrlTable_Set_Text_Row($Table5, 3, "Window Position|" & $w[0] & "|" & $w[1]) _GUIScrollbars_EventMonitor() ; You need this line to cater for Minimize/Restore cycles <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< Until GUIGetMsg() = -3 Func createScrollBarsForGUI() ;return Local $tiMax_Scroll = 900 ; Generate initial scrollbars - required scrollbar handlers registered _GUIScrollbars_Generate($GUI, $tiMax_Scroll, $tiMax_Scroll) ; Intialise for resizing Local $tiFullClient = 0 Local $taMaxSize = _GUIScrollbars_ReSizer($GUI, $tiMax_Scroll, $tiMax_Scroll, $tiFullClient, True) ; Add True to register the handlers <<<<<<<<<<< EndFunc How does it look to you? M23
    1 point
  9. @Kloud on my win 7 no flicker happend! when using: $WS_EX_COMPOSITED
    1 point
  10. Kloud, I imagine it is my GUIScrollbars_Ex UDF which is causing the problem - specifically the _GUIScrollbars_ReSizer function which registers the WM_ENTER/EXITSIZEMOVE messages. So when the GUI is resized (or moved as MS have combined the 2 events alas) the UDF looks to reset the scrollbars correctly which looks to be the source of the flickering as you get exactly the same effect when resizing the GUI. I will look to see if I can do something to change this behaviour when the GUI is simply moved. M23
    1 point
  11. Hi Kloud Does it flicker same or less if you add an extended style $WS_EX_COMPOSITED by changing this line... $GUI = GUICreate("", 450, 450, -1, -1, $WS_SIZEBOX + $WS_SYSMENU) ...to $GUI = GUICreate("", 450, 450, -1, -1, $WS_SIZEBOX + $WS_SYSMENU, $WS_EX_COMPOSITED) If your OS is new, it should flicker same. If it's an old one, it could make a difference.
    1 point
  12. Yes, I can confirm that as well . Since you also tested it with the latest versions of AutoIt, I am a bit surprised that @spudw2k wrote :
    1 point
  13. As just wrote Musashi, the resulting string returned by InputBox is truncated when too long. You can probably type thousands of characters in the InputBox (I pasted 50 times "1234567890 " which is 50*11 length because of the space I added to separate the blocks, so it was 550 characters typed) and they where all in the box when controlling them (ctrl + right key moved from one block to the other, stop at 49, manually controlled the last one was 50th) But look at the result after validation : So max returned seems to be 255 (not 256 as stipulated by OP or 254 as read in the help file) ConsoleWrite also indicates 255. Tested on AutoIt 3.3.14.5 & 3.3.16.0 ConsoleWrite(">> StringLen($sResult) = " & StringLen($sResult) & @crlf) >> StringLen($sResult) = 255
    1 point
  14. Jon

    AutoIt v.3.3.16.0 Released

    AutoIt v3.3.16.0 has been released. Thanks to @jpm and the MVPs who were responsible for the majority of code in this version. Download it here. Complete list of changes: History
    1 point
×
×
  • Create New...