Help with Spam Bot Blocker

This is a discussion on Help with Spam Bot Blocker within the Windows Programming forums, part of the Platform Specific Boards category; Well I was itnerested in making a program that will automatically block people in AIM (Aol Instant Messenger) Chat rooms, ...

  1. #1
    Registered User
    Join Date
    Jun 2003
    Posts
    3

    Question Help with Spam Bot Blocker

    Well I was itnerested in making a program that will automatically block people in AIM (Aol Instant Messenger) Chat rooms, because it's been totally swamped with porn spam. I'd like to add in a black list feature as well, but I don't really know where to start, I know the basiscs of C++ fairly well, but don't know how to interact with the windows environment. Can anyone help?

  2. #2
    mustang benny bennyandthejets's Avatar
    Join Date
    Jul 2002
    Posts
    1,401
    If you mean deleting entries from the lists of windows of other processes, or something similar, I wouldn't get your hopes up. Regular updates would be made to lists of users and such, so your program would have to compete. But if you do want to try it, a few starter functions would be the following:

    EnumWindows(), EnumWindowsProc()

    Check each window for the right caption, then you've got the right window. Next, use Spy++ to get details on the control you want to modify. Incorporate that as code into your program, and simply send a LVM_DELETEITEM message, or similar. Hope this helps.
    benforbes@optusnet.com.au
    Microsoft Visual Studio .NET 2003 Enterprise Architect
    Windows XP Pro

    Code Tags
    Programming FAQ
    Tutorials

  3. #3
    Registered User
    Join Date
    Jun 2003
    Posts
    3
    Well in the chat room you have the option of hightlighting someone's screen name and either pressing the block button, or hitting the key sequence alt+G. I would just need the program to look for certain names, highlight that name, and block them, not remove anything. Also I might put in some feature to check to see if they repeat the same messages over and over again, and then blocking them on that basis...

  4. #4
    mustang benny bennyandthejets's Avatar
    Join Date
    Jul 2002
    Posts
    1,401
    Ok, then what I suggested is probably the way to go. You will need to use EnumWindows() to find the right window, then EnumChildWindows() to find the right list control. Once you have the HWND handle for the list control, it's cool runnings.

    The message LB_GETTEXT will allow you to check the text of each item. Design your own parsing system to check for things you dont want, such as occurences of "sex" or whatever it is you want to eliminate. Then highlight, one by one, each item you want, and send the key sequence to the window.

    Alternatively, you can also find the handle for the "Block" button, and send a WM_LBUTTONDOWN then WM_LBUTTONUP message to it. But this is all theoretical, I've never really tried.

    The principles are all there. Enumerating windows, obtaining handles, sending messages, etc, is what you need to do.
    benforbes@optusnet.com.au
    Microsoft Visual Studio .NET 2003 Enterprise Architect
    Windows XP Pro

    Code Tags
    Programming FAQ
    Tutorials

  5. #5
    Registered User
    Join Date
    Jun 2003
    Posts
    3
    Ok, thanks I'll try that out, and if I get it working I'll upload to my site or something for people to try...

  6. #6
    mustang benny bennyandthejets's Avatar
    Join Date
    Jul 2002
    Posts
    1,401
    Ummm... sorry to break this to you, but I just remembered something very important about what you're trying to do; it's damned difficult. Windows doesn't let you manipulate in any way, or even access for reading, any other processes. What you'll have to do is create a library file (.dll) that is loaded into every process. Then your code is inside the process, and you can do what you want. It's very hard however. For more info, search my previous posts. I started a thread very much like this one last year, and you should find the answer there. I never finished up on that problem, because I got stuck into figuring out libraries, which are difficult too. Good luck!
    benforbes@optusnet.com.au
    Microsoft Visual Studio .NET 2003 Enterprise Architect
    Windows XP Pro

    Code Tags
    Programming FAQ
    Tutorials

  7. #7
    mustang benny bennyandthejets's Avatar
    Join Date
    Jul 2002
    Posts
    1,401
    I searched for that post and here it is: my post

    Codulation's tip about DebugActiveProcess() may work; I've yet to try it. I'll give it a shot and post my results, but he did say that it might not always work.
    benforbes@optusnet.com.au
    Microsoft Visual Studio .NET 2003 Enterprise Architect
    Windows XP Pro

    Code Tags
    Programming FAQ
    Tutorials

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Spam Filters. ISP based email is dying.
    By Mario F. in forum A Brief History of Cprogramming.com
    Replies: 14
    Last Post: 03-05-2008, 11:05 AM
  2. Anybody Familiar with A.L.I.C.E. bot?
    By blackwyvern in forum C++ Programming
    Replies: 6
    Last Post: 01-23-2002, 09:53 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21