اذهب إلى المحتوى

omar zizou

الأعضاء
  • المساهمات

    5
  • تاريخ الانضمام

  • تاريخ آخر زيارة

أجوبة بواسطة omar zizou

  1. سلام عليكم 
    واجهة مشكلة في استخدام 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;

     

  2. بتاريخ 6 ساعات قال عبود سمير:

    لا أدري ماذا يوجد في الملف a.txt لديك لكن كما أخبرتك سابقاً يُمكن إستخدام مُتغير من نوع string تُخزن فيه مُحتوى الملف a.txt ثم تكتب ما خزنته بإستعمال الدالة fputs في الملف الذي تريد بهذا الشكل: 

    
    #include <stdio.h>
    #include <string>
    using namespace std;
    int main () {
      FILE *fp;
      string content = "content of source file";
        
      fp = fopen("file.txt", "w");
    
      fputs(content.c_str(), fp);
      fclose(fp);
    
      return(0);
    }

    ملف a.txt يحتوي عى عنوبن ip أكثر من 10000 سطر أريد تضمينهم في ملف .h واستدعائه لإنشاء ملف abc.txt عند التنفيد

  3. السلام عليكم 

    مرحبا لقد قمت بكتابة هادا الكود بلغة ++c لنقل محتوى ملف  a.txt الى abc.txt فظهر خطئ ولم أستطع تنفيد . أريد حل ؟؟

    #include <iostream>
    #include <stdio.h>
    
    using namespace std;
    
    int main()
    {
        
    
        FILE* pFile;
        FILE* pofg;
        pFile = fopen("a.txt", "r");
        pofg = fopen("abc.txt", "w");
        if (pofg != NULL)
        {
            fputs(pFile, pofg);
            fclose(pofg);
        }
        return 0;
    }

     

×
×
  • أضف...