Solved

how to set console cursor position for a program running in sun machine

Posted on 2004-04-04
5
837 Views
Last Modified: 2012-08-14
hi,

we developped a p2p c++ console application running on sun machines, am wondering how to set console cursor position in the terminal we used to run the program, want to have a static manu on top and the bottom display chat room messages, of which should be dynamic. i am a beginner, so it would help alot if you would be more specific and tell me the library name and actual function to use. thanks  alot
0
Comment
Question by:mwong1216
5 Comments
 
LVL 15

Assisted Solution

by:lakshman_ce
lakshman_ce earned 300 total points
ID: 10754020
You can try to use the API
SetConsoleCursorPosition

The SetConsoleCursorPosition function sets the cursor position in the specified console screen buffer.


BOOL SetConsoleCursorPosition(
  HANDLE hConsoleOutput,
  COORD dwCursorPosition
);

Declared in Wincon.h; include Windows.h

Plz refer to the following links also

http://www.experts-exchange.com/Programming/Programming_Languages/Cplusplus/Q_10171468.html
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dllproc/base/using_the_high_level_input_and_output_functions.asp

-Lakshman
0
 
LVL 30

Expert Comment

by:Axter
ID: 10754155
Are you using XWindows?
Please give a little more details on your developement environment.
0
 

Author Comment

by:mwong1216
ID: 10754767
using Sun Solaris 8, develop by typing code into the xemacs editor, no graphic just command lines,  nothing fancy, using terminal to compile and execute. so setting the cursor also means setting the display position for the terminal. am wondering the above metioned API works for Sun Solaris? or just for Windows? thanks alot
0
 
LVL 17

Accepted Solution

by:
rstaveley earned 200 total points
ID: 10755939
Use the curses library - see http://docs.sun.com/db/doc/816-0215
0
 
LVL 17

Expert Comment

by:rstaveley
ID: 10755940
The Microsoft links are Windows-specific
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Handling string inputs in C/Linux 23 179
java inner class, for the sole use of parameter passing 21 76
Dialogbox API leak? 18 80
Problem with SqlConnection 4 157
Templates For Beginners Or How To Encourage The Compiler To Work For You Introduction This tutorial is targeted at the reader who is, perhaps, familiar with the basics of C++ but would prefer a little slower introduction to the more ad…
What is C++ STL?: STL stands for Standard Template Library and is a part of standard C++ libraries. It contains many useful data structures (containers) and algorithms, which can spare you a lot of the time. Today we will look at the STL Vector. …
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

930 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now