Limpiar consola usando la API (C/C++)

Función (en C) que limpia la consola (API) (probada en Windows)
Vendría siendo equivalente a usar:

System("CLS");

Función:

int ClrScrn(void)
{
// Top left corner coordinates
COORD coord = {0};

// Contains information about screen buffer
CONSOLE_SCREEN_BUFFER_INFO cBufferInfo;

// Characters written in buffer
DWORD dwI;

// Characters to clear ("area" of console, so to speak)
DWORD dwSize;

// Handle to console
HANDLE hI = GetStdHandle(STD_OUTPUT_HANDLE);

// Just a bit error handling
if(hI == INVALID_HANDLE_VALUE) return (EXIT_FAILURE);

// GetConsoleScreenBufferInfo returns 0 on error
if (GetConsoleScreenBufferInfo(hI, &cBufferInfo))
{
// Calculate characters to clear
dwSize = cBufferInfo.dwSize.X * cBufferInfo.dwSize.Y;

// Write space characters to buffer as many times as needed, i.e. dwSize
FillConsoleOutputCharacter(hI, TEXT(' '), dwSize, coord, &dwI );

// Set console cursor to top left coord
SetConsoleCursorPosition(hI, coord);

return (EXIT_SUCCESS);

} else
return (EXIT_FAILURE);
}

Anuncios
  1. I’ve been exploring for a little bit for any high-quality articles or blog posts on this kind
    of area . Exploring in Yahoo I at last stumbled upon
    this site. Reading this information So i’m happy
    to convey that I have an incredibly good uncanny feeling I
    discovered just what I needed. I most certainly will make certain
    to do not forget this web site and give it a look regularly.

  2. Write more, thats all I have to say. Literally, it seems as though you relied on the video to
    make your point. You definitely know what youre talking about, why throw away your intelligence on
    just posting videos to your weblog when you could be giving us something informative
    to read?

  3. You really make it seem so easy with your presentation but I find
    this matter to be actually something that I think I would never understand.
    It seems too complicated and very broad for me. I’m looking forward for your next post, I’ll try to get the hang of it!

  4. Thanks for sharing your thoughts on how to investment. Regards

  5. Right now it seems like Expression Engine is the top blogging platform out there right now.
    (from what I’ve read) Is that what you are using on your blog?

  6. Hi. I noticed your site title, “Limpiar consola usando la API (C/C++) McLinoWs” does not really reflect the content of your web page.
    When creating your site title, do you believe it’s most beneficial to write it for SEO or for your audience? This is one thing I’ve been
    battling with because I want great search rankings but at the same time I want the best quality for my website visitors.

  7. I just hope a is blocked as a result a 2016 Adriana lima
    v magazine nude photoshoot may be agreed if a lot swing advises go as
    associated with.

  8. I live appropriate, fema is above as a result of of a flood
    in Hilary duff nude blogspot, a gov vehicles ‘re appropriate as a result and also ‘re many missile silos also a
    few large bases.

  9. Its like you read my mind! You appear to know so much about
    this, like you wrote the book in it or something. I think that you could do with
    some pics to drive the message home a bit, but instead of that, this is fantastic blog.

    A fantastic read. I will definitely be back.

  10. Hi there. I was contemplating adding a website link back
    to your blog since both of our sites are based around the same niche.
    Would you prefer I link to you using your website address: http://mclinows.
    wordpress.com/2009/10/02/limpiar-consola-usando-la-api-cc/ or
    website title: Limpiar consola usando la API (C/C++) | McLinoWs.
    Please make sure to let me know at your earliest convenience.
    Thankyou

  11. Heya! I’m at work browsing your blog from my new apple iphone! Just wanted to say I love reading your blog and look forward to all your posts! Keep up the fantastic work!

  12. Kim kardashian sex it also already have a new sport attest it also
    has created up.

  13. Why people still use to read news papers when in this technological world all is existing on net?

  14. When some one searches for his essential thing, so he/she wants to be available that in detail, therefore that thing is maintained over here.

  15. I think everything posted was actually very logical. However, consider this, what if you
    were to create a awesome title? I mean, I don’t want to tell you how to run your blog, however what if you added a headline to maybe get a person’s attention?
    I mean Limpiar consola usando la API (C/C++) |
    McLinoWs is a little boring. You might look at Yahoo’s home page and see how they write article headlines to get people interested. You might add a video or a pic or two to grab readers interested about what you’ve written.
    In my opinion, it would make your blog a little livelier.

  16. Very nice post. I simply stumbled upon your blog and wished
    to mention that I have truly loved surfing around your blog
    posts. In any case I’ll be subscribing in your feed and I hope you write once more very soon!

  17. What’s up every one, here every one is sharing these kinds of know-how, thus it’s fastidious to
    read this web site, and I used to pay a visit this blog daily.

  18. Quality articles is the crucial to attract the visitors to visit
    the site, that’s what this web page is providing.

  19. Howdy! I could have sworn I’ve been to this website before but after checking through some of the post I realized it’s new to me.
    Anyhow, I’m definitely glad I found it and I’ll be book-marking and checking back frequently!

  20. Why people still make use of to read news papers when in this technological
    globe the whole thing is accessible on web?

  21. Hi-ya, good web site you’ve got at this time there.

  22. Hi there, just wanted to mention, I enjoyed this post. It
    was inspiring. Keep on posting!

    • Johnf639
    • 12/08/14

    Really appreciate you sharing this post.Thanks Again. Really Great. cdebkabdfged

  23. Nuestros técnicos especialistas están en constante aprendizaje, por lo que están totalmente capacitados para llevar a cabo la reparación de cualquier nevera congelador Siemens. Después de explicarnos su problema, nuestro técnico más adecuado para su tipo de avería irá a su hogar el mismo día para solucionarselo. Una interminable lista de electrodomésticos para hacerles la vida mucho más snecilla y cómoda.

  1. 25/04/14
  2. 18/06/14
    Trackback from : fix all mobile phone
  3. 5/01/15
    Trackback from : big girl shoes quotes

Responder

Introduce tus datos o haz clic en un icono para iniciar sesión:

Logo de WordPress.com

Estás comentando usando tu cuenta de WordPress.com. Cerrar sesión / Cambiar )

Imagen de Twitter

Estás comentando usando tu cuenta de Twitter. Cerrar sesión / Cambiar )

Foto de Facebook

Estás comentando usando tu cuenta de Facebook. Cerrar sesión / Cambiar )

Google+ photo

Estás comentando usando tu cuenta de Google+. Cerrar sesión / Cambiar )

Conectando a %s

A %d blogueros les gusta esto: