Close Window based on title
Results 1 to 7 of 7

Thread: Close Window based on title

  1. #1
    Flash M0nkey
    Join Date
    Sep 2001
    Posts
    3,447

    Close Window based on title

    As many of you know I'm a web developer not an application developer but one of my pet projects has given forth the need for a small application that can run in the background and close windows depending upon the window title.

    For example we could have a string "xxxx" the program would check every 5/10mins for any windows containg the target string if it found one it would close it automatically.

    If anyone could see their way to coing such an application I would be very gratefull.

    Minimum use of resources is prefered -thanks

    this will be part of a website/application I am developing and full credit etc will go to person who codes the app

    ta

  2. #2
    Banned
    Join Date
    Sep 2005
    Posts
    3
    FindWindowA is part of the User32 library.

    push NULL
    push className
    call FindWindow

    push eax
    pop winhandle
    cmp al, FALSE
    jnz
    push error_message
    call MessageBox

    The FindWindow function retrieves the handle to the top-level window whose class name and window name match the specified strings. This function does not search child windows.

  3. #3
    Super Moderator
    Know-it-All Master Beaver

    Join Date
    Jan 2003
    Posts
    3,914
    Hey Hey,

    You're going for minimal resources, how about using built in XP commands (or is this something other than XP)... taskkill can close a window based on window title..

    Example:

    taskkill /FI "WINDOWTITLE eq Untitled - Notepad"

    You could put this in the system scheduler and allow it to run.... I'm not sure if this will accomplish what you want.. but it seems like it should... If you just want the program to run at certain times.. I could prolly write you a small timer that would call taskkill every X minutes.

    Peace,
    HT
    IT Blog: .:Computer Defense:.
    PnCHd (Pronounced Pinched): Acronym - Point 'n Click Hacked. As in: "That website was pinched" or "The skiddie pinched my computer because I forgot to patch".

  4. #4
    Flash M0nkey
    Join Date
    Sep 2001
    Posts
    3,447
    HT sounds like exactly what I want - however can you use wildcards (as only a portion of the title will be the same each time) in your method?

  5. #5
    Super Moderator
    Know-it-All Master Beaver

    Join Date
    Jan 2003
    Posts
    3,914
    Originally posted here by valhallen
    HT sounds like exactly what I want - however can you use wildcards (as only a portion of the title will be the same each time) in your method?
    Hey Hey,

    You can use Wild Cards as long as the first character of the search string is an actual letter. Not sure if it'll still be of use to you.

    Peace,
    HT
    IT Blog: .:Computer Defense:.
    PnCHd (Pronounced Pinched): Acronym - Point 'n Click Hacked. As in: "That website was pinched" or "The skiddie pinched my computer because I forgot to patch".

  6. #6
    Flash M0nkey
    Join Date
    Sep 2001
    Posts
    3,447
    ok full situation is i need to be able to close chat windows (http://www.reach-out.org.uk/skype) that contain the string '(offline)' which appears in format :

    username (offline) Skype Chat

    think you can help?

  7. #7
    Senior Member
    Join Date
    Sep 2004
    Posts
    117
    hehehe

    this post reminds me of a worm released that would search for titles in webpages if they contain xxx words or sex or such stuff would close the site or display Quoran words.
    (i think u guys know what i am talking about :P )

    so i was wondering, umm was it you loool

Posting Permissions

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

 Security News

     Patches

       Security Trends

         How-To

           Buying Guides