-
Jan 14th, 2009, 12:31 AM
#1
Thread Starter
Fanatic Member
"Ctrl+ a" in sendmessage.
how to pass ctrl+a through sendmessage?
Visual Studio.net 2010
If this post is useful, rate it
-
Jan 14th, 2009, 12:53 AM
#2
Re: "Ctrl+ a" in sendmessage.
What is your reason for doing that?
-
Jan 14th, 2009, 01:34 AM
#3
Thread Starter
Fanatic Member
Re: "Ctrl+ a" in sendmessage.
i want to select all the content in a file..
Visual Studio.net 2010
If this post is useful, rate it
-
Jan 14th, 2009, 01:39 AM
#4
Re: "Ctrl+ a" in sendmessage.
Where is the file's content being shown?
-
Jan 14th, 2009, 01:43 AM
#5
Thread Starter
Fanatic Member
Re: "Ctrl+ a" in sendmessage.
Please check this http://www.vbforums.com/showthread.php?t=553578
am attempting to get the content of text from a file,,.
I tried throught menu_Click, but in that exe its not working also WM_Copy and WM_Paste too not at all working..rather not getting any error too..
now am trying the api is getwindowstextlength using windows handle id..
Visual Studio.net 2010
If this post is useful, rate it
-
Jan 14th, 2009, 01:51 AM
#6
Re: "Ctrl+ a" in sendmessage.
hai vijay, it seems you want to select all the text form a text editor in to clipboard. is it?
-
Jan 14th, 2009, 01:53 AM
#7
Re: "Ctrl+ a" in sendmessage.
Originally Posted by vijy
now am trying the api is getwindowstextlength using windows handle id..
However, GetWindowTextLength cannot retrieve the length of the text of an edit control in another application.
http://msdn.microsoft.com/en-us/libr...21(VS.85).aspx
-
Jan 14th, 2009, 01:58 AM
#8
Thread Starter
Fanatic Member
Re: "Ctrl+ a" in sendmessage.
Originally Posted by Fazi
sorry windowsgettext
Visual Studio.net 2010
If this post is useful, rate it
-
Jan 14th, 2009, 02:21 AM
#9
Re: "Ctrl+ a" in sendmessage.
vijay,
This code will highlight the text in your text editor.
Code:
Private Declare Sub keybd_event Lib "user32" (ByVal bVk As Byte, ByVal bScan As Byte, ByVal dwFlags As Long, ByVal dwExtraInfo As Long)
Private Declare Function SetForegroundWindow Lib "user32" (ByVal hwnd As Long) As Long
Private Sub Command1_Click()
SetForegroundWindow 198574 ' find the main app window handle of your app and put it here using findwindow.
keybd_event &H11, 0, 0, 0 ' ctrl
keybd_event &H41, 0, 0, 0 ' A
keybd_event &H11, 0, KEYEVENTF_KEYUP, 0
keybd_event &H41, 0, KEYEVENTF_KEYUP, 0
End Sub
Last edited by Fazi; Jan 14th, 2009 at 02:30 AM.
-
Jan 14th, 2009, 02:44 AM
#10
Thread Starter
Fanatic Member
Re: "Ctrl+ a" in sendmessage.
thanks fazi.. its working..
but in the case if i execute the exe using shell command , then automatically it has to select..
in a command_Click i wrote this..
the text selecting only if i click the command again,,
vb Code:
Dim sArg As String = "F:\epsfile\Equ3.eps"
Shell("c:\program files\Mathtype\mathtype.exe " & sArg & "")
Dim hWnd, lngresult As Long
Dim sInput As String = "MathType - " & sArg & " (EPS/TIFF)"
hWnd = FindWindow(vbNullString, sInput)
SetForegroundWindow(hWnd)
keybd_event(&H11, 0, 0, 0) ' ctrl
keybd_event(&H41, 0, 0, 0) ' A
keybd_event(&H11, 0, KEYEVENTF_KEYUP, 0)
keybd_event(&H41, 0, KEYEVENTF_KEYUP, 0)
Last edited by vijy; Jan 14th, 2009 at 02:51 AM.
Visual Studio.net 2010
If this post is useful, rate it
-
May 17th, 2011, 03:11 PM
#11
Hyperactive Member
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
|