سلام عليكم
واجهة مشكلة في استخدام thread
#include <windows.h>
#include <stdint.h>
#include <iostream>
#include <thread>
#include <string>
using namespace std;
DWORD ProcessID;
int main()
{
HANDLE h = GetStdHandle(STD_OUTPUT_HANDLE); //لتغير لون الكنابة
SetConsoleTextAttribute(h, 11);
cout << "Wolcome to TOCIX " << "\n" << endl;
Sleep(1000); //تأخير ثانية
SetConsoleTextAttribute(h, 13);
cout <<"Created by TOXIC" << "\n" << "This program is free" << "\n" << endl;
SetConsoleTextAttribute(h, 10);
cout << "Please wait..." << endl;
Sleep(2000); //تأخير ثانيتين
HWND hwnd = FindWindowA(0, ("smartgaga")); // hwnd ابحث عن اسم النافدة و قم بتخزينه في المتعيرة .
GetWindowThreadProcessId(hwnd, &ProcessID); // hwndو processID اعطيني برامج شغالة و بحث في دالخلهم عن
if (hwnd)
{
cout << "SmartGaGa emulator is ruuning, Make sure pubgm is not running, will run pubgm..." <<"\n" << endl; //رسالة المحاكي مفنوح .
}
else
{
cout << "Smartgaga emulator is not ruuning, will run it please wait... \nStarting emulator please wait..." <<"\n"<< endl; //رسالة المحاكي ليس مفتوح .
system("cmd /C \"\"C:\\Program Files (x86)\\SmartGaGa\\ProjectTitan\\Engine\\ProjectTitan.exe\"\""); //فنح المحاكي .
cout << " waite plz.." << endl;
return 0;
}
}
أريد أن تنفيد الامر
system("cmd /C \"\"C:\\Program Files (x86)\\SmartGaGa\\ProjectTitan\\Engine\\ProjectTitan.exe\"\"");
و الانتقال مباشرة الى الأمر التالي دون انتضار تشغيل البرنامج
cout << " waite plz.." << endl;