Solved

CreateProcess Function for Visual C++

Posted on 1998-04-11
5
203 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
  • 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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Suggested Solutions

Often, when implementing a feature, you won't know how certain events should be handled at the point where they occur and you'd rather defer to the user of your function or class. For example, a XML parser will extract a tag from the source code, wh…
  Included as part of the C++ Standard Template Library (STL) is a collection of generic containers. Each of these containers serves a different purpose and has different pros and cons. It is often difficult to decide which container to use and …
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

785 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