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. Hook ?

Hook ?

Scheduled Pinned Locked Moved C / C++ / MFC
question
16 Posts 4 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.
  • Y york528

    How can I hook the message when file create or delete??

    J Offline
    J Offline
    Jijo Raj
    wrote on last edited by
    #3

    Have a look at ReadDirectoryChangesW(). Regards, Jijo.

    _____________________________________________________ http://weseetips.com[^] Visual C++ tips and tricks. Updated daily.

    Y 1 Reply Last reply
    0
    • J Joe Woodbury

      Do you mean: FindFirstChangeNotification, FindNextChangeNotification, FindCloseChangeNotification?

      Anyone who thinks he has a better idea of what's good for people than people do is a swine. - P.J. O'Rourke

      Y Offline
      Y Offline
      york528
      wrote on last edited by
      #4

      almost like that but it's no real-time,right? I wanna program a dll it's a real time Hook to watch if there is file 'create' or 'delete' if there is...then I'll do...

      J 1 Reply Last reply
      0
      • J Jijo Raj

        Have a look at ReadDirectoryChangesW(). Regards, Jijo.

        _____________________________________________________ http://weseetips.com[^] Visual C++ tips and tricks. Updated daily.

        Y Offline
        Y Offline
        york528
        wrote on last edited by
        #5

        I got a demo about ReadDirectoryChangesW() that's what I want!~~ thank you and thanks all

        1 Reply Last reply
        0
        • Y york528

          almost like that but it's no real-time,right? I wanna program a dll it's a real time Hook to watch if there is file 'create' or 'delete' if there is...then I'll do...

          J Offline
          J Offline
          Joe Woodbury
          wrote on last edited by
          #6

          It's as real time as anything above the driver level. ReadDirectoryChangesW() provides similar functionality, but unless used with overlapped IO, it's a blocking call that can't be easily interrupted.

          Anyone who thinks he has a better idea of what's good for people than people do is a swine. - P.J. O'Rourke

          1 Reply Last reply
          0
          • Y york528

            How can I hook the message when file create or delete??

            H Offline
            H Offline
            Hamid Taebi
            wrote on last edited by
            #7

            And see Spying a file system[^].

            Y 1 Reply Last reply
            0
            • H Hamid Taebi

              And see Spying a file system[^].

              Y Offline
              Y Offline
              york528
              wrote on last edited by
              #8

              this demo is easy but with great helpful thanks

              H 1 Reply Last reply
              0
              • Y york528

                this demo is easy but with great helpful thanks

                H Offline
                H Offline
                Hamid Taebi
                wrote on last edited by
                #9

                I gald it was helpful for you. :-D

                Y 1 Reply Last reply
                0
                • H Hamid Taebi

                  I gald it was helpful for you. :-D

                  Y Offline
                  Y Offline
                  york528
                  wrote on last edited by
                  #10

                  i still have a question i wanna rewrite a Dialog project and try to use those funtions when i use CCriticalSection and i include the some functions and variables can't be seen in a Thread function it shows that error C2065: 'USES_CONVERSION' : undeclared identifier error C2065: 'ReadDirectoryChangesW' : undeclared identifier error C2065: 'm_list' : undeclared identifier error C2227: left of '->InsertItem' must point to class/struct/union error C2227: left of '->GetItemCount' must point to class/struct/union error C2227: left of '->SetItemText' must point to class/struct/union How can i deal with it ?? And why ??

                  H 1 Reply Last reply
                  0
                  • Y york528

                    i still have a question i wanna rewrite a Dialog project and try to use those funtions when i use CCriticalSection and i include the some functions and variables can't be seen in a Thread function it shows that error C2065: 'USES_CONVERSION' : undeclared identifier error C2065: 'ReadDirectoryChangesW' : undeclared identifier error C2065: 'm_list' : undeclared identifier error C2227: left of '->InsertItem' must point to class/struct/union error C2227: left of '->GetItemCount' must point to class/struct/union error C2227: left of '->SetItemText' must point to class/struct/union How can i deal with it ?? And why ??

                    H Offline
                    H Offline
                    Hamid Taebi
                    wrote on last edited by
                    #11

                    Did you include Header files WinBase.h Windows.h ?

                    Y 1 Reply Last reply
                    0
                    • H Hamid Taebi

                      Did you include Header files WinBase.h Windows.h ?

                      Y Offline
                      Y Offline
                      york528
                      wrote on last edited by
                      #12

                      no but i tried include windows.h and winbase.h still have two error error C2065: 'USES_CONVERSION' : undeclared identifier error C2065: 'ReadDirectoryChangesW' : undeclared identifier should i include other head file or something?? thank you

                      H 1 Reply Last reply
                      0
                      • Y york528

                        no but i tried include windows.h and winbase.h still have two error error C2065: 'USES_CONVERSION' : undeclared identifier error C2065: 'ReadDirectoryChangesW' : undeclared identifier should i include other head file or something?? thank you

                        H Offline
                        H Offline
                        Hamid Taebi
                        wrote on last edited by
                        #13

                        I can use of these files without any header file (Im using of Visual Sudio 2008) but what was your application type and whats your IDE?

                        Y 1 Reply Last reply
                        0
                        • H Hamid Taebi

                          I can use of these files without any header file (Im using of Visual Sudio 2008) but what was your application type and whats your IDE?

                          Y Offline
                          Y Offline
                          york528
                          wrote on last edited by
                          #14

                          Dialog-Based project IDE is VC 6.0 if i don't include that part is all right but there is other error error : missing ';' before identifier 'm_Sec' error C2501: 'CCriticalSection' : missing storage-class or type specifiers fatal error C1004: unexpected end of file found so that makes me confused

                          Y 1 Reply Last reply
                          0
                          • Y york528

                            Dialog-Based project IDE is VC 6.0 if i don't include that part is all right but there is other error error : missing ';' before identifier 'm_Sec' error C2501: 'CCriticalSection' : missing storage-class or type specifiers fatal error C1004: unexpected end of file found so that makes me confused

                            Y Offline
                            Y Offline
                            york528
                            wrote on last edited by
                            #15

                            last reply i miss something it's if i don't include afxmt.h

                            H 1 Reply Last reply
                            0
                            • Y york528

                              last reply i miss something it's if i don't include afxmt.h

                              H Offline
                              H Offline
                              Hamid Taebi
                              wrote on last edited by
                              #16

                              search on the header files of VC(ctrl+shift+F) and see is it existing on Winbase.h or windows.h?

                              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