|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
SendKeys command fails on VistaHi everyone.
I have a compiled VB6 app that seems to work ok when installed on Windows Vista except for one thing. Whenever I use the SENDKEYS command to send a key stroke an error occurs along the lines of "No Permission" to do that. I am stumped as to why a harmless thing like the SENDKEYS command should cause a problem to Vista. Any ideas anyone. "Hansin" <han***@btinternet.com>'s wild thoughts were released on Tue, 27 Feb 2007 23:19:02 -0000 bearing thefollowing fruit: >Hi everyone. It's not harmless though.> >I have a compiled VB6 app that seems to work ok when installed on Windows >Vista except for one thing. > >Whenever I use the SENDKEYS command to send a key stroke an error occurs >along the lines of "No Permission" to do that. > >I am stumped as to why a harmless thing like the SENDKEYS command should >cause a problem to Vista. >Any ideas anyone. Sendkeys allows you to send keystrokes to any window - anobvious security risk. I found I could replace all our applications SendKeys calls with something else anyway. "Jan Hyde" <StellaDrin***@REMOVE.ME.uboot.com> wrote in message Is the fact that you're not telling the OP how you did it a security feature news:h1iau2ltg2prgm56sucko5gttr7ru3lfbu@4ax.com... > Sendkeys allows you to send keystrokes to any window > - an obvious security risk. I found I could replace all our > applications SendKeys calls with something else anyway. as well? Mike "Mike Williams" <M***@WhiskyAndCoke.com>'s wild thoughts were released on Wed, 28 Feb 2007 12:24:15 -0000 bearing thefollowing fruit: >"Jan Hyde" <StellaDrin***@REMOVE.ME.uboot.com> wrote in message No, which solution I used depends on what SendKeys is being>news:h1iau2ltg2prgm56sucko5gttr7ru3lfbu@4ax.com... > >> Sendkeys allows you to send keystrokes to any window >> - an obvious security risk. I found I could replace all our >> applications SendKeys calls with something else anyway. > >Is the fact that you're not telling the OP how you did it a security feature >as well? used for. I found a lot of the uses of SendKeys were in old code and could easily be replaced with normal VB code, others were a bit more tricky. The OP would have to post again with any situations (s)he needs help with. "Hansin" <han***@btinternet.com> wrote in message It is not harmless. In fact it can be very harmful! And, for that reason, it news:jsKdnVW6z56oIXnYRVnytgA@bt.com... > Hi everyone. > > I have a compiled VB6 app that seems to work ok when installed > on Windows Vista except for one thing. Whenever I use the > SENDKEYS command to send a key stroke an error occurs along the lines of > "No Permission" to do that. I am stumped as > to why a harmless thing like the SENDKEYS command . . . is probably falling foul of the new Vista security features. You might have better luck using the Keybd_Event API instead, unless that is bolted down too (I haven't got time at the moment to swap to my Vista setup to check). It's worth looking at though. Mike "Mike Williams" <M***@WhiskyAndCoke.com>'s wild thoughts were released on Wed, 28 Feb 2007 12:22:54 -0000 bearing thefollowing fruit: Show quoteHide quote >"Hansin" <han***@btinternet.com> wrote in message The PostMessage API can be used under vista. Perhaps the>news:jsKdnVW6z56oIXnYRVnytgA@bt.com... >> Hi everyone. >> >> I have a compiled VB6 app that seems to work ok when installed >> on Windows Vista except for one thing. Whenever I use the >> SENDKEYS command to send a key stroke an error occurs along the lines of >> "No Permission" to do that. I am stumped as >> to why a harmless thing like the SENDKEYS command . . . > >It is not harmless. In fact it can be very harmful! And, for that reason, it >is probably falling foul of the new Vista security features. You might have >better luck using the Keybd_Event API instead, unless that is bolted down >too (I haven't got time at the moment to swap to my Vista setup to check). >It's worth looking at though. > >Mike > fact you have to specify the hwnd of the windows makes a difference <shrug> On Wed, 28 Feb 2007 12:47:17 +0000, Jan Hyde
<StellaDrin***@REMOVE.ME.uboot.com> wrote: <snip> >The PostMessage API can be used under vista. Perhaps the Surely, with SendKeys it goes to GetForegroundWindow>fact you have to specify the hwnd of the windows makes a >difference <shrug> I must confess that I consider SendKeys a bit .. well naff "Mike Williams" <M***@WhiskyAndCoke.com> wrote in message Apparently...news:eIBaoMzWHHA.3980@TK2MSFTNGP02.phx.gbl... > You might have better luck using the Keybd_Event API instead, http://m8software.com/developer/keysend/sendkey.htm Rick "Hansin" <han***@btinternet.com> wrote in message Further to my previous response about the security features of Vista, I've news:jsKdnVW6z56oIXnYRVnytgA@bt.com... > Whenever I use the SENDKEYS command [in Vista] to > send a key stroke an error occurs long the lines of "No > Permission" to do that. just fired up Vista (Vista Ultimate full version, not a beta) and from a few tests with a small VB test program the SendKeys function seems to work fine. I've tried it on the main Admin account and on a standard User account and on the Guest account, and it works fine on all of them (and so does the KeyBd_Event API). I haven't used Vista for more than a few hours on and off, so I've had no time to delve into its various security features, but I wonder why SendKeys is working fine on my own vanilla Vista Ultimate setup, under all three different kinds of account? Mike "Mike Williams" <m***@whiskyandCoke.com>'s wild thoughts were released on Wed, 28 Feb 2007 13:29:45 -0000 bearing thefollowing fruit: Show quoteHide quote >"Hansin" <han***@btinternet.com> wrote in message try >news:jsKdnVW6z56oIXnYRVnytgA@bt.com... > >> Whenever I use the SENDKEYS command [in Vista] to >> send a key stroke an error occurs long the lines of "No >> Permission" to do that. > >Further to my previous response about the security features of Vista, I've >just fired up Vista (Vista Ultimate full version, not a beta) and from a few >tests with a small VB test program the SendKeys function seems to work fine. >I've tried it on the main Admin account and on a standard User account and >on the Guest account, and it works fine on all of them (and so does the >KeyBd_Event API). I haven't used Vista for more than a few hours on and off, >so I've had no time to delve into its various security features, but I >wonder why SendKeys is working fine on my own vanilla Vista Ultimate setup, >under all three different kinds of account? Call SendKeys("{TAB}") with UAC on You should get a 'permission denied' error. On Tue, 27 Feb 2007 23:19:02 -0000, "Hansin" <han***@btinternet.com> wrote: ¤ Hi everyone.¤ ¤ I have a compiled VB6 app that seems to work ok when installed on Windows ¤ Vista except for one thing. ¤ ¤ Whenever I use the SENDKEYS command to send a key stroke an error occurs ¤ along the lines of "No Permission" to do that. ¤ ¤ I am stumped as to why a harmless thing like the SENDKEYS command should ¤ cause a problem to Vista. ¤ ¤ Any ideas anyone. My understanding is that SendKeys should function properly under VB 6.0 but not 5.0. As an alternative you should be able to use the SendInput and CopyMemory API function calls: http://allapi.mentalis.org/apilist/SendInput.shtml Paul ~~~~ Microsoft MVP (Visual Basic) Paul Clement <UseAdddressAtEndofMess***@swspectrum.com> wrote:
> ¤ I am stumped as to why a harmless thing like the SENDKEYS command should How'd you come to that understanding? Any basis for it, that you'd care to share?> ¤ cause a problem to Vista. > ¤ > ¤ Any ideas anyone. > > My understanding is that SendKeys should function properly under VB 6.0 but not > 5.0. On Wed, 28 Feb 2007 09:57:59 -0800, "Karl E. Peterson" <k***@mvps.org> wrote: ¤ Paul Clement <UseAdddressAtEndofMess***@swspectrum.com> wrote:¤ > ¤ I am stumped as to why a harmless thing like the SENDKEYS command should ¤ > ¤ cause a problem to Vista. ¤ > ¤ ¤ > ¤ Any ideas anyone. ¤ > ¤ > My understanding is that SendKeys should function properly under VB 6.0 but not ¤ > 5.0. ¤ ¤ How'd you come to that understanding? Any basis for it, that you'd care to share? Someone else had described that experience. I can't confirm it since I do not have Visual Basic 5.0 installed. Paul ~~~~ Microsoft MVP (Visual Basic) Paul Clement <UseAdddressAtEndofMess***@swspectrum.com> wrote:
Show quoteHide quote > On Wed, 28 Feb 2007 09:57:59 -0800, "Karl E. Peterson" <k***@mvps.org> wrote: I was just curious. I wonder if it's because of something as silly as the runtime > > ¤ Paul Clement <UseAdddressAtEndofMess***@swspectrum.com> wrote: > ¤ > ¤ I am stumped as to why a harmless thing like the SENDKEYS command should > ¤ > ¤ cause a problem to Vista. > ¤ > ¤ > ¤ > ¤ Any ideas anyone. > ¤ > > ¤ > My understanding is that SendKeys should function properly under VB 6.0 but > not > ¤ > 5.0. > ¤ > ¤ How'd you come to that understanding? Any basis for it, that you'd care to > share? > > Someone else had described that experience. I can't confirm it since I do not > have Visual Basic 5.0 installed. not shipping with Vista? I only built a Vista VM the other day, and haven't played much myself. (I frankly can't get past the laughter, to actually take that POS seriously.)
Error in reading large csv file
Sending email Should I or shouldn't I include excel.exe in my app distribution package? Run-time Error 430, WITH non-broken binary compatibility? cropping rectangle pulling varchar TaskBar won't show when hidden. My DataReport Problem Beginner: List of Color Values Open Excel when user press OK button |
|||||||||||||||||||||||