Jump to content

_sendmessage problems


karman
 Share

Recommended Posts

func text($hWnd, $szText)
    for $i = 1 to $szText[0] step 1
        _SendMessage($hWnd, 0x0102, $szText[$i], 0)
        sleep(10)
    Next
    return True
EndFunc

0x0102 = WM_CHAR

hwnd is valid.. $sztext is just an array of chars from stringsplit

here is the code im using in c++ and it's working.. why doesn't the autoit one? tNx.

for(int i=0;i<strlen(txt);i++) {
    SendMessage(hWnd, WM_CHAR, Text[i], 0);
    Sleep(10);
    }
Link to comment
Share on other sites

func text($hWnd, $szText)
    for $i = 1 to $szText[0] step 1
        _SendMessage($hWnd, 0x0102, $szText[$i], 0)
        sleep(10)
    Next
    return True
EndFunc

0x0102 = WM_CHAR

hwnd is valid.. $sztext is just an array of chars from stringsplit

here is the code im using in c++ and it's working.. why doesn't the autoit one? tNx.

for(int i=0;i<strlen(txt);i++) {
    SendMessage(hWnd, WM_CHAR, Text[i], 0);
    Sleep(10);
    }
For $i = 0 To $szText[0]-1
If $szText is text length. Edited by Andreik

When the words fail... music speaks.

Link to comment
Share on other sites

You can try to use StringToASCIIArray(

or make AscW($szText[$i])

*GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes

Link to comment
Share on other sites

func text($hWnd, $szText)
    for $i = 1 to $szText[0] step 1
        _SendMessage($hWnd, 0x0102, $szText[$i], 0)
        sleep(10)
    Next
    return True
EndFunc

0x0102 = WM_CHAR

hwnd is valid.. $sztext is just an array of chars from stringsplit

here is the code im using in c++ and it's working.. why doesn't the autoit one? tNx.

for(int i=0;i<strlen(txt);i++) {
    SendMessage(hWnd, WM_CHAR, Text[i], 0);
    Sleep(10);
    }
The way I loop through the rows in an array is:

for $i = 0 to ubound($array) - 1

next

you can omit step 1; it's implied

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...