Can Any Body Help Me:- I Want To Send Numeric Enter Key To A Dos Application

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • net2knot
    New Member
    • Feb 2008
    • 11

    #1

    Can Any Body Help Me:- I Want To Send Numeric Enter Key To A Dos Application

    could nebody help me out of this problem.
    i want to send numeric enter key to a dos application. i tried sendkeys but it doesn't trace out the dos application.
    i have designed new module but it also doesn't differentiate between standard enter key and numpad enter key.
  • Killer42
    Recognized Expert Expert
    • Oct 2006
    • 8429

    #2
    Sorry to see you're not getting any response to this.

    I'm afraid I don't know the answer, either. VB doesn't seem to differentiate between the two Enter keys, same with Shift, or Control or Alt. I knew KeyPress events wouldn't care which Enter was pressed, but was a bit surprised to find that KeyDown also doesn't care.

    All I can think of is to try to track down a Windows API function to send a message indicating that a particular key was pressed. I did a quick Google search on "windows api send key" and came up with a few entries that sounded interesting. Try it yourself, or see whether these first couple are any help...

    P.S. I'm using VB6, what version do you have?

    Comment

    • net2knot
      New Member
      • Feb 2008
      • 11

      #3
      Originally posted by Killer42
      Sorry to see you're not getting any response to this.

      I'm afraid I don't know the answer, either. VB doesn't seem to differentiate between the two Enter keys, same with Shift, or Control or Alt. I knew KeyPress events wouldn't care which Enter was pressed, but was a bit surprised to find that KeyDown also doesn't care.

      All I can think of is to try to track down a Windows API function to send a message indicating that a particular key was pressed. I did a quick Google search on "windows api send key" and came up with a few entries that sounded interesting. Try it yourself, or see whether these first couple are any help...



      P.S. I'm using VB6, what version do you have?
      thanks killer42. Atleast i got reply from u r side.
      i too using vb6.0
      i tried the keybd_event api but it doesn't work.
      either i could not used properly....
      but i need a immediate solution as i am trying this for last many months n could not get a proper reply. atlast i got reference of this site n hope for a solution

      Comment

      • net2knot
        New Member
        • Feb 2008
        • 11

        #4
        can any body help me:- sending numpad enter key to a dos application

        thanks killer42. Atleast i got reply from u r side.
        i too using vb6.0
        i tried the keybd_event api but it doesn't work.
        either i could not used properly....
        but i need a immediate solution as i am trying this for last many months n could not get a proper reply. atlast i got reference of this site n hope for a solution

        Comment

        • Killer42
          Recognized Expert Expert
          • Oct 2006
          • 8429

          #5
          One very important thing to remember, with SendKeys and probably also with Windows API functions. If you send a keyboard event, it will generally go to whatever currently has the focus. So you will generally need to set the focus to the appropriate window before simulating a keypress.

          In other words, generally you don't send a key to anyone in particular. You are simply telling Window "the user pressed this key". So it will handle it however it would normally.

          Comment

          • net2knot
            New Member
            • Feb 2008
            • 11

            #6
            Originally posted by Killer42
            One very important thing to remember, with SendKeys and probably also with Windows API functions. If you send a keyboard event, it will generally go to whatever currently has the focus. So you will generally need to set the focus to the appropriate window before simulating a keypress.

            In other words, generally you don't send a key to anyone in particular. You are simply telling Window "the user pressed this key". So it will handle it however it would normally.
            thanks killer42.
            i tried it using sendinput but either i am missing some code or something wrong.
            i got focus over the dos application but still it doesn't react to the sendinput or the api.
            either i am missing some code...
            i would be thankful if help me out in coding...

            Comment

            • Killer42
              Recognized Expert Expert
              • Oct 2006
              • 8429

              #7
              Originally posted by net2knot
              i tried it using sendinput but either i am missing some code or something wrong. i got focus over the dos application but still it doesn't react to the sendinput or the api. either i am missing some code... i would be thankful if help me out in coding...
              All I know is that I tried many years ago to get some text to or from a DOS applciation and found that they are a completely different story to a regular Windows one. I don't think I was ever successful, but I also didn't try very hard - I was just curious.

              I've just tried a Google search for "vb interact with dos". Here are the first few entries which sounded as though they may be of some use...
              Note, I think the last one is an overview of a commercial product.

              Comment

              • net2knot
                New Member
                • Feb 2008
                • 11

                #8
                Originally posted by Killer42
                All I know is that I tried many years ago to get some text to or from a DOS applciation and found that they are a completely different story to a regular Windows one. I don't think I was ever successful, but I also didn't try very hard - I was just curious.

                I've just tried a Google search for "vb interact with dos". Here are the first few entries which sounded as though they may be of some use...
                Note, I think the last one is an overview of a commercial product.
                thanks killer42.
                but i didn't get the solution of my problem.
                i am in an urgent need of finding the solution of this problem.
                neway i am thankful to u.

                Comment

                Working...