Positioning Cursor in Visual C++ Console Program - Help Needed

  • Context: C/C++ 
  • Thread starter Thread starter jerkjames
  • Start date Start date
  • Tags Tags
    C++ Program Visual
Click For Summary
SUMMARY

The discussion focuses on positioning the cursor in a Visual C++ console program, highlighting the absence of the traditional gotoxy() function. Instead, users should utilize the SetCursorPosition function from the Windows API. The conversation references the use of GetStdHandle(STD_OUTPUT_HANDLE) to obtain the console handle and emphasizes the need for Win32 console functions for effective cursor manipulation.

PREREQUISITES
  • Familiarity with Visual C++ programming
  • Understanding of Windows API functions
  • Knowledge of console applications
  • Basic experience with handling console output
NEXT STEPS
  • Research the SetCursorPosition function in the Windows API
  • Explore additional Win32 console functions for enhanced console manipulation
  • Learn about handling console input and output in Visual C++
  • Investigate cross-platform alternatives to gotoxy() for console applications
USEFUL FOR

Visual C++ developers, software engineers working on console applications, and programmers interested in Windows API functionalities for cursor management.

jerkjames
Messages
1
Reaction score
0
I want to do this (HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE);

if ( hConsole != INVALID_HANDLE_VALUE )
{
// do stuff...
...
}
) In visual c++, I generally use gotoxy() to position the http://www.seopromolinks.com/business_continuityplan.asp" ursor in a console program. Help needed
 
Last edited by a moderator:
Technology news on Phys.org
There is no "gotoxy" function either in the standard library or the Windows library. This was a Borland library function from the days of DOS that was ported to a few platforms. Use SetCursorPosition instead:

http://msdn2.microsoft.com/en-us/library/ms682073.aspx

More Win32 console functions are listed here:

http://msdn2.microsoft.com/en-us/library/ms686025.aspx
 

Similar threads

  • · Replies 0 ·
Replies
0
Views
3K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 1 ·
Replies
1
Views
4K
  • · Replies 3 ·
Replies
3
Views
2K
Replies
10
Views
5K
Replies
69
Views
11K
Replies
7
Views
4K
Replies
4
Views
4K
  • · Replies 2 ·
Replies
2
Views
2K