Hello everyone, I have one question.. should be relatively simple but I just cant seem to find any info anywhere.. maybe Im just looking in the wrong place and need guidance..
Here is my problem.. I have the following code:
EnableMenuItem(GetSystemMenu(GetConsoleWindow(), FALSE), SC_CLOSE , MF_GRAYED);
DrawMenuBar(GetConsoleWindow());
GetSystemMenu(GetConsoleWindow(), FALSE); //Disables [(CTRL + SPACE) && (ALT + F4)]
//HWND hWnd = GetConsoleWindow(); //Gets a handle to the console window...
//ShowWindow( hWnd, SW_HIDE ); //Will Hide Console Itself..
//ShowWindow( hWnd, SW_RESTORE ); //Restores Console Itself..
It disables the close(x) button on a console program but lets you minimize and maximize..
It also disables the ctrl space click and alt f4.. so they cant exit it that way either..
I have commented out the hiding and showing of the window because thats not what I want to do.. I want the user to see the program running, know that its running but not be able to exit it until its finished running!
I have gotten as far as disabling the close buttons and shortcuts that way, but they can right click the program on the taskbar and press close that way Or they can close it through task manager..
I want to disable those options while its running but KEEP the program ON Screen.
Show/Restore console makes it disappear completely.. (again not what I want).
Question: Is there a way to make it not show in task manager & to make it not right clickable on the task bar?? I do NOT want to HIDE it from that task bar because if the user minimizes it, they will not be able to restore it. I just want to disable right clicking it or closing it from the task bar and task manager.
Thank you in advance.