3
Next, I have a simple Shellexecute code that was done in Visual C++ 2012, but because it is a closed and paid platform and because I need my customers to keep downloading more programs I would like this project to be ported to another language. I will post the main code and project link on Github.
https://github.com/zoiobnu/L2-EXE
I need this code, without needing Visual Studio , without needing more DLL’s on the client’s computer, I just need it to take the executable and run inside the game.
#define _WIN32_WINNT _WIN32_WINNT_WINXP
#define NOMINMAX
#include <windows.h>
#include <cstdlib>
// Start L2 as .bin with IP as parameter.
// You can use IP or DNS as IP parameter.
// You could include other parameters.
// You can change the path to the .bin file to avoid including the L2.exe inside the System folder.
// Author: Zoey76
int _stdcall wWinMain(HINSTANCE hInst, HINSTANCE prevInst, LPWSTR szCmdLine, int nCmdShow)
{
ShellExecute(0, L"open", L"cmd.exe", L"/C start l2ellite/l2.bin IP=127.0.0.1", 0, SW_HIDE);
}
Taking advantage of the fact that you seem to be new here, here are some links that can help in the elaboration of the questions: [Tour], [Ask] and also the Community FAQ. Incidentally, for new user, your question is already well formatted, maybe if you improve a little the content with more details of the need (type of environment you will use, compiler desired etc.) can be a good question, because the theme is interesting. The recommended links can help in this regard. And of course, welcome.
– Bacco
I don’t understand what you’re asking.
– Victor Stafusa
Just one note: Codeblocks is an IDE and not a compiler, in case it uses Mingw by default (I think you can use other compilers).
– Guilherme Nascimento
And do you really need an executable just for that? If you create a file
.bat
with the commandstart l2ellite/l2.bin IP=127.0.0.1
shall operate in the same way.– Leandro Godoy Rosa
If I create a . bat works , but for security reasons, I don’t want my players to see the server IP .
– Osni Pezzini Junior
Creating an executable just feels safe. Alias, you don’t even need to protect anything, you can tell even if it was possible to protect
– Maniero
Many of the players don’t even know how to look , but if they don’t want to help can close the post.
– Osni Pezzini Junior