Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


[C++] system(); calls - need other commands that do the same

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
TROLOLOLOLOLOLOLOLOLOLOLO
Expert Cheater
Reputation: -1

Joined: 27 Dec 2009
Posts: 100

PostPosted: Sun Feb 28, 2010 5:53 pm    Post subject: [C++] system(); calls - need other commands that do the same Reply with quote

I've been told using system(); calls is bad practice, since I'm starting I don't want to develop a bad habit early. Can someone please tell me ways I can accomplish the following without using system(); calls, thanks!

system("TITLE");

system("PAUSE");

system("CLS");
Back to top
View user's profile Send private message
Slugsnack
Grandmaster Cheater Supreme
Reputation: 71

Joined: 24 Jan 2007
Posts: 1857

PostPosted: Sun Feb 28, 2010 7:08 pm    Post subject: Reply with quote

SetConsoleTitle()
kbhit()/PeekConsoleInput()
GetConsoleScreenBufferInfo()/FillConsoleOutputCharacter()/FillConsoleOutputAttribute()/SetConsoleCursorPosition()
Back to top
View user's profile Send private message
TROLOLOLOLOLOLOLOLOLOLOLO
Expert Cheater
Reputation: -1

Joined: 27 Dec 2009
Posts: 100

PostPosted: Mon Mar 01, 2010 8:08 pm    Post subject: Reply with quote

Slugsnack wrote:
SetConsoleTitle()
kbhit()/PeekConsoleInput()
GetConsoleScreenBufferInfo()/FillConsoleOutputCharacter()/FillConsoleOutputAttribute()/SetConsoleCursorPosition()


When I use any of those I get the following error:
Code:
error C3861: 'example function': identifier not found


Do I need to import any other library to use them?
Back to top
View user's profile Send private message
samo502
Master Cheater
Reputation: 0

Joined: 14 Mar 2008
Posts: 342
Location: That place.

PostPosted: Tue Mar 02, 2010 12:58 am    Post subject: Reply with quote

CometJack wrote:
Slugsnack wrote:
SetConsoleTitle()
kbhit()/PeekConsoleInput()
GetConsoleScreenBufferInfo()/FillConsoleOutputCharacter()/FillConsoleOutputAttribute()/SetConsoleCursorPosition()


When I use any of those I get the following error:
Code:
error C3861: 'example function': identifier not found


Do I need to import any other library to use them?

You need to include <windows.h>, example follows:
Code:
#include <iostream>
#include <windows.h>
using namespace std;

int main(void)
{
    SetConsoleTitle("Hello World");
    cout << "Hello, world!" << endl;
    PeekConsoleInput();
    return 0;
}
Back to top
View user's profile Send private message MSN Messenger
Slugsnack
Grandmaster Cheater Supreme
Reputation: 71

Joined: 24 Jan 2007
Posts: 1857

PostPosted: Tue Mar 02, 2010 6:59 am    Post subject: Reply with quote

btw when you are peeking the console input, you don't want to use it as how samo502 just did. you'd probably loop it, checking the lpNumberOfEventsRead parameter
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites