Thread: Getting rid of the standard red close(x) button in a Windows application

  1. #16
    Registered User Paderi's Avatar
    Join Date
    Apr 2020
    Posts
    68
    Yes, I should have done that. "To date, you've posted ZERO code and ONE error message." Yes? I always try and sort things out myself, before bothering other people. And when I do, I do not expect to be called a "looser". I do not whine, I do not bleat, I speak four languages, have several university degrees, one of them ad summos honores. When I decently ask a question I like the answer to be equally decent. And if I get a snotty answer, I will say so.

  2. #17
    Registered User
    Join Date
    Feb 2022
    Posts
    45
    Please, let us all step back a moment and take a deep breath before digging ourselves any deeper.

    Assuming you were able to bring the Log/Compile sub-window up in the manner described above, were you able to see the compiler output? If not, could you post a screenshot, so we could see just what is happening? We don't normally request screenshots here, but this instance may require one.

  3. #18
    Registered User Paderi's Avatar
    Join Date
    Apr 2020
    Posts
    68
    Thank youSchol-R-LEA-2 I triedto include a screenshot of the compiler message, but the forum system disallows it.

    "hwnd was not declared in this scope" seems to be the essence of it all. Further comment was "no target" and "no project". I have an idea how I caused that that comment. (Not using CodeBlocks how I should - I suppose.)
    Attached Images Attached Images Getting rid of the standard red close(x) button in a Windows application-data-foor-response-png 
    Last edited by Paderi; 03-10-2022 at 08:50 AM.

  4. #19
    Registered User
    Join Date
    May 2012
    Location
    Arizona, USA
    Posts
    958
    Solution: declare 'hwnd' and assign to it the handle of the window you want to modify. Only you have the source code so only you know what window you want to remove the close button from.

  5. #20
    Registered User Paderi's Avatar
    Join Date
    Apr 2020
    Posts
    68

    EnableMenuItem problem

    Following code:

    EnableMenuItem(GetSystemMenu(hwnd, FALSE), SC_CLOSE, MF_BYCOMMAND | MF_DISABLED);

    Produces this error:

    'hwnd'was not declared in this scope

    Can someone please help to solve this error?

  6. #21
    Registered User
    Join Date
    Dec 2017
    Posts
    1,664
    LOL! Did I call it or did I call it? Post 20. Zero progress.
    All truths are half-truths. - A.N. Whitehead

  7. #22
    Registered User
    Join Date
    May 2012
    Location
    Arizona, USA
    Posts
    958
    Quote Originally Posted by Paderi View Post
    When I decently ask a question I like the answer to be equally decent.
    I don't know exactly what you mean by "decent", but the answers you've been given have already exceeded the effort that you've shown to solving it or doing anything with what you've been given.

    Quote Originally Posted by Paderi View Post
    I speak four languages, have several university degrees, one of them ad summos honores.
    I believe this is a logical fallacy known as "appeal to accomplishment". What relevance do your accomplishments have in this situation? You haven't shown any effort to learn C or the Windows API. You haven't shown any of your code or any context that could help us with your problem. All I've seen so far is repeating the same issue in #20 that you posted in #6 and again in #18 with no effort on your part to do anything with the intervening answers/suggestions given. These are signs of a Help Vampire:

    • Does he ask the same, tired questions others ask (at a rate of once or more per minute)?
    • Does he clearly lack the ability or inclination to ask the almighty Google?
    • Does he refuse to take the time to ask coherent, specific questions?
    • Does he think helping him must be the high point of your day?
    • Does he get offensive, as if you need to prove to him why he should use Ruby on Rails?
    • Is he obviously just waiting for some poor, well-intentioned person to do all his thinking for him?
    • Can you tell he really isn’t interested in having his question answered, so much as getting someone else to do his work?
    If you want to avoid being a Help Vampire, read (and absorb) How To Ask Questions The Smart Way.

  8. #23
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,675
    No code in 3 days.
    Stick a fork in it, it's done.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 11
    Last Post: 06-23-2015, 02:50 AM
  2. Disabling close button
    By dissidia in forum C Programming
    Replies: 9
    Last Post: 12-09-2009, 11:25 AM
  3. how to disable the application close button?
    By e66n06 in forum Windows Programming
    Replies: 8
    Last Post: 01-05-2008, 11:33 AM
  4. Can't turn off a console close button
    By Xzyx987X in forum Windows Programming
    Replies: 9
    Last Post: 03-26-2004, 02:23 AM
  5. Minimize, Maximize and Close button
    By Alextrons in forum Windows Programming
    Replies: 2
    Last Post: 01-10-2002, 10:04 PM

Tags for this Thread