Jump to content

Search the Community

Showing results for tags 'reverse string'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • General
    • Announcements and Site News
    • Administration
  • AutoIt v3
    • AutoIt Help and Support
    • AutoIt Technical Discussion
    • AutoIt Example Scripts
  • Scripting and Development
    • Developer General Discussion
    • Language Specific Discussion
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Categories

  • AutoIt Team
    • Beta
    • MVP
  • AutoIt
    • Automation
    • Databases and web connections
    • Data compression
    • Encryption and hash
    • Games
    • GUI Additions
    • Hardware
    • Information gathering
    • Internet protocol suite
    • Maths
    • Media
    • PDF
    • Security
    • Social Media and other Website API
    • Windows
  • Scripting and Development
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Member Title


Location


WWW


Interests

Found 1 result

  1. Hi, I'm surprised about the behavior of controlsend to the edit control when using subclassing: #include <constants.au3> #include <windowsconstants.au3> #include <gdiplus.au3> #include <guiconstantsex.au3> _GDIPlus_Startup() Global Const $hGUI = GUICreate("Test", 602, 198, 192, 124) Global Const $idEdit = GUICtrlCreateEdit("", 0, 0, 601, 145) GUICtrlSetFont($idEdit, 10, 400, 0, "Lucida Console") Global Const $hEdit = GUICtrlGetHandle($idEdit) Global Const $idButton1 = GUICtrlCreateButton("Send 2 Edit", 8, 160, 75, 25) Global Const $idButton2 = GUICtrlCreateButton("Exit", 520, 160, 75, 25) Global Const $hBitmap = CreateCaretBitmap() Global Const $iBlinkTime_save = DllCall('user32.dll', 'int', 'GetCaretBlinkTime') Global Const $iBlinkTime = Int($iBlinkTime_save[0] * 0.9) Global Const $hCaretProc = DllCallbackRegister("CaretProc", "ptr", "hwnd;uint;long;ptr") Global Const $hOldCaretProc = _WinAPI_SetWindowLong($hEdit, $GWL_WNDPROC, DllCallbackGetPtr($hCaretProc)) GUISetState(@SW_SHOW) Global $hEditWndProc = DllCallbackRegister("EditWndProc", "long", "hwnd;uint;wparam;lparam") Global $hOldEditProc = _WinAPI_SetWindowLong($hEdit, $GWL_WNDPROC, DllCallbackGetPtr($hEditWndProc)) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE, $idButton2 DllCall('user32.dll', 'int', 'SetCaretBlinkTime', 'uint', $iBlinkTime_save[0]) _WinAPI_SetWindowLong($hEdit, $GWL_WNDPROC, $hOldCaretProc) DllCallbackFree($hCaretProc) _WinAPI_DeleteObject($hBitmap) _WinAPI_SetWindowLong($hEdit, $GWL_WNDPROC, $hOldEditProc) DllCallbackFree($hEditWndProc) _GDIPlus_Shutdown() Exit Case $idButton1 ControlFocus($hGUI, "", $idEdit) ControlSend($hGUI, "", $idEdit, "This is a TEST" & @LF) EndSwitch WEnd Func EditWndProc($hWnd, $iMsg, $wParam, $lParam) Switch $iMsg Case $WM_KEYDOWN ConsoleWrite("A key was pressed" & @LF) EndSwitch Return _WinAPI_CallWindowProc($hOldEditProc, $hWnd, $iMsg, $wParam, $lParam) EndFunc ;==>EditWndProc Func CaretProc($hWnd, $iMsg, $wParam, $lParam) Local $iRet = _WinAPI_CallWindowProc($hOldCaretProc, $hWnd, $iMsg, $wParam, $lParam) Switch $iMsg Case $WM_SETFOCUS DllCall('user32.dll', 'int', 'CreateCaret', 'hwnd', $hWnd, 'ptr', $hBitmap, 'int', 0, 'int', 0) DllCall('user32.dll', 'int', 'ShowCaret', 'hwnd', $hWnd) DllCall('user32.dll', 'int', 'SetCaretBlinkTime', 'uint', $iBlinkTime) Case $WM_KILLFOCUS DllCall('user32.dll', 'int', 'HideCaret', 'hwnd', $hWnd) DllCall('user32.dll', 'int', 'DestroyCaret') DllCall('user32.dll', 'int', 'SetCaretBlinkTime', 'uint', $iBlinkTime_save[0]) EndSwitch Return $iRet EndFunc Func CreateCaretBitmap($iW = 9, $iH = 14, $iColor = 0xFFC0C0C0) Local Const $aResult = DllCall($ghGDIPDll, "uint", "GdipCreateBitmapFromScan0", "int", $iW, "int", $iH, "int", 0, "int", 0x0026200A, "ptr", 0, "int*", 0) Local Const $hBitmap = $aResult[6] Local Const $hCtx = _GDIPlus_ImageGetGraphicsContext($hBitmap) Local Const $hBrush = _GDIPlus_BrushCreateSolid($iColor) _GDIPlus_GraphicsFillRect($hCtx, 0, $iH - 3, $iW, $iH, $hBrush) _GDIPlus_BrushDispose($hBrush) _GDIPlus_GraphicsDispose($hCtx) Local $hHBitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBitmap) _GDIPlus_BitmapDispose($hBitmap) Return $hHBitmap EndFunc When you press the "Send 2 Edit" the string "This is a TEST" & @LF will be sent to the edit control but reversed! When you e.g. disable the 1st DllCallbackRegister() then it is working as expected. Any explanation for this behavior? Br, UEZ
×
×
  • Create New...