mIRC Home    About    Download    Register    News    Help

Print Thread
#51980 30/09/03 03:58 PM
Joined: Sep 2003
Posts: 10
L
Lazhar Offline OP
Pikka bird
OP Offline
Pikka bird
L
Joined: Sep 2003
Posts: 10
Hi all !

I'm looking for an API, DLL to use SendMessage or equivalent with C# language (VS.NET 2003 and Framework .NET) !
Or a function, class to use to do it !

Someone has it in his bag ?
Thanks a lot smile

Bye !

#51981 30/09/03 04:21 PM
Joined: Jan 2003
Posts: 3,012
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2003
Posts: 3,012
Think COM

Its your only chance >:D


-KingTomato
#51982 01/10/03 01:29 PM
Joined: Sep 2003
Posts: 10
L
Lazhar Offline OP
Pikka bird
OP Offline
Pikka bird
L
Joined: Sep 2003
Posts: 10
ok smirk
And have you the COM Component for IRC in C# ?
A tutorial, document, help file ? laugh

Plz urgent wink

Bye and thanks !

#51983 01/10/03 03:07 PM
Joined: Jan 2003
Posts: 3,012
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2003
Posts: 3,012
I dont happen to know offhand, But i'll look into it. My suggestion would be to look on www.codeproject.com for a tutorial. They usually have some neat ones. I will look also, and If i find anything, i'll make a project for you that demonstrates it >:D


-KingTomato
#51984 01/10/03 06:23 PM
Joined: Dec 2002
Posts: 2,809
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 2,809
You can use SendMessage in C#, just not directly. You have to explicitely import it from user32.dll:

[DllImport("user32.dll",EntryPoint="SendMessage")]
public static extern int SendMessage(int hWnd, uint Msg, int wParam, int lParam);

Something like that should work. Then you can just use SendMessage like any other function.

#51985 01/10/03 11:39 PM
Joined: Jan 2003
Posts: 3,012
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2003
Posts: 3,012
Actually more like:
[DllImport("User32.dll")] public static extern int SendMessage( int hwnd, int uMsg, int wParam, [MarshalAs(System.Runtime.InteropServices.UnmanagedType.LPStr)] string lParam);


-KingTomato
#51986 01/10/03 11:44 PM
Joined: Dec 2002
Posts: 2,809
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 2,809
lParam is NOT a string, and, uMsg must be unsigned. So I'm not seeing what is wrong with what I included. And, The EntryPoint= while unnecnguary, it doesn't hurt anything to have.

Joined: Feb 2005
Posts: 342
R
Fjord artisan
Offline
Fjord artisan
R
Joined: Feb 2005
Posts: 342
I hate to bump a really old topic, but I've been toying around, and I'm not sure how you turn a "command string" into an unsinged int. By that statement you might be able to tell I'm just clueless about this, as I've never messed with windows API or anything of the sort.

Basically, I'm just toying around trying to figure out how to send a command to mIRC with minimal code so I can see how things work. :\

Joined: Oct 2003
Posts: 3,918
A
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
His statement was that the function prototype was wrong. wParam is *not* a string. It's a number. See the MSDN docs on SendMessage


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"
Joined: Jan 2007
Posts: 34
C
Ameglian cow
Offline
Ameglian cow
C
Joined: Jan 2007
Posts: 34
Lazhar,i'm not sure what do you want to do,but there is a good irc library for C#.Look HERE.

Joined: Oct 2003
Posts: 3,918
A
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
He probably wants to integrate a dll with mIRC. Given that smartIrc4net looks like a full fledged IRC library, that would be complete overkill (and completely useless at that) to plug into mIRC, a full fledged IRC client.


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"

Link Copied to Clipboard