-
September 5th, 2005, 12:27 AM
#1
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
-
September 5th, 2005, 01:34 AM
#2
Banned
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.
-
September 5th, 2005, 05:43 AM
#3
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
-
September 5th, 2005, 09:40 AM
#4
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?
-
September 5th, 2005, 03:24 PM
#5
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
-
September 5th, 2005, 09:44 PM
#6
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?
-
September 14th, 2005, 05:16 PM
#7
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
-
Forum Rules
|
|