SendKeys {Chr(13)} 
Author Message
 SendKeys {Chr(13)}

Thanks to those willing to teach;

I'm trying to send the Chr(13) to a control in an outside app.

My WM_xxx knowledge is limited so I don't know if this is right or not.
Well - actually, I know it's not, 'cause it isn't workin'.

Private Sub List1_Click()
    SendMessageReturn = SendMessage(gWnd, WM_SETTEXT, CLng(0), ByVal
List1.Text)
    SendMessageReturn = SendMessage(gWnd, WM_VKEYTOITEM, CLng(0), VK_RETURN)
End Sub

Also - any recomended reading/reference on the WM_ topic would be helpful.
I've read throught he Win32API.txt but theres not alot of description out
there.

TIA,
TAC



Wed, 18 Jun 1902 08:00:00 GMT  
 SendKeys {Chr(13)}
This is possible if you are using Windows 3.1, but in Windows 95/NT, you can
not do this any more.

When sending message "WM_SETTEXT" to other application, the SendMessage()
just send the pointer of the memory which contains the data, the pointer is
represent in long number. But, the receiving application try the retrieve
the data from the pointer, it does not found the value. Since WIN32 using
different memory space for different application.

Teow


Quote:

> Thanks to those willing to teach;

> I'm trying to send the Chr(13) to a control in an outside app.

> My WM_xxx knowledge is limited so I don't know if this is right or not.
> Well - actually, I know it's not, 'cause it isn't workin'.

> Private Sub List1_Click()
>     SendMessageReturn = SendMessage(gWnd, WM_SETTEXT, CLng(0), ByVal
> List1.Text)
>     SendMessageReturn = SendMessage(gWnd, WM_VKEYTOITEM, CLng(0),
VK_RETURN)
> End Sub

> Also - any recomended reading/reference on the WM_ topic would be helpful.
> I've read throught he Win32API.txt but theres not alot of description out
> there.

> TIA,
> TAC



Wed, 18 Jun 1902 08:00:00 GMT  
 SendKeys {Chr(13)}


Quote:
> When sending message "WM_SETTEXT" to other application, the SendMessage()
> just send the pointer of the memory which contains the data, the pointer
is
> represent in long number. But, the receiving application try the retrieve
> the data from the pointer, it does not found the value. Since WIN32 using
> different memory space for different application.

I can't say what the original poster's problem is, but this should be fine.

SendMessage (not PostMessage, though) does some behind the scenes magic for
WM_SETTEXT (and other similiar messages that worked in Win 3.1, but would
break in win32 because of the memory model) so that the pointer is valid to
the receiving window.

To test this, try running something like the following, after opening an
instance of notepad:

   Dim hWndNotepad As Long
   hWndNotepad = FindWindow("Notepad", vbNullString)
   SendMessage hWndNotepad, WM_SETTEXT, 0, ByVal "This is a test string"

It still changes the caption in win32 land.

--

Sample code, utilities, and more at:
http://www.scottandmichelle.net/scott/code/



Wed, 18 Jun 1902 08:00:00 GMT  
 SendKeys {Chr(13)}

To clarify - the WM_SETTEXT is not my problem - sending the 'return' i.e.
chr(13) is my problem - I can't get it to go across to the other app.

Given the same gWnd - The set text is good - sends the text to the control I
want.
But the control further needs a return sent to it.

Any ideas how to do this?

Private Sub List1_Click()
    SendMessageReturn = SendMessage(gWnd, WM_SETTEXT, CLng(0), ByVal
List1.Text)
    'SendMessageReturn =1 a success

'<<<<<<<My problem  is here >>>>>>>
    SendMessageReturn = SendMessage(gWnd, WM_VKEYTOITEM, CLng(0), VK_RETURN)
    'SendMessageReturn =0 a failure

End Sub

Quote:



>> When sending message "WM_SETTEXT" to other application, the SendMessage()
>> just send the pointer of the memory which contains the data, the pointer
>is
>> represent in long number. But, the receiving application try the retrieve
>> the data from the pointer, it does not found the value. Since WIN32 using
>> different memory space for different application.

>I can't say what the original poster's problem is, but this should be fine.

>SendMessage (not PostMessage, though) does some behind the scenes magic for
>WM_SETTEXT (and other similiar messages that worked in Win 3.1, but would
>break in win32 because of the memory model) so that the pointer is valid to
>the receiving window.

>To test this, try running something like the following, after opening an
>instance of notepad:

>   Dim hWndNotepad As Long
>   hWndNotepad = FindWindow("Notepad", vbNullString)
>   SendMessage hWndNotepad, WM_SETTEXT, 0, ByVal "This is a test string"

>It still changes the caption in win32 land.

>--

>Sample code, utilities, and more at:
>http://www.scottandmichelle.net/scott/code/



Wed, 18 Jun 1902 08:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. chr(10) and chr(13) in memofield gives |

2. Chr(10) & Chr(13)

3. Chr(10) and Chr(13) doesn't work

4. is carriage return chr(13) or chr(32)

5. INPUT OR READ TO STRIP CHR(10) AND CHR(13)

6. What is chr$(13) + chr$(10)

7. vbCRLF = chr(13) + chr(10)

8. Enter Parameter value CHR(13)

9. Appending chr(13) to a memo field?

10. what's the difference...(chr(13)) and vbCr

11. appending Chr(13) to memo fields?

12. Question about a WORD document, VB and CHR(13)

 

 
Powered by phpBB® Forum Software