Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Popup window to a remote computer

Status
Not open for further replies.

rejome

Programmer
May 9, 2002
17
CA
I'm able to established a connection to a remote computer and I'm asking myself if it's possible to popup a window on the remote computer screen? The remote computer doesn't have a program to "catch" my commands (as a server). Does CreateWindowEx could be a good idea?

Well, the bottom line is, I'm trying to do a chat program (really basic) that only one computer has the program to execute.

Is that possible???
 
If you want communication to be one way, then you could use the NET SEND command. This is a command-line tool that will send a text message to any Windows NT/2000/XP machine. Windows 9x machines will need to run the WinPopup application to receive messages. Type "NET SEND /?" at a command prompt.

You can implement the same functionality in code using the NetMessageBufferSend API function as follows ...

Code:
Private Declare Function NetMessageBufferSend Lib _
  "netapi32.dll" (yServer As Any, yToName As Byte, _
  yFromName As Any, yMsg As Byte, ByVal lSize As Long) As Long

Public Function BroadcastMessage(sToUser As String, _
    sMessage As String) As Boolean
   Dim yToName() As Byte
   Dim yMsg() As Byte

   yToName = sToUser & vbNullChar
   yMsg = sMessage & vbNullChar
   If NetMessageBufferSend(ByVal 0&, yToName(0), ByVal 0&, _
        yMsg(0), UBound(yMsg)) = NERR_Success Then
     BroadcastMessage = True
   End If
End Function

Failing that, why re-invent the wheel? - there are plenty of free chat programs around and no doubt a search through a few VB code sites will probably turn up something you could use.
 
Yeah...I know the net send command. But I want a communication "two-way". As example, I want to popup a window with a text box in where the "sender" and the "remote" can answer to each other by a click on a button (for example). I don't want the remote to response me by using the net send command.

But hey, thanks anyway Norris68.
 
For a chat program you can use winsock.
you need to make a server and a client.
Iam making one right know where i mix the 2 and where you can chat and send files like in messenger.

:)

ken Christensen
Ken@Christensen.dk
Ken Christensen Software
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top