Click here to Skip to main content
11,804,008 members (76,492 online)
Rate this: bad
Please Sign up or sign in to vote.
How do i display a custom message on all the pc`s connected via lan to a single network.
Posted 31-May-12 0:53am
Björn Ranft at 31-May-12 7:14am
You mean something like net send "message" in 2000,xp or msg.exe in windows 7?
gaurish thakkar at 31-May-12 9:36am
yup win xp

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Hi, first of all this feature can be reachable in .NET with help of P\Invoke and WinApi.
General worfkflow process can be divided on the 2 stages:
1) Retrieving all pc's connected via lan to a single network.
2) Sending to each pc appropriate message.

First part of workflow can be feasible by using WinApi methods from native Netapi32.dll by calling such methods as:
And structure from this library called _SERVER_INFO_100

Second stage will consists from following steps(calling methods from wtsapi32.dll):
1) Get the handle of remote server by calling
2) Get the handle of active console session id by calling
3) Send message to appropriate server and console session with help of

Thats all.
Good luck.
Sandeep Mewara at 31-May-12 12:08pm
gaurish thakkar at 1-Jun-12 0:43am
WTSSendMessage can you please give me example ...of these functions in c#
gaurish thakkar at 1-Jun-12 2:06am
i tried calling the WTSSendMessage functon but the message gets displayed on my pc....i was actually tryg to display it on one single pc so i used the WTSOpenServer function but the handle returned is 0 but if i pass the name of my pc to this function i get a valid handle .
gaurish thakkar at 1-Jun-12 2:07am
and thanks very much .....
Oleksandr Kulchytskyi at 1-Jun-12 3:16am
Well, it seems like your remote machine doesn't have ability to connect remotely via rdc. try to handle such issue by settings appropriate settings to rdc.
gaurish thakkar at 1-Jun-12 4:19am
ok thanks for all the details....:)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 3,140
1 Maciej Los 1,910
2 KrunalRohit 1,907
3 CPallini 1,845
4 Richard MacCutchan 1,187

Advertise | Privacy | Mobile
Web03 | 2.8.151002.1 | Last Updated 31 May 2012
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100