Results 1 to 3 of 3

Thread: Cancel event

  1. #1
    Join Date
    Nov 2002
    Location
    Norway
    Posts
    239

    Question Unanswered: Cancel event

    Hi.
    I have created a code that search my disk for a specific file.
    When the file is found I would like to have the possibility to cancel further search on the disk by pressing a button.
    If I do not press the button the search should continue to search the whole disk.

    Can anyone please help me?

    sincerely Vestigo

  2. #2
    Join Date
    Dec 2002
    Location
    Préverenges, Switzerland
    Posts
    3,740
    how are you searching?
    is the search "loop" intrinsically stoppable?
    probably we need to see your search code.

    i normally use SearchTreeForFile from imagehlp.dll which stops searching after the first hit. i don't know how to stop it manually once started!

    there is also findfirstfile/findnextfile from kernel32.dll. in the loop for findnext you could play with a Cancel button... you maybe need doevents() between the findnextfile loops

    izy
    currently using SS 2008R2

  3. #3
    Join Date
    Nov 2002
    Location
    Norway
    Posts
    239
    "doevents" function

    Thanks


    sincerely Vestigo
    Last edited by vestigo; 09-05-04 at 14:46.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •