We have upgraded our system to latest version of MyBB. We are very sorry for the downtime ! Read More.
Advertise Here | Remove Ads

How can we put the console at the top of all windows ?
  • 0 Vote(s) - 0 Average


Need Help How can we put the console at the top of all windows ?
1
Hi guys
is it possible to keep the output console at the tops of all the windows ?? If its possible then please post the code Big Grin
This post was last modified: 06-02-2017, 02:11 AM by Jet14. Edited 1 time in total.



2
Hi @Jet14
Yes, we can do this. Check out below code...
Code:
#include <iostream>
#define _WIN32_WINNT 0x0500
#include <windows.h>
int main()
{
    HWND console = GetConsoleWindow();
    std::cout <<" I am at the top";
    if (console)
    {
        SetWindowPos(console,HWND_TOPMOST,0,0,0,0,SWP_DRAWFRAME | SWP_NOMOVE | SWP_NOSIZE);
    }
    ShowWindow(console,SW_NORMAL);
    return 0;
}


}


Reply





Forum Jump:


Users browsing this thread:
1 Guest(s)

Advertise Here | Remove Ads