Project

General

Profile

SendMessage() Support

Added by Hans Müller 9 months ago

Hey is there anyway to use the SendMessage function from mIRC? https://www.mirc.com/help/html/index.html?sendmessage.html

I tried a lot of code (with the help of ChatGPT and the sigmirc.exe source code) but it isn't working at all.

Is there some documentation on what parameter must be included? Or is it working at all with AdiIRC?

Thank you!
Hans


Replies (29)

RE: SendMessage() Support - Added by Hans Müller 9 months ago

Best approach.

https://pastebin.com/8zMAdyuh

Now program is just searching for the string
"WindowsForms10.Window.8.app.0.282af8c" in
class.

Now it should work on all windows versions :)
Tested on Win 7 and Win 10.

RE: SendMessage() Support - Added by Per Amundsen 9 months ago

I think .NET makes a random name per window for any .NET app.

Here is how I do window enumeration:

foreach (Process p in Process.GetProcesses())
{
    try
    {
            if (p.MainModule.FileName.Contains("AdiIRC"))
                {
                    IntPtr hwnd = p.MainWindowHandle;
        }
    }
        catch (Exception)
        {
        }
}

RE: SendMessage() Support - Added by Hans Müller 9 months ago

Interesting idea! Sadly it can't detect the processes which are minimized in the taskbar on the right side aka hidden windows.

I mean not the mimized state you normally have, i mean that one in the right side of the taskbar which you must double click to activate.

Seems like the code above can't do that.

But good idea! Maybe i find an alternate solution.

RE: SendMessage() Support - Added by Per Amundsen 8 months ago

I was not aware of this, this might be the solution https://levelup.gitconnected.com/mainwindowhandle-is-a-lie-6e82e0e0fc8d?gi=f02ed7b39f8b.

Using the EnumWindows API.

(26-29/29)