mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Jan 2003
Posts: 2
J
Jezebel Offline OP
Bowl of petunias
OP Offline
Bowl of petunias
J
Joined: Jan 2003
Posts: 2
Hi, i was wondering if there's an .dll file that can return the active program running (Or the .exe file which is running).

So, for instance, if I'm busy working with notepad (mIRC running on background) and something in mirc is triggered, that the dll returns 'Notepad' or 'Notepad.exe'

If it doesn't exist, can anyone with much spare time create one? I'd really appriciate (I would do it myself, except i don't know n e thing bout such things).

Joined: Dec 2002
Posts: 66
Babel fish
Offline
Babel fish
Joined: Dec 2002
Posts: 66
I'm sure it's very possible .. but I've lost my MSDN help files and I'm too lazy to search msdn online.

I'm also pretty sure Necroman (or someone else if he doesn't before hand) will post a reply to how to make it. ;-)


- Linux System Administrator, Darktides Communications, LLC.
Joined: Dec 2002
Posts: 89
N
Babel fish
Offline
Babel fish
N
Joined: Dec 2002
Posts: 89
You can call the GetForegroundWindow() function, which will return the handle to the window the user is working with. You can get certain information from its title using GetWindowText().

Next thing, you can call GetWindowLong() specifying GWL_HINSTANCE to obtain the handle to the application that created the window. GetModuleFileName() obtains the name of the executable.


Sincerely,
Necroman, #mIRC @ Undernet
Joined: Jan 2003
Posts: 2
J
Jezebel Offline OP
Bowl of petunias
OP Offline
Bowl of petunias
J
Joined: Jan 2003
Posts: 2
Yea, thnx, but mIRC doesn't know those commands, i still need a .dll file with does options wink

Joined: Dec 2002
Posts: 66
Babel fish
Offline
Babel fish
Joined: Dec 2002
Posts: 66
For such a task that's highly unlikely to be needed by multiple people I doubt you'll find one. Your best bet is to learn C/C++/Delphi and make your own DLL to do it.


- Linux System Administrator, Darktides Communications, LLC.
Joined: Jan 2003
Posts: 4
H
Self-satisified door
Offline
Self-satisified door
H
Joined: Jan 2003
Posts: 4
If you could give some more informations on the DLL you want (if there is some specific command, names, retrun text, style , function, stuff like that) I could do it for you, it don't seem to be an hard thing...



Joined: Jan 2003
Posts: 1,063
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Jan 2003
Posts: 1,063
uhmmm if I am correct about what you are trying to do:

mIRC has an identifyer to check if it's the active application... so you don't need a dll

search the /help for it!


If it ain't broken, don't fix it!
Joined: Dec 2002
Posts: 89
N
Babel fish
Offline
Babel fish
N
Joined: Dec 2002
Posts: 89
No, you're not correct.


Sincerely,
Necroman, #mIRC @ Undernet
Joined: Jan 2003
Posts: 1,063
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Jan 2003
Posts: 1,063
?

on 1:APPACTIVE:echo mIRC active status: $appactive

The above event triggers whenever mIRC's active status has changed. The $appactive identifier returns $true if mIRC is active, or $false if it isn't.


?


If it ain't broken, don't fix it!
Joined: Dec 2002
Posts: 1,922
O
Hoopy frood
Offline
Hoopy frood
O
Joined: Dec 2002
Posts: 1,922
That's true, although the person who wrote this post wanted to know the name of the active application, which can't be retrieved using a mIRC command.


Link Copied to Clipboard