|
Joined: Sep 2003
Posts: 10
Pikka bird
|
OP
Pikka bird
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 Bye !
|
|
|
|
Joined: Jan 2003
Posts: 3,012
Hoopy frood
|
Hoopy frood
Joined: Jan 2003
Posts: 3,012 |
Think COM
Its your only chance >:D
-KingTomato
|
|
|
|
Joined: Sep 2003
Posts: 10
Pikka bird
|
OP
Pikka bird
Joined: Sep 2003
Posts: 10 |
ok And have you the COM Component for IRC in C# ? A tutorial, document, help file ? Plz urgent Bye and thanks !
|
|
|
|
Joined: Jan 2003
Posts: 3,012
Hoopy frood
|
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
|
|
|
|
Joined: Dec 2002
Posts: 2,809
Hoopy frood
|
Hoopy frood
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.
|
|
|
|
Joined: Jan 2003
Posts: 3,012
Hoopy frood
|
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
|
|
|
|
Joined: Dec 2002
Posts: 2,809
Hoopy frood
|
Hoopy frood
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
Fjord artisan
|
Fjord artisan
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
Hoopy frood
|
Hoopy frood
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
Ameglian cow
|
Ameglian cow
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
Hoopy frood
|
Hoopy frood
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"
|
|
|
|
|