Author Topic: Can someone make a program that maximizes CMD and disables the maximize button?  (Read 7166 times)

Offline Coding Prodigy

  • Single posting newcomer
  • *
  • Posts: 4
Okay, do I made a really cool and advanced batch file with over 3,000 lines of code. So far, I made it have a title sequence with sound that termporarily pauses Windows Media Player, and a part that checks for updated versions. Now when I start it, there is a big windows logo made of 0's and 1's, but it's too big to fit in a normal window. Can someone please make me a code in C++ that maximizes it and then disables the maximize button on the window and menu? (ONLY THAT WINDOW; NOT THE OTHERS) I have a Windows Vista 32-bit. The title of the window is Title Sequence. The window class is "ConsoleWindowClass"

Help would be greately appreciated, Coding Prodigy.
maximize button of that i
« Last Edit: February 19, 2013, 11:32:10 pm by Coding Prodigy »

Offline Ceniza

  • Developer
  • Lives here!
  • *****
  • Posts: 1441
    • CenizaSOFT
May I ask how that is related to Code::Blocks? It looks like a WINAPI question to me.

Offline Coding Prodigy

  • Single posting newcomer
  • *
  • Posts: 4
It is related to code blocks because I almost made that one that worked in this program! The only issue was that it only worked when the window was in it's normal state. I needed it to be maximized, and then disable the maximize button. Here's the non-working code:

#include <iostream>
 #include <Windows.h>

int main()
 {

HWND hwnd = FindWindowA("ConsoleWindowClass", "Title Sequence");// replace Title Sequence with the name of whatever window you want to target. You could also target by class name, the first param
 RemoveMenu(GetSystemMenu(hwnd, FALSE), SC_MAXIMIZE, MF_GRAYED);
std::cin.get();
 return 0;
 }

Offline Ceniza

  • Developer
  • Lives here!
  • *****
  • Posts: 1441
    • CenizaSOFT
I still don't see how it is related to Code::Blocks. Code::Blocks is just an IDE, not a compiler. We do not provide support for general programming questions, and that includes the use of APIs (like WINAPI) other than Code::Blocks' SDK (which you would use to extend the IDE through plugins).

I suggest you to ask that kind of question in a place like StackOverflow. I also suggest you to read the forum rules, as you are clearly violating them.

Offline Coding Prodigy

  • Single posting newcomer
  • *
  • Posts: 4
Oh! Okay. Sorry about that! I'm kinda new with this . . .  ;D :-[