CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 15 of 15

Threaded View

  1. #10
    Join Date
    Mar 2010
    Posts
    26

    Re: Need help with Macro: Copy selection from one app insert to another application!

    This is a project that uses the functions that I use.

    It is developed in VB.Net 2008 and I am using Windows 7 which has quite a different UI than XP


    First open "Map Network Drive"

    Press the first button to get its hwnd. This uses the api call findwindow and assumes you know the complete caption.

    Press the next button to enumerate all of it's child windows. This uses a callback function to iterate through all the controls on the parent form (window).

    The TextBox (Combo) you are interested in has a class name "Edit" and is the only one with this
    class name - press the next button and the text box will show only the hwnd for this.
    The XP version may be different - you can find this out using SPY++ if you have it installed.

    The next button "Bring to Foreground" makes the parent the active window and the textbox/combo as the live data entry point (In Windows buttons textboxes and most controls are just windows with the all important hwnd)

    SendKeys down emulates a down keystroke to ensure the next line of text appears in the window (note I have to set the targert as foreground again as pressing this button makes my application the active window). I am using sendkeys but I am open to hearing a better way of doing it!

    Press "Gettext" copies the text and puts it in a textbox.

    Witrh regard to placing the data retrieved into an outlook message and mailing it I don't have a clue how to go about this but you seem to have this part covered.

    I hope this helps
    Attached Files Attached Files

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

Featured