Solved

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

Posted on 2004-04-04
5
845 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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Introduction This article is the first in a series of articles about the C/C++ Visual Studio Express debugger.  It provides a quick start guide in using the debugger. Part 2 focuses on additional topics in breakpoints.  Lastly, Part 3 focuses on th…
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 viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

821 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