Click here to Skip to main content
13,140,742 members (50,943 online)
Rate this:
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 31-May-12 7:14am
You mean something like net send "message" in 2000,xp or msg.exe in windows 7?
gaurish thakkar 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 31-May-12 12:08pm
gaurish thakkar 1-Jun-12 0:43am
WTSSendMessage can you please give me example ...of these functions in c#
gaurish thakkar 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 1-Jun-12 2:07am
and thanks very much .....
Oleksandr Kulchytskyi 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 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
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web02 | 2.8.170915.1 | Last Updated 31 May 2012
Copyright © CodeProject, 1999-2017
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