V
V
v12maksv132022-02-15 02:27:59
C++ / C#
v12maksv13, 2022-02-15 02:27:59

Is it possible to create an additional console window in c++?

Yesterday I started trying to do something in C++, and I have a question, is it possible to open a new one immediately after closing the console? 620ae525d81e1859237685.png
so that after the "CORRECT PASSWORD" a new one opens, here is the code

#include <iostream>
#include <time.h>
#include <dos.h>
#include <ctime>
#include <windows.h>
#include <process.h>
using namespace std;
int main(int argc, const char * argv[]) {
  int num1, result;

  setlocale(LC_ALL, "Russian");
  printf("MB приветствует вас!/Magic Bullet! WELCOME YOU!\n");
    Sleep(3000);
    cout << "Введи свой ключ, пожалуйста/Enter your key, pls! :)\n" << endl;
    cout << "Ваш ответ:/your answer" << endl;

  cin >> num1;
  result = num1;

  if (result < 33102) {
    setlocale(LC_ALL, "Russian");
    cout << "ТЫ ЧЕ ШАВКА, ИДИ КЛЮЧ КУПИ, ОБСОС!/WHAT ARE YOU MUCH, GO BUY THE KEY, OBSOX!" << endl;
    Sleep(5000);
    exit(0);
  }
  
  if (result > 33102) {
    Sleep(5000);
    setlocale(LC_ALL, "Russian");
    cout << "ТЫ ЧЕ ШАВКА, ИДИ КЛЮЧ КУПИ, ОБСОС/WHAT ARE YOU MUCH, GO BUY THE KEY, OBSOX!" << endl;
    Sleep(2000);
    exit(0);
  }

  if (result == 33102) {
    Sleep(5000);
    printf("Спасибо за покупку Magic Bullet!/Thankee you for buy Magic Bullet!");
    Sleep(5000);

    CreateWindow:
      BOOL CreateProcess(CREATE_NEW_CONSOLE);
      FreeConsole();
      cout << "its  seconds console";
  } 
return 0;
}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
C
calculator212, 2022-02-15
@calculator212

here

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question