Need: Concatenate the result of the function GetComputerName (nameBuf)
with the command to open the Chormium.
Objective: Create a new profile with the name of the machine that is being carried out the installation.
Problem: I do not know how I can accomplish this concatenation've tried to accomplish with strcpy
and strcat
without success.
Here my code:
int WINAPI WinMain(HINSTANCE inst,HINSTANCE prev,LPSTR cmd,int show)
{
//Close phpdesktop.exe
WinExec("taskkill /F /IM phpdesktop.exe", SW_HIDE);
//Sleep
Sleep(500);
//Open phpdesktop.exe mini server
WinExec("phpdesktop.exe -S 127.0.0.1:54007 -t www -c php.ini", SW_HIDE);
//Sleep
Sleep(500);
//Get computer name
TCHAR nameBuf[MAX_COMPUTERNAME_LENGTH + 2];
DWORD nameBufSize;
nameBufSize = sizeof nameBuf - 1;
if (GetComputerName(nameBuf, &nameBufSize) == TRUE)
{
//How to make the concatenation result nameBuf GetComputerName function with the command of Chromium.
WinExec(strcpy("chromium\\ChromiumPortable -app=http://127.0.0.1:54007/ --profile-directory=", nameBuf), SW_HIDE);
}
//Return
return 0;
}
--
Pastbin: http://pastebin.com/N1eyAfGV