Solved

CreateProcess Function for Visual C++

Posted on 1998-04-11
5
207 Views
Last Modified: 2010-04-10
I am writing a program that needs to send a message to a user with a message I type in.  I don't mind using the net send function, but need to know how to send the user and message to it, also if I go this route, I want the command window that pops up to be minimized.  However, I would rather not use this process.  How can this be accomplished?
0
Comment
Question by:york040598
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
5 Comments
 
LVL 11

Accepted Solution

by:
alexo earned 100 total points
ID: 1184217
Under NT, check the function NetMessageBufferSend().  Note that all the strings are uincode!
Under 95, I'm affraid you'll have to CreateProcess() with "net send".
0
 
LVL 11

Expert Comment

by:alexo
ID: 1184218
Wow!  Shitty memory...
There's a way that works for noth 95 and NT.

1. Open mailslot (using CreateFile() call) named \\<computer>\mailslot\messngr
    Where <computer> is the name of computer to receive the message (can also
be workgroup or domain name).

2. Write your message to the mailslot (using WriteFile() call) in this form: <from>\0<to>\0<text>
    <from> is the name of messsage sender,
    <to> is the name of recipient (in fact any text you wish, WinPopup displays these pieces of text in message title bar).
    Note the zero bytes separating 3 parts of the message!

3. Close the mailslot.

0
 
LVL 11

Expert Comment

by:alexo
ID: 1184219
Also, the recepient has to run winpopup (Win3.x, Win95) or the messenger service (NT).  That is also true for the regular "net send".
0
 

Author Comment

by:york040598
ID: 1184220
The problem with the latter suggestions is that it seems I must know the computer I am send to.  Rather than a logged in user like net send does.  
0
 
LVL 11

Expert Comment

by:alexo
ID: 1184221
york, I'm sorry I didn't respond earlier (lost the reference to the question).

You can go low level and use Netbios() to send a message to a user name (that's what NET SEND does).  However, NetBios programming takes getting used to...

0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

What is C++ STL?: STL stands for Standard Template Library and is a part of standard C++ libraries. It contains many useful data structures (containers) and algorithms, which can spare you a lot of the time. Today we will look at the STL Vector. …
C++ Properties One feature missing from standard C++ that you will find in many other Object Oriented Programming languages is something called a Property (http://www.experts-exchange.com/Programming/Languages/CPP/A_3912-Object-Properties-in-C.ht…
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

631 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question