Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

CreateProcess Function for Visual C++

Posted on 1998-04-11
5
Medium Priority
?
210 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 200 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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

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…
Templates For Beginners Or How To Encourage The Compiler To Work For You Introduction This tutorial is targeted at the reader who is, perhaps, familiar with the basics of C++ but would prefer a little slower introduction to the more ad…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.

721 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