Results 1 to 5 of 5

Thread: Parksie Would Know Right?

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Aug 2000
    Location
    Columbus Ohio
    Posts
    217
    I have a few questions that are driving me INSANE. Here I go:
    1. For the FindFirstFile and FindNextFile apis, the api requires WIN32_FIND_DATA in the function arguement. How do I send that in C++?
    2. Is there a way to use the DeleteFile api to delete all files of a certain type in a directory? I tried:
      Code:
      if(DeleteFile("C:/windows/desktop/testfolder/*.txt"))
         cout<<"Delete Successful";
      else
         cout<<"Complete Failure";
      Unfortunately that seems to only work if I give it a specific file, if I use *.something it doesn't seem to work, even though documentation I've seen says it should
    3. Alright I am working on a key logger of sorts(just me screwing around) and I encountered a large problem. I need to be able to have code act like a vb timer. Hence it needs to keep repeating without returning a value. I tried recursion but that doesn't seem to work.
    4. Is there a way to have a dynamic string like the apstring header(widely distributed) using normal char definitions?
    Chris

    [email protected]
    Windows XP RC2 B2526
    Visual Studio.Net Beta 2
    C++, VB, VB.Net, ASP, PHP

  2. #2
    Frenzied Member Vlatko's Avatar
    Join Date
    Aug 2000
    Location
    Skopje, Macedonia
    Posts
    1,409
    Code:
    1.
    WIN32_FIND_DATA data;
    FindFirstFile("c:\\myfile",&data);
    
    3.Set a timer
    SetTimer(hWnd,15,1,NULL);
    'Handle your code in the WM_TIMER message
    
    if(uMsg == WM_TIMER)
    {
    'code
    }
    I am become death, the destroyer of worlds.
    mail:[email protected]

    • Visual Basic 6.0 & .NET
    • Visual C++ 6.0 & .NET
    • ASP
    • LISP
    • PROLOG
    • C
    • Pascal

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Aug 2000
    Location
    Columbus Ohio
    Posts
    217

    Thanks, Any idea with #2 and #4??

    Thanks Vlatko. But with the timer would I do this:
    Code:
    void main()
    {
    int x;
    SetTimer(GetWindowDC(0),15,1,NULL);
    if(uMsg == WM_TIMER)
    {
       x++
       cout<<x;
    }
    So Would that just keep incrementing x and print out its value? Also when I try it, it says I need to declare uMsg. Could you give small example that works? Sorry, just completely new to creating my timer, vb spoiled me
    Btw is your name from a game?
    Chris

    [email protected]
    Windows XP RC2 B2526
    Visual Studio.Net Beta 2
    C++, VB, VB.Net, ASP, PHP

  4. #4
    Frenzied Member Vlatko's Avatar
    Join Date
    Aug 2000
    Location
    Skopje, Macedonia
    Posts
    1,409
    I gave you
    Code:
    if(uMsg == WM_TIMER)
    {
    
    }
    presuming that you have set a WindowProc for handling messages and you are making a Win32 App and not a DOS app.
    I am become death, the destroyer of worlds.
    mail:[email protected]

    • Visual Basic 6.0 & .NET
    • Visual C++ 6.0 & .NET
    • ASP
    • LISP
    • PROLOG
    • C
    • Pascal

  5. #5
    Guest
    Originally posted by Chris_SE
    [*]Is there a way to have a dynamic string like the apstring header(widely distributed) using normal char definitions?[/list]
    what do you mean by this?


    there is a header file I downloaded from lawrence ville press that allows you to make strings really easy..

    you can download that and more here:

    http://lvp.com/data/cpluspc/

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