Sign in to follow this  
Followers 0
karman

_sendmessage problems

8 posts in this topic

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);
    }

Share this post


Link to post
Share on other sites



you wrote it wrong.

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

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

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

is sherlock in the house

anyone know what's wrong with my code? cookies for good answers

i wrote that $szText = a stringsplit'd array.. so my for loop is correct

Edited by karman

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

noone has posted anything related to my question~~ im asking why my autoit code doesn't work (but the c++ does) not how you loop through an array.

ty

nvm got it working.

Edited by karman

Share this post


Link to post
Share on other sites

noone has posted anything related to my question~~ im asking why my autoit code doesn't work (but the c++ does) not how you loop through an array.

ty

nvm got it working.

Do not share.

It just wouldn't be appropriate, right?

I'm sure it wasn't your mistake.


♡♡♡

.

eMyvnE

Share this post


Link to post
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
Sign in to follow this  
Followers 0