Jump to content

junkew

MVPs
  • Posts

    3,060
  • Joined

  • Last visited

  • Days Won

    14

junkew last won the day on February 16

junkew had the most liked content!

About junkew

Profile Information

  • Location
    Netherlands, Oostzaan

Recent Profile Visitors

4,607 profile views

junkew's Achievements

  1. You could have tried faq31 with simplespy or inspect.exe to see if more is recognized.
  2. Interesting but if Au3Inf is seeing it you should be able to handle it. https://learn.microsoft.com/en-us/shows/visual-studio-toolbox/xaml-islands Try FAQ 31 with UIAutomation Whats the output of this Example() Func Example() ; Retrieve a list of window handles. Local $aList = WinList() ; Loop through the array displaying only visable windows with a title. For $i = 1 To $aList[0][0] If $aList[$i][0] <> "" And BitAND(WinGetState($aList[$i][1]), 2) Then consolewrite("Title: " & $aList[$i][0] & @CRLF & "Handle: " & $aList[$i][1] & @CRLF) ; Retrieve the classlist of the window using the handle returned . Local $sClassList = WinGetClassList($aList[$i][1]) consolewrite(stringreplace($sClassList,@LF,@LF & " -")& @CRLF) EndIf Next EndFunc ;==>Example
  3. This seems to work for both controls but you have to set the rich text box first to point 0,0 The reverse order is not working #include <EditConstants.au3> #include <GuiEdit.au3> #include <GuiRichEdit.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> Example() Func Example() Local $hGui=GUICreate("My GUI edit and rich edit") ; will create a dialog box that when displayed is centered local $someTextLines=stringreplace("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx","x", "line" & @crlf) Local $idMyedit = GUICtrlCreateEdit($someTextLines & @CRLF, 10, 10, 350, 180, $ES_MULTILINE+$ES_AUTOVSCROLL + $WS_VSCROLL) Local $hRichEdit = _GUICtrlRichEdit_Create($hGui, $someTextLines, 10, 210, 350, 180, bitor($ES_MULTILINE, $ES_AUTOVSCROLL, $WS_VSCROLL)) ;~ Important line _GUICtrlRichEdit_SetSel($hRichEdit, 0, 0) GUISetState(@SW_SHOW) ;~ GUICtrlSendMsg ($hRichEdit, $EM_LINESCROLL, 0, 0) local $i For $i=10 to 20 ;~ _GUICtrlEdit_LineScroll($idMyedit, 0, _GUICtrlEdit_GetLineCount($idMyedit)) ;~ _GUICtrlEdit_LineScroll($hRichEdit, 0, _GUICtrlEdit_GetLineCount($hRichEdit)) _GUICtrlEdit_LineScroll($idMyedit, 0, $i) _GUICtrlEdit_LineScroll($hRichEdit, 0, $i) ;~ GUICtrlSendMsg ($hRichEdit, $EM_LINESCROLL, 0, $i) ;~ Local $nIndex = GUICtrlSendMsg ($hRichEdit, $EM_LINEINDEX, $i, 0) ;~ GUICtrlSendMsg ($hRichEdit, $EM_SETSEL, $nIndex, 0) ;~ ControlCommand ($hGUI, "", $hRichEdit, "SetCurrentSelection", @CRLF) ;~ $iCharPosition = _GUICtrlRichEdit_GetFirstCharPosOnLine($hRichEdit, $i) ;~ _GUICtrlRichEdit_SetSel($hRichEdit, $iCharPosition, $iCharPosition + 4) sleep(250) next ;~ Important line ;~ _GUICtrlEdit_SetSel($idMyedit, -1, -1) ;~ _GUICtrlRichEdit_SetSel($hRichEdit, -1,-1) For $i=10 to 0 step -1 _GUICtrlEdit_LineScroll($idMyedit, 0, $i) _GUICtrlEdit_LineScroll($hRichEdit, 0, $i) sleep(250) next ; Loop until the user exits. While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd GUIDelete() EndFunc ;==>Example
  4. https://www.autoitscript.com/autoit3/docs/libfunctions/_GUICtrlRichEdit_FindText.htm https://www.autoitscript.com/autoit3/docs/libfunctions/_GUICtrlRichEdit_GotoCharPos.htm Goto 0 and in a loop find carriage return Probably with those messages you will be able to do this EM_POSFROMCHAR EM_CHARFROMPOS EM_LINEFROMCHAR EM_LINEINDEX EM_LINESCROLL And the editcontrol functions should work also otherwise you need sendmessage function with windows messages https://learn.microsoft.com/en-us/windows/win32/controls/about-rich-edit-controls https://www.autoitscript.com/autoit3/docs/libfunctions/_GUICtrlEdit_LineScroll.htm
  5. https://github.com/MicrosoftDocs/win32/blob/docs/desktop-src/wintouch/architectural-overview.md is having WM_TOUCH messages. Then it depends afterwards what the driver is doing if its a nice driver it uses sendinput for driving the keyboard and/or mouse. (which you then can hook with a keyboard hook) And not sure where MS is going with WinUI: https://learn.microsoft.com/en-us/uwp/api/windows.ui.input.preview.injection?view=winrt-26100
  6. @Nine saying the same but with different wording😀 for sure its in the area of lowlevel messaging and hooking. With the limiterd amount of information how the swipe driver is sending ctrl and left its hard to guess which messages to hook.
  7. https://learn.microsoft.com/en-us/windows/win32/winmsg/about-messages-and-message-queues The whole windows system is based on messaging. Your swipedevice has a driver that if it nicely behaves transforms your guesture to a sendinput or sendmessage for a keyboardmessage ctrl and left. So you must know which messages the driver is sending and then you have to catche.hook them. An advanced topic where you probably have to read a lot.
  8. https://www.autoitscript.com/autoit3/docs/libfunctions/_WinAPI_SetWindowsHookEx.htm
  9. To make it complete. The BSTR has a definition: https://learn.microsoft.com/en-us/previous-versions/windows/desktop/automat/bstr?redirectedfrom=MSDN And some nice topic on many variable types was made by @LarsJ
  10. The syntax is: object.Add key, item object.Item (key) [ = newitem ] so if you add it twice you have a duplicate key error so the 2nd time you should use the item syntax
  11. Waiting for the fasm version and see if OP gets any version 100% running.
  12. Yes offcourse 🙃🤫
  13. @Werty tried to run your example but only get 1111 as a result for 9.png see below my reproducing script. Could not directly see why it gives 1111 instead of 9142 or was this about getting the exact $posx and $posy right Maybe I am miscalculating 100,100 for the form +16,16 for the drawImageRect. #include <GDIPlus.au3> #include <WinAPI.au3> HotKeySet("{ESC}", "_exit") ;Be sure $posx and $posy is pointing at the correct spot! Global $posx = 116 + 29 + 3, $posy = 116 + 32 + 12 , $result = "", $code[4], $capture, $pixels = DllStructCreate('dword[2816]') ;Lookup table to avoid searching Global $digit[115] = [1,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0, _ 0,0,0,0,0,0,0,0,0,0,6,0,0,0,3,2,0,0,0,0, _ 0,0,0,0,0,0,0,0,9,0,0,0,0,0,8,0,0,0,0,0, _ 0,0,0,0,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, _ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, _ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,5] ;Test section ;-------------------------------------------------------------- $gui = GUICreate("Getnumber", 640, 480, 100, 100) GUISetState() WinWaitActive($gui); <--- necessary or screencapture fails _GDIPlus_Startup() $graphics = _GDIPlus_GraphicsCreateFromHWND($gui) $image = _GDIPlus_BitmapCreateFromFile(@UserProfileDir & "\downloads\examples\" & "9.png") _GDIPlus_GraphicsDrawImageRect($graphics, $image, 16, 16, 176, 56) Sleep(250); <------- necessary because drawimagerect() is too slow, script occasionally fails without ;-------------------------------------------------------------- ;/Test section ;~ $hDDC = _WinAPI_GetDC(0) ;should be ;~ $hDDC = _WinAPI_GetWindowDC($tool) $hDDC = _WinAPI_GetDC($gui) $hCDC = _WinAPI_CreateCompatibleDC($hDDC) $capture = _WinAPI_CreateCompatibleBitmap($hDDC, 88, 32) _WinAPI_SelectObject($hCDC, $capture) _WinAPI_BitBlt($hCDC, 0, 0, 88, 32, $hDDC, $posx, $posy, 0x00CC0020) _WinAPI_DeleteDC($hCDC) Sleep(250) local $t2 = TimerInit() $result = Getnumber($result) Consolewrite("Time: " & TimerDiff($t2) & @crlf) Consolewrite("Result: " & $result & @crlf) While 1 Sleep(10) WEnd Func Getnumber($result) Local $code[4] = [0,0,0,0], $value = 64 DllCall('gdi32.dll', 'dword', 'GetBitmapBits', 'ptr', $capture, 'dword', DllStructGetSize($pixels), 'ptr', DllStructGetPtr($pixels)) For $loop = 1 To 2816 Step 440 $code[0] += DllStructGetData($pixels, 1, $loop ) > 4278190080 ? $value:0 $code[1] += DllStructGetData($pixels, 1, $loop+29) > 4278190080 ? $value:0 $code[2] += DllStructGetData($pixels, 1, $loop+58) > 4278190080 ? $value:0 $code[3] += DllStructGetData($pixels, 1, $loop+87) > 4278190080 ? $value:0 $value /= 2 Next ;~ consolewrite($code[0] & $code[1] & $code[2] & $code[3]) Return String($digit[$code[0]]) & String($digit[$code[1]]) & String($digit[$code[2]]) & String($digit[$code[3]]) EndFunc Func _exit() _GDIPlus_Shutdown() Exit EndFunc
  14. And a small explainer on what @Werty is doing (I am off some pixels but I hope @Hashim get the concept as indicated by the red dots) Zoom in on the image to see the 28 pixels used for comparison and understanding why its important to have the screenshots exactly aligned.
×
×
  • Create New...