Results 1 to 11 of 11

Thread: "Ctrl+ a" in sendmessage.

  1. #1

    Thread Starter
    Fanatic Member vijy's Avatar
    Join Date
    May 2007
    Location
    India
    Posts
    548

    "Ctrl+ a" in sendmessage.

    how to pass ctrl+a through sendmessage?
    Visual Studio.net 2010
    If this post is useful, rate it


  2. #2
    Software Carpenter dee-u's Avatar
    Join Date
    Feb 2005
    Location
    Pinas
    Posts
    11,123

    Re: "Ctrl+ a" in sendmessage.

    What is your reason for doing that?
    Regards,


    As a gesture of gratitude please consider rating helpful posts. c",)

    Some stuffs: Mouse Hotkey | Compress file using SQL Server! | WPF - Rounded Combobox | WPF - Notify Icon and Balloon | NetVerser - a WPF chatting system

  3. #3

    Thread Starter
    Fanatic Member vijy's Avatar
    Join Date
    May 2007
    Location
    India
    Posts
    548

    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


  4. #4
    Software Carpenter dee-u's Avatar
    Join Date
    Feb 2005
    Location
    Pinas
    Posts
    11,123

    Re: "Ctrl+ a" in sendmessage.

    Where is the file's content being shown?
    Regards,


    As a gesture of gratitude please consider rating helpful posts. c",)

    Some stuffs: Mouse Hotkey | Compress file using SQL Server! | WPF - Rounded Combobox | WPF - Notify Icon and Balloon | NetVerser - a WPF chatting system

  5. #5

    Thread Starter
    Fanatic Member vijy's Avatar
    Join Date
    May 2007
    Location
    India
    Posts
    548

    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


  6. #6
    PowerPoster Fazi's Avatar
    Join Date
    Aug 2005
    Location
    Underworld
    Posts
    2,525

    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?

  7. #7
    PowerPoster Fazi's Avatar
    Join Date
    Aug 2005
    Location
    Underworld
    Posts
    2,525

    Re: "Ctrl+ a" in sendmessage.

    Quote 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

  8. #8

    Thread Starter
    Fanatic Member vijy's Avatar
    Join Date
    May 2007
    Location
    India
    Posts
    548

    Re: "Ctrl+ a" in sendmessage.

    sorry windowsgettext
    Visual Studio.net 2010
    If this post is useful, rate it


  9. #9
    PowerPoster Fazi's Avatar
    Join Date
    Aug 2005
    Location
    Underworld
    Posts
    2,525

    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.

  10. #10

    Thread Starter
    Fanatic Member vijy's Avatar
    Join Date
    May 2007
    Location
    India
    Posts
    548

    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:
    1. Dim sArg As String = "F:\epsfile\Equ3.eps"
    2.         Shell("c:\program files\Mathtype\mathtype.exe " & sArg & "")
    3.         Dim hWnd, lngresult As Long
    4.  
    5.         Dim sInput As String = "MathType - " & sArg & " (EPS/TIFF)"
    6.         hWnd = FindWindow(vbNullString, sInput)
    7.  
    8.         SetForegroundWindow(hWnd)
    9.         keybd_event(&H11, 0, 0, 0) ' ctrl
    10.         keybd_event(&H41, 0, 0, 0) ' A
    11.         keybd_event(&H11, 0, KEYEVENTF_KEYUP, 0)
    12.         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


  11. #11
    Hyperactive Member
    Join Date
    Jun 2006
    Posts
    272

    Re: "Ctrl+ a" in sendmessage.

    thanks...works me very well...looking for a whole day...
    DONT RUN EXECUTABLE FILES FROM UNKNOWN SOURCES.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width