Link to home
Start Free TrialLog in
Avatar of Everseeker
Everseeker

asked on

Thate must be a tool to do this, like the Firefox DOM manager...

I have a program... It's an exe.
It sometimes pops up a little OK dialog box that I need to close.
Unfortunatly for me, this program runs from the server when all users are logged out (as it is supposed to) Since no one is logged into the console, no one can hit said button...
A-Ha!... I will write a program that will watch the system. When the event that triggers the button happens, I will run the subroutine or function connected to the button... life will be great

Only 1 small problem.
I need to know the subroutine/function's name & the # of paramaters passed in/out

The Firefox DOM Manager is a wounderful tool. It does exactly what I need.... for HTML/Xul applications.
Is there anything that I can use that does the same for windows programs?

PS:
shareware is OK
Free is better
$$,$$$.$$ is NO good....
Avatar of Headspace
Headspace

try filemon or regmon from sysinternals to find out what's being accessed when the popup occurs:  http://www.sysinternals.com/ProcessesAndThreadsUtilities.html
Avatar of Everseeker

ASKER

That's not going to tell me the name of the subroutine/function, nor will it give me a paramater list...
You can list all open windows, identify your window by class and title and send a click message to the OK button.
I forgot to write that AFAIK there's no such a tool for windows.
...right, slado2, and my thought was to find the calling process and alter its functionality, perhaps in the registry, an .ini, etc., to eliminate the message entirely.
Headspace, you can't easily modify windows program behaviour. As I wrote earlier you only chance is to monitor all open windows, find the apropriate one and send click message. I should have such a piece of code in Delphi but I must find it. Will post it here then.
@slado2:  you can if there are registry entries (or other means) for it that allow for options to be set/changed.  Since Everseeker didn't define the .exe, I thought I'd make sure that we weren't looking for a harder way to do the job than need be : ).  Obviously, if it's an .exe that's self-enclosed, he'll have to grab the window handle and go from there, as you've stated.

"...You can list all open windows, identify your window by class and title and send a click message to the OK button..."

ummm... How?
I guess I am really looking for a program that extracts Type Library information from COM objects
Here's the Delphi code. It enumerates windows and searches for a window with caption ButtonCaption. Then it sends click message to the button.

function EnumChildProc(Wnd: hWnd; SL: TStrings): BOOL; stdcall;
var
  szFull: array[0..MAX_PATH] of Char;
begin
  Result := Wnd <> 0;
  if Result then
  begin
    GetWindowText(Wnd, szFull, SizeOf(szFull));
    if (Pos(SL[0], StrPas(szFull)) > 0) and (SL.IndexOfObject(TObject(Wnd)) < 0)
    then SL.AddObject(StrPas(szFull), TObject(Wnd));
//    EnumChildWindows(Wnd, @EnumChildProc, Longint(SL));
  end;
end;

function ClickButton(ParentWindow: Hwnd; const ButtonCaption: string): Boolean;
var
  SL: TStringList;
  H: hWnd;
begin
  SL := TStringList.Create;
  try
    SL.AddObject(ButtonCaption, nil);
    EnumChildWindows(ParentWindow, @EnumChildProc, Longint(SL));
    H := 0;
    if SL.Count = 2 then
    begin
      H := hWnd(SL.Objects[1]);
    end;
  finally
    SL.Free;
  end;
  Result := H <> 0;
  if Result then PostMessage(H, BM_CLICK, 0, 0);
end;
OK, This is not getting me any closer to the solution. I'll return later with the name/use of the program (Altaris app) We can go from there...
OK, the program is the Altiris Agent, Version 6.0.1508
the screen in question is titled "Software Updates"  and the button is "Start System Update"

When updates are available, the button becomes active... it needs to be clicked.
I want to do that at o-dark-thirty in the morning, on all systems.... without logging into the consoles

...why don't you run it in silent mode?
Heh, tried that... it asks anyway.
I found a program that does pretty much exactly what I need... TLBExplorer.exe
This program makes use of the TypeLib Information object library (implemented in TlbInf32.dll)
ASKER CERTIFIED SOLUTION
Avatar of Computer101
Computer101
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial