Solved

CreateProcess Function for Visual C++

Posted on 1998-04-11
5
202 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

In days of old, returning something by value from a function in C++ was necessarily avoided because it would, invariably, involve one or even two copies of the object being created and potentially costly calls to a copy-constructor and destructor. A…
  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 concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
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.

762 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now