Thread: Removing ribbon above display area

  1. #31
    Registered User
    Join Date
    May 2009
    Posts
    4,067
    I have to give up. You need to find an website that supports your IDE.

    Turns out that maybe TDM 64 bit was able to build 32 bit GUI; once I installed 32 bit MinGW GCC got the same blank command prompt like window frame that was empty.

    When running an console program try running the program exe file from the cmd.exe window and see if it does what you want.

    Tim S.
    "...a computer is a stupid machine with the ability to do incredibly smart things, while computer programmers are smart people with the ability to do incredibly stupid things. They are,in short, a perfect match.." Bill Bryson

  2. #32
    Registered User
    Join Date
    May 2009
    Posts
    4,067
    You can try this
    Tools -> Environmental Options
    Uncheck "Pause Console Programs after return"

    This does NOT do what you requested; but, it does what other IDE newbies want and it might be what you want.

    Tim S.
    "...a computer is a stupid machine with the ability to do incredibly smart things, while computer programmers are smart people with the ability to do incredibly stupid things. They are,in short, a perfect match.." Bill Bryson

  3. #33
    Registered User
    Join Date
    May 2009
    Posts
    4,067
    Found an answer to your code problem; it is piece together from multiple websites.

    Code:
    #include <iostream>
    #include <cstdio>
    #include <windows.h>
    
    HWND GetConsoleHwnd(void);
    
    /* run this program using the console pauser or add your own getch, system("pause") or input loop */
    
    int main(int argc, char** argv) {
    	HWND hWnd;
    	
    	hWnd = GetConsoleHwnd();
    	
        SetWindowLong(hWnd, GWL_STYLE, GetWindowLong(hWnd, GWL_STYLE) & ~WS_BORDER);
        getc(stdin);
    	return 0;
    }
    
    HWND GetConsoleHwnd(void)
       {
           #define MY_BUFSIZE 1024 // Buffer size for console window titles.
           HWND hwndFound;         // This is what is returned to the caller.
           char pszNewWindowTitle[MY_BUFSIZE]; // Contains fabricated
                                               // WindowTitle.
           char pszOldWindowTitle[MY_BUFSIZE]; // Contains original
                                               // WindowTitle.
    
           // Fetch current window title.
    
           GetConsoleTitle(pszOldWindowTitle, MY_BUFSIZE);
    
           // Format a "unique" NewWindowTitle.
    
           wsprintf(pszNewWindowTitle,"%d/%d",
                       GetTickCount(),
                       GetCurrentProcessId());
    
           // Change current window title.
    
           SetConsoleTitle(pszNewWindowTitle);
    
           // Ensure window title has been updated.
    
           Sleep(40);
    
           // Look for NewWindowTitle.
    
           hwndFound=FindWindow(NULL, pszNewWindowTitle);
    
           // Restore original window title.
    
           SetConsoleTitle(pszOldWindowTitle);
    
           return(hwndFound);
       }
    Re: How can I remove a Window border (title bar etc) using HWND via Win32 after the window has been created? - C / C++ / MFC Discussion Boards - CodeProject


    Obtain a Console Window Handle - Windows Server | Microsoft Docs

    I have never been an Windows GUI Programmer I have no idea how the above works.

    Sorry about me thinking for a while that it was a Dev C++ Setting.

    Tim S.
    "...a computer is a stupid machine with the ability to do incredibly smart things, while computer programmers are smart people with the ability to do incredibly stupid things. They are,in short, a perfect match.." Bill Bryson

  4. #34
    Registered User Paderi's Avatar
    Join Date
    Apr 2020
    Location
    Groningen Netherlands
    Posts
    41
    Hi Tim, thank you for your response. Running this code I get a frame displayed with the title bar that I wanted to get rid of. So I don't know what to do with / interpret this code you sent. Patrick.

  5. #35
    Registered User
    Join Date
    Apr 2021
    Posts
    44
    I think what @OP is asking for is how to get rid of the the title bar of the console window started to run the program.

    And I think the best answer is "you can't do that."

  6. #36
    Registered User Paderi's Avatar
    Join Date
    Apr 2020
    Location
    Groningen Netherlands
    Posts
    41
    Quote Originally Posted by aghast View Post
    I think what @OP is asking for is how to get rid of the the title bar of the console window started to run the program.

    And I think the best answer is "you can't do that."
    Then my question is: how do you overwrite the title bar of the console window, so it diappears?

  7. #37
    Registered User
    Join Date
    Dec 2007
    Posts
    2,676
    Something you can try is using GetWindowLongPtr/SetWindowLongPtr. Those pages both refer to functions with A at the end, but you should use the function without the A on the end, as this will use an alias to choose the proper function call based on the value of the UNICODE #define.

    Here is an example that appears to do exactly what you want: SetWindowLong usage - Programmer Sought (note this code uses SetWindowLong, rather than SetWindowLongPtr; SetWindowLongPtr is the more recent API call, and supports both 32-bit and 64-bit applications. It should otherwise function similarly, with the exception that the return values are LONG_PTR, rather than LONG).

    Caveat: I haven't done any Win32 programming in nearly 20 years, nor C programming in 10, and I did not validate the above link.

  8. #38
    Registered User Paderi's Avatar
    Join Date
    Apr 2020
    Location
    Groningen Netherlands
    Posts
    41
    Thank all of you.


    Last edited by Paderi; 07-22-2021 at 12:39 PM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 0
    Last Post: 10-25-2019, 05:13 AM
  2. Replies: 0
    Last Post: 10-25-2019, 05:13 AM
  3. Tab control: how to calculate a tab display area???
    By SundayDeveloper in forum Windows Programming
    Replies: 4
    Last Post: 09-06-2007, 03:19 PM
  4. Application display area splitter
    By cfriend in forum Windows Programming
    Replies: 2
    Last Post: 09-16-2005, 08:41 AM
  5. Removing the non-client area
    By bennyandthejets in forum Windows Programming
    Replies: 3
    Last Post: 07-22-2003, 06:23 AM

Tags for this Thread