|
-
Mar 10th, 2002, 02:55 PM
#1
Thread Starter
Fanatic Member
Send program a message
I can see a program running in the Close Program box, but there is no window for it. How can I get a handle or something to it, and then send it a message?
Alcohol & calculus don't mix.
Never drink & derive.
-
Mar 10th, 2002, 03:56 PM
#2
Code:
HWND h = FindWindow(NULL, "Title Of The Window");
//h = the hwnd of the window
I think.
Laugh, and the world laughs with you. Cry, and you just water down your vodka.
Take credit, not responsibility
-
Mar 10th, 2002, 04:10 PM
#3
Thread Starter
Fanatic Member
I tried that but it didn't work, because there is no window, Basically, it is minimized to the system tray.
Alcohol & calculus don't mix.
Never drink & derive.
-
Mar 10th, 2002, 05:41 PM
#4
Monday Morning Lunatic
GetProcessHandle or something like that?
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Mar 11th, 2002, 10:05 AM
#5
Even something that is minimized to the tray needs a window. The problem is knowing it's class (try Spy++ to find out).
e.g. ICQ always has the dialog window. Problem is, since it's created by the system, the class name is not always the same.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Mar 15th, 2002, 06:47 PM
#6
Thread Starter
Fanatic Member
2 things:
1) If I don't know its class, is there any other way?
2) Say I do get the class name. What do I do then? I don't see any API functions about getting a process handle other than the current one.
Alcohol & calculus don't mix.
Never drink & derive.
-
Mar 17th, 2002, 07:39 AM
#7
OpenProcess can give you a process handle by id, but I don't know how to get the id.
Function names work only for WinNT, Win9x uses other methods.
EnumProcesses will give you the IDs of all processes that are currently running. Use OpenProcess to get a handle from the ID. Then use EnumProcessModules to get all module handles of a process. Get the file name of the module with GetModuleFileNameEx and search for the .exe file.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
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
|
Click Here to Expand Forum to Full Width
|