Results 1 to 5 of 5

Thread: [RESOLVED] Unable to Create Hook - SendKeys.Send Widnows 7

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jan 2013
    Posts
    177

    Resolved [RESOLVED] Unable to Create Hook - SendKeys.Send Widnows 7

    Hey

    I have a Framework 1.1 Application that needs to be run in Windows 7. The application uses quiet a few SendKeys.Send, which causes the following error to occur

    ************** Exception Text **************
    System.Security.SecurityException: Unable to create Hook.
    at System.Windows.Forms.SendKeys.InstallHook()
    at System.Windows.Forms.SendKeys.Send(String keys, Control control, Boolean wait)
    at System.Windows.Forms.SendKeys.Send(String keys)


    I am trying to find the right method within the application that is triggered by pressing F4 but until then is there a work around this?


    Thanks
    Rio

    Update: I have a keyevent in my main project that when pressed changes the view.

    In another referenced object, someone used the Sendkeys.Send function to trigger the event in the main project.

    How would I work around this, since they are two separate projects.

    Found a Quick Fix but it is not Ideal :P

    If I change the User settings in Windows 7 like so :

    http://imageshack.us/photo/my-images...aptureznrs.jpg



    But I would prefer a better way around this.


    EDIT/UPDATE/NEW QUESTION: Does anyone have experience with using UAC in VS 2003?

    What is the best way to trigger a keyevent located in a reference project?
    Last edited by Crzyrio; Jun 5th, 2013 at 09:42 AM.

  2. #2
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    25,481

    Re: Unable to Create Hook - SendKeys.Send Widnows 7

    UAC in VS 2003???

    UAC didn't exist in 2003 unless i'm mistaken.
    Why VB2003? You're 4 versions behind most members in this forum...

  3. #3
    PowerPoster dunfiddlin's Avatar
    Join Date
    Jun 2012
    Posts
    8,245

    Re: Unable to Create Hook - SendKeys.Send Widnows 7

    Windows 7 initially shipped with Framework 3.5 if I recall correctly and has since progressed to 4. I'm frankly amazed that anything coded for Framework 1.1 works on W7 at all!
    As the 6-dimensional mathematics professor said to the brain surgeon, "It ain't Rocket Science!"

    Reviews: "dunfiddlin likes his DataTables" - jmcilhinney

    Please be aware that whilst I will read private messages (one day!) I am unlikely to reply to anything that does not contain offers of cash, fame or marriage!

  4. #4

    Thread Starter
    Addicted Member
    Join Date
    Jan 2013
    Posts
    177

    Re: Unable to Create Hook - SendKeys.Send Widnows 7

    Quote Originally Posted by .paul. View Post
    UAC in VS 2003???

    UAC didn't exist in 2003 unless i'm mistaken.
    Why VB2003? You're 4 versions behind most members in this forum...
    I know but was wondering if there is a way to put it in? We usually do use 2010 or 2012 for development, but this application was created quiet some time back and is fairly large. We would much rather just fix the one bug then have to upgrade the entire project


    Quote Originally Posted by dunfiddlin View Post
    Windows 7 initially shipped with Framework 3.5 if I recall correctly and has since progressed to 4. I'm frankly amazed that anything coded for Framework 1.1 works on W7 at all!
    The application in question is an inhouse application, so we have installed 1.1 on the computers going to use it :P


    Right now we are thinking of replacing the Sendkeys.send with Callbacks but I havent had much experience with them
    Last edited by Crzyrio; Jun 5th, 2013 at 09:45 AM.

  5. #5
    Registered User
    Join Date
    Oct 2013
    Posts
    2

    Re: Unable to Create Hook - SendKeys.Send Widnows 7

    After installing Framework 1.1 and 1.1 SP1, Find and Install the following packs

    1. NET Framework 1.1 Service Pack 1 CLR Security Update for Windows 7

    2. Microsoft .NET Framework 1.1 Service Pack 1 Update for using SendKeys under Microsoft Windows 7

    the issue "Unable to Create Hook" on windows 7 with Framework 1.1 issue solved

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