C++ :: Program To Emulate Full Screen Console

Dec 5, 2013

So, I'm making a program in C++ that emulates a full screen console... I used SetCurrentConsoleFontEx to set the font to 12x16 but it sucks...

Anyway, I read here: [URL] .... that also the console font can be changed, but I can't make it work! How can i set the font to Lucida Console? This is the function I use to change font size:

void setFontSize(int x, int y) {
PCONSOLE_FONT_INFOEX lpConsoleCurrentFontEx = new CONSOLE_FONT_INFOEX();
lpConsoleCurrentFontEx->cbSize = sizeof(CONSOLE_FONT_INFOEX);
GetCurrentConsoleFontEx(GetStdHandle(STD_OUTPUT_HANDLE), NULL, lpConsoleCurrentFontEx);
lpConsoleCurrentFontEx->dwFontSize.X = x;
lpConsoleCurrentFontEx->dwFontSize.Y = y;
SetCurrentConsoleFontEx(GetStdHandle(STD_OUTPUT_HANDLE), NULL, lpConsoleCurrentFontEx);
}

View 2 Replies


ADVERTISEMENT

Visual C++ :: How To Detect If Window Media Player Is Running In Full Screen Mode

Jan 21, 2013

How can I check if window media player is running in full screen mode & topmost in c++ MFC?

What I used is this logic:

I compared media player full screen coordinates to that of monitor coordinates.If they are same implies media player is in fullscreen.But it has one flaw.Whenever there are control(for play,pause) displayed in full screen in media player, coordinates are not coming same as that of monitor.

View 10 Replies View Related

C++ :: Hold Screen Via GUI To Console

May 15, 2013

I had a program (on console) that uses a third-part software to draw some graphs. In order to hold the graphs on the screen, I used cin.get(); and that worked.

Now I created a GUI with Qt. The code remains generally the same. The code continues to call the software to draw graphs (during drawing graphs, there is a console opened automatically). Butcin.get(); in the code cannot hold the graphs on screen anymore. The graphs appear and disappear immediately.

View 4 Replies View Related

C/C++ :: Program To Emulate Shopping List - File Not Reading Correctly

Jan 28, 2015

I have written an program to emulate a shopping list. Everything works fine, until I try to read in from a file. Here is my read and write code (the write code looks like it is working ok, but I figured I would include it just in case), and an example of what happens to a list that has been written, then read back in.

I took this list, and wrote it to a file, then read that file back in. The .txt file looks like everything was written out properly, but when I try to read that exact same list back in, this is what I get:

View 10 Replies View Related

C++ :: Capture Console Screen And Save To Image?

Jun 7, 2014

i need to capture the console screen and save to a image:)

View 3 Replies View Related

C++ :: Clear Screen In Console - Change Text Color In EXE

Dec 28, 2013

How I can clear the whole screen in console...

And I'm using clrscr(); and its not working.

How i can change the text color in the .exe without using system function

View 4 Replies View Related

C/C++ :: Full Menu Not Shown When Running Program

Mar 4, 2014

The program is not showing my full menu just the 0 Exit and the last line of text. This is the full main source file (not implementation file or header file).

#include <iostream>
#include <string>
#include <fstream>
#include <iomanip>
#include <vector>
using namespace std;
struct menuItem{
string itemDesc;
double price;
int menuType;

[Code] .....

View 3 Replies View Related

C++ :: Program To Read Middle Names Within Text File - Full String Not Appearing

Oct 24, 2014

I've a problem here...

#include "stdafx.h"
#include <iostream>
#include <fstream>
#include <conio.h>
#include <string>
#include <iomanip>
using namespace std;
int _tmain(int argc, _TCHAR* argv[])

[Code] ....

The program needs to be able to read the middle names within the text file named Info2.txt

Simply adding the Mname or any related value where the other to name values doesn't do anything and only the 1st line appears on the output.

Don Jon111012
Jack Bo Todd151015
Jill Jo Jane161011
Bob Jack Chuck 131513
Da Fu111012

That is the correct way it appears in the text file. Also I know it's commented out, but that just to keep the program from crashing.

current output

Survey Results:

Name Results
Don Jon 33.00

This is the Info1.txt file info by the way.

Ken A202017
Gus B151015
Bill C151512
Jara C151720
Lu E101510
Chow B171015

And the output

Survey Results:

Name Results
Ken A 57.00
Gus B40.00
Bill C42.00
Jara C52.00
Lu E35.00
Chow B 42.00

Which when ran with Info1 selected, it is the correct output I'm looking for. I've tried getline and other solutions and they didn't work.

View 1 Replies View Related

C++ :: Emulate Mouse Events In Application

Mar 28, 2012

I have looked on this website and stumbled across this link: [URL] .....

My question is can how do I use that code when im console programming?

When I try this code I get errors.

" line |14|error: initializer expression list treated as compound expression|"
" line |17|error: a function-definition is not allowed here before '{' token|"
"line |40|error: expected '}' at end of input|"

Code:
#include <iostream>
using namespace std;
int main() {
int MouseMove(100,100);
void MouseMove (int x, int y ) {

[Code] .....

View 4 Replies View Related

C :: How To Emulate Callback Mechanism - Pthreads Join

Jun 19, 2013

I am trying to emulate callback mechanism in C. The code I have is follows:

Code:
#include <stdio.h>
#include <pthread.h>

struct fopen_struct {
char *filename;
char *mode;
void *(*callback) (FILE *);

[Code] .....

If I do a pthread_join in fopen_t() it works perfectly fine. But if I do that in main() I get a segmentation fault error. I want to call it in main() because I want it to be non-blocking, is there any solution?

View 1 Replies View Related

C :: How To Emulate Object Orientation With Multiple Files And Make File

Feb 13, 2013

how to structure my classes so that they all "wire together" and inherit the proper functions and data that I want them to. I want to have a Car.c and car.h which are "wired" with body.c/body.h, which in turn is wired with a frame.c/frame.h, wheel.c/wheel.h, and driver.c/driver.h.

Each part of the car holds some type of data, mostly ints: The car has a (total) mass and car_name. The body has a mass and color. The frame has a mass. The wheel(s) have a mass and force. [There will be 4 instances of wheel] The driver has a mass and driver_name. Each of these functionalities must come from their respective .c and .h files, and be amalgamated in the car.c and car.h (which should contain all the functionality of its parts). Then, in my main test program, I am to make an instance of car and hardcode in its values of: mass (which comes from the total mass of all of its parts, this is where i start to lose it.

How will I access its parts' masses in the test program?), color (a character array), current position (an integer), current velocity (an integer), and current acceleration (which comes from the total newton force of the 4 wheels, again this is where I start to get very confused). (Then in the test program I am to print out a simulation of this car over a period of 100 seconds, and show its position, velocity, and acceleration at each point (based on the mass, total newton force, and starting position). This part is of course a simple while loop, and is somewhat trivial.)

From what I understand, I will need to allocate memory for all of the data each class holds. Then, using function pointers, as well as #include "X.h" , I will need to somehow link up all of the classes together so that car has access to all of the parts' functions which set, for example, the newton force of each wheel.

We have learned a slight bit about structs, malloc, sizeof, and pointers, but I have not used them to link functionality or data from separate classes together.

View 4 Replies View Related

C++ :: Getting Screen Capture Of Whole Program?

Oct 8, 2014

For my class we have to take a screenshot of the program and put it in a word document. How can I accomplish this?

View 2 Replies View Related

C++ :: Open More Than One Console In One Program

Oct 22, 2014

I am creating a console based application which needs to be dual tasking, which prompts me to share a single console for the GUI console based and inputs from the user.

I want to know if there is a mechanism through I can open more than one command prompt so that I would use efficiently both of them.

Furthermore, I would need also to know how to control on which to print and on which not to be printed.

Is there such a thing?

I am using Visual Studio 2012 Ultimate on a Windows 8.1 Professional PC.

View 1 Replies View Related

C# :: Program That Scans Computer Screen?

Nov 20, 2014

I have a problem with a program..I wanna make a program for scan the computer screen.I mean for example there is a video which shows just 5 pictures(apple,pear,banana,strawberry,cherry pictures) but this pictures are turning nonstop in one second. and this case is continuous progress.There are 5 pictures and are chancing. Lets get my problem, I wanna make a program and when apple on the screen my keyboard will push 1,when pear on the screen my keyboard will push 2,banana is 3,strawberry is 4,cherry is 5. I have this 5 pictures which are in the video and I will introduce tham to program and I wanna compare my lib. and screen and get output.

View 3 Replies View Related

C :: Program Console Output Being Interrupted

Mar 6, 2015

I am wrapping up a Linux/C programming assignment that requires several small programs for encrypting and decrypting text. There is a bash grading script which will be used to assess the performance of my programs. The script runs fine on my local machine and all of my tests pass, but when I run everything on my University's server via SSH, the script is not behaving the same. I am fairly certain the error exists somewhere in my C code, because no other students are having this issue. The 4 main programs consist of 2 daemons which wait for clients to connect via sockets, and the two clients. There is a daemon/client pair for handling encryption, and another for handling decryption.

And here is a screenshot of what happens with the same files on the remote server:As you can see, in the 4th and 5th tests (where the program's output should read), it's instead showing "ssIgnore this message". In later tests (not pictured) there is another message that reads "ddServer to client message". This text appears nowhere in my code or the grading script, so it must be server-side.

View 1 Replies View Related

C :: Program To Print All Of Prime Numbers To Screen

May 29, 2013

I'm trying to write a program that prints all of the prime numbers to the screen. I'm getting angry because it only prints EVERY number. I think it has something to do with the bool change not being able to leave the for-loop but how to fix it.

Code:
#import <stdio.h>
#include <stdbool.h>
int main(void){
printf("
The Primes Are: 1");

[Code] ....

View 3 Replies View Related

C# :: Lottery Console Program - User Input

Oct 21, 2014

I have an a problem I need to make lottery random generation program what asks from user how many lines to gerenate random numbers. But i am now stuck.

Console.WriteLine(" choose how many numbers ");
int i = int.Parse(Console.ReadLine());
Random randomizer = new Random();
for(int j = 0; j < 7; j++) {
i = randomizer.Next(1, 39);
}
Console.WriteLine("Your random numbers are{0}", i);
Console.ReadLine();

View 5 Replies View Related

C :: Program Won't Correctly Print Proper Totals On Screen

Oct 10, 2014

Why this program won't correctly print the proper totals on screen? See my code and the included screenshot.

Code:
#include <stdio.h>
int main(void) {
int total, first, second;
printf("Enter 2 numbers:

[Code] .....

View 4 Replies View Related

C++ :: Make Terminal Screen Bigger In NCurses Program?

Jun 29, 2013

I wanted to make the terminal screen bigger in my NCurses program. Let's say if the defaults are 25 LINES and 80 COLS, I want to set them to 40 LINES and 120 COLS.

I've tried resizing all windows, but that did not work, because the actual terminal (console) was not resized. Then I found functions resizeterm and newterm, but they did not work. As far as my understanding goes resizeterm only updates NCurses information with the current configuration, while the window itself is not actually modified.

NCurses man page wrote:The function resizeterm resizes the standard and current windows to the specified dimensions

If I haven't made myself clear ( I sometimes make a mess of things... ), another example would be that I want my program to be fullscreen when I start it. Is this possible? It should be, I found a fullscreen NCurses program once, but the code was too confusing for me to understand.

Having read about things like SIGWINCH, I assume you must define a method for resizing the terminal screen yourself, I don't know where to start?

View 11 Replies View Related

C/C++ :: Program To Store Info About Students And Then Display To Screen

Oct 7, 2014

NOTES AT BOTTOM---EXPLANTION, PROBLEMS ETC. SCROLL DOWN

#include <iostream>
#include <iomanip>
#include <string>

[Code]....

I have to write a program that stores information about students and displays results (Formated). Example-

Inputs ( # of students, First and Last name of student, the gender, age, and hieght. (height inputed as inches and outputed as feet and inches))

Student 2
---------
Jett, Joan Female
100 years old 5' 7"

Ive been falling behind a little due to working late and barely having time for my school work. Coming across several issues, one being an error with GENDER (Error C4700: uninitialized local variable 'gender' used:). As well as how to format the end result, i understand that u have to use #include <iomanip>, but am confused on how to format correctly.

View 2 Replies View Related

C++ :: Static Variable Initialization - Console Output Of Program

Oct 11, 2013

What does the order of console output from your program tell you about when the static object is initialized?

#include <iostream>
using namespace std;

//class
class Firstclass {
private:

Firstclass(); //constructor
~Firstclass(); //destructor

[Code] ....

Doesn't it allocate the class static variable to the heap, thus executing its algorithm then destroying it when the program ends - or. What exactly does it tell me? When the static variable is initialized, it takes place first before any of my other functions?

View 7 Replies View Related

C++ ::  Saving PNG File In Console Program / Losing Data?

Jul 18, 2013

I am working on a project that uses a web service to extract a PNG image from a web server and save it on a local machine. It's done via a system call. I can get the output of the system call to a FILE but it appears to be losing data, most notably the PNG chunk names (IHDR/PLTE/IDAT/IEND, notably). (Unfortunately piping the output to an exterior file does not work through a system call.) The end result is ~6KB smaller than the file I am intending to retrieve.

This is the code I'm using (adapted from other material I found via searches here):

ofstream png;
png.open(/*outputfile*/, ios::binary);
FILE* fp = _popen(/*SYSTEMCALL*/, "rb");
string responseString;
if(fp != NULL) {
char a[100];
while(!feof(fp)) {
fgets(a, 100, fp);
responseString += a;
}
}
_pclose(fp);
png << responseString;

Am I missing something or just doing it wrong?

View 11 Replies View Related

C++ :: Best Way To Show A Program Remotely And Also Provide Console Input?

Sep 27, 2013

I want some people to see my C++ program, enter inputs (they can enter number 1, 2, 3, etc) as CIN, and then the program runs as it would if they were sitting in my place.

I have seen a few places which try to do this e.g.

[URL]

The problem is the CIN is not fully featured. For example in the first website you have to enter the input before you run the program. So that would not work for a program where CIN was being done all the time.

So I can get a domain, ask them to telnet into the Linux shell and compile and run my c++ Demo program. Is that the best way? Thats the worst case. I send them the .cpp file and they'll have to run and compile it on their own machine.

The best case is that they click on a link, get an online console and interact with it like they would with a real input/output c++ interface.how this can be done?

View 1 Replies View Related

C :: Finding Percentages / If Statement / Clear Screen And Reloading Program

Nov 11, 2013

For my C programming module, I've been asked to create a program which is basically a ten question mathematics quiz or test if you like. Below is a copy and paste of my current, working program.

Code:

#include <stdio.h>
#include <stdlib.h>
#include <time.h>
int main () {

[Code]....

I am also trying to include into my program; If the user achieves 4 or less marks in the test, they are asked if they would like to repeat the test (have a second chance).

I have been asked by my Lecturer to ask the Question; "Would you like to try again" and the response is 'Y' for yes, 'N' for no. Would this be shown by:

char Y = Y;
char N = N;
printf("Would you like another go?");
scanf(%d%, &Y, &N);

And finally; If the user would like another go, then I am trying to include the code that clears the screen and then reloads the program?

What code is used to clear the screen and no clue what code is written to refresh or reload the program. I assume it's a loop statement or some sort.

View 1 Replies View Related

C++ :: Program To Model Operation Of Incoming Flights Computer Screen

Apr 14, 2013

The project is "Design and write a program to model the operation of incoming flights computer screen that is normally found at a typical small airport like Moshoeshoe I airport (if they do have one). The following provides the information that needs to be displayed about each flight:

• Airline - [string of maximum length 15] Name of the airline, eg. FlySAA
• Flight Number - [string of maximum length 5] eg. 04120
• Origin - [string of maximum length 25] Place where the flight originated from eg. Johannesburg
• Date/Time - [integers: Hour, Minute, Day, Month, Year] Arrival time of the flight
• Status - [string of maximum length 15] Whether the flight is "OnTime" or "Delayed"

View 4 Replies View Related

C++ :: Program That Reads Text From A File And Outputs Each Line To The Screen - I/O Streams

Jun 15, 2013

I seem to be missing a concept or 2 here ... I am tasked with writing a program that reads text from a file and outputs each line to the screen as well as to another file PRECEDED by a line number ...

In addition, I have to Print the line number at the start of the line and right-adjusted in a field of 3 spaces ...

Follow the line number with a colon then 1 space, then the text of the line.

Another kicker, is I have to grab the data 1 character at a time and write code to ignore leading blanks on each line.

Here is what I have so far:

#include <iostream>
#include <conio.h>
#include <fstream>
#include <string>
#include <cstdlib>
#include <cctype>
using namespace std;
int main() {
char next;
int count = 0;

[Code] ....

View 7 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved