|
-
Sep 6th, 2004, 07:55 AM
#1
Thread Starter
Hyperactive Member
Send a character to active window
Hi,
This is what i use to send a character to the active window ...
But it does not work with some software .....
ds2 = active_control_hwnd
chr_a = â
Call PostMessage(ds2, WM_CHAR, Asc(chr_a), 0&)
Does anyone know a better way to send the charcater to the active window .... ?
the programs Outlook Express and Dreamweaver don't get the WM_CHAR command.....
It is the mark of an instructed mind to rest satisfied with the degree of precision which the nature of the subject admits, and not to seek exactness when only an approximation of the truth is possible.
-Aristotle As quoted in Rapid Development, chapter 8, page 167.
-
Sep 6th, 2004, 04:23 PM
#2
-
Sep 7th, 2004, 01:12 PM
#3
Thread Starter
Hyperactive Member
I want to use sendmsessage
Hi,
I want to send it using sendmessage .....
It is the mark of an instructed mind to rest satisfied with the degree of precision which the nature of the subject admits, and not to seek exactness when only an approximation of the truth is possible.
-Aristotle As quoted in Rapid Development, chapter 8, page 167.
-
Sep 7th, 2004, 01:42 PM
#4
Fanatic Member
the reason sertian applications dont recieve characters like
"áéÉÑÔ¾¶×Ü" may be because the application uses a font that doesn't support those characters.
Try using this and tell us if it workes:
VB Code:
Call PostMessage(ds2, WM_CHAR, 41, 0&)
-
Sep 7th, 2004, 02:02 PM
#5
Thread Starter
Hyperactive Member
I want to send the backspace key
Hi,
I used it this way and it worked
Call PostMessage(ds2, WM_CHAR, asc(chr_a), 1)
But can't send the backspace key that way ....
I tried the WM_KEYDOWN and WM_KEYUP messages too...
How can I send the backspace key using sendmessage ....?
Is there another way to send the backspace key using sendmessage...
It is the mark of an instructed mind to rest satisfied with the degree of precision which the nature of the subject admits, and not to seek exactness when only an approximation of the truth is possible.
-Aristotle As quoted in Rapid Development, chapter 8, page 167.
-
Sep 7th, 2004, 02:50 PM
#6
Lively Member
Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Const WM_CHAR As Long = &H102
Public Const VK_RETURN = &HD 'you must use your key LOOK HERE!
sub SendReturnToNotepad()
dim hWindow as long
hWindow=FindWindow(vbNullString,"Notepad")
SendMessage hWindow, WM_CHAR, VK_RETURN, 0&
end sub
If that doesn't work for you, you can try to get the
Virtual Key for backspace using this api.
Declare Function MapVirtualKey Lib "user32.dll" Alias "MapVirtualKeyA" ( _
ByVal wCode As Long, _
ByVal wMapType As Long) As Long
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|