Archived

This topic is now archived and is closed to further replies.

z_yang

netbus tech

Recommended Posts

z_yang    122
ok, i want my game server to be able to launch an application on one of the clients remotely, which is kinda like the netbus. the things is, i know how to do the net work stuff, but i just have no clue how to use the windows commands to launch applications, at least that''s what i think how it works. maybe i was wrong, im just guessing, so if you understand the netbus technology(i watch too much startreck), please help the brother out

Share this post


Link to post
Share on other sites
Guest Anonymous Poster   
Guest Anonymous Poster
ShellExecute IS part of the win32 API.

(link shellapi.lib)
#include

BOOL ShellExecuteEx(
LPSHELLEXECUTEINFO lpExecInfo
);


If you are programming windows you probably have access to online help to see the SHELLEXECUTEINFO structure, so I''m not going to post it here, seeing as how MS won''t like me copying straight from MSDN.
This call is the accepted standard way to spawn executables in win32 environments for the purpose you describe.

Hope this helps,

Tim

Share this post


Link to post
Share on other sites
fingh    142
Sorry, I posted the previous anonymous by accident, then couldn''t edit it grrrrr....

The include statement should include shellapi.h.

regards,

Tim

Share this post


Link to post
Share on other sites
LostLogic    151
You can also use the WinExec() function:

  
UINT WinExec(
LPCSTR lpCmdLine, // address of command line

UINT uCmdShow // window style for new application

);

Example:
WinExec("c:\\myapp.exe",1);


Courtesy of Microsoft

It is mainly for 16-bit code though. You can use it, but Microsoft recommends you use CreateProcess() for 32-bit.

Check out the MSDN help for more information.

Share this post


Link to post
Share on other sites