❔ how to detect if console app is maximized (IsZoomed)
i don't know how to correctly call IsZoomed in this case, so if anyones willing to help out it'd be really appreciated.
32 Replies
what's IsZoomed
it checks if the console is maximized, i just dont know how to call it
but where's it defined
what API is this?
do you know how to call a method in general?
wdym?
what's the URL to that documentation in your first screenshot?
IsZoomed function (winuser.h) - Win32 apps
Determines whether a window is maximized.
so you're using the Win32 API
this page is documentation for C++, not for C#
do you know how to call a method in C#?
i'm using c#, but uh i sort of do and don't ig
if I give you this class:
can you write code that calls Add?
no.
sounds like you need to learn the basics. you don't even have a foundation in C#, and you're trying to do Win32 API coding 😛
go read a book or go through learning materials like https://dotnet.microsoft.com/en-us/learn/csharp
also, any particular reason you picked Win32 API?
it's the only way i can do what i'm looking to do, anyway can you just answer my question? i'm not asking for a full on book or whatever, or advice, just how i can do what im wanting to do
not to sound rude at all
but i do need to know how to do what i asked
problem is, if you are asking about something so fundamental as how to call a method, then you're probably going to have dozens of other fundamental questions. and it would be a bit troublesome to for the server to have to answer every fundamental question you have when they could all be covered by just taking the time to actually read/watch some learning materials
but to answer this specific question, I will demonstrate it in terms of the Foo class above
to call add you would do
Foo.Add(5, 6);
that is for static methods onlyone of the only reasons i joined this server is for this, and a few other things.
i don't plan to bug anyone after i fix what i need to fix
it's just the core to what i need to do
the server is all for helping but it needs to be reasonable
like there needs to be some amount of reasonable effort on your part
listen.
i don't need advice, i did not ask for anything of this sorts.
i just need an answer of how i can do what i need to do.
I did not ask for your question, but you asked it anyway
not-asking for something doesn't mean you won't get it though
and this isn't advice, this is push-back
criticism
true but i wasn't asking specifically you to help me, i did not ask for YOUR specific help
And to comeback your statement, by you NOT helping me I'll just ask plenty others. @Rotaerk
Which is going against you not wanting me to ask people for help constantly
asking for help is fine. but when the answer is "read this", refusing is not reasonable on your part
you are asking to be spoonfed
Listen, I don't want to be rude, but if you aren't willing to help with what i asked for, please leave the thread.
if you are going to be like this, please leave the server...
I don't appreciate what your doing and if you continue, it's just a waste of your own time.
That api you showed needs a window handle and console apps, by definition, don't have window handles.
problem is, i've seen it done before.
i just don't know how.
this may not be as simple as you may think
why do you need this?
You need to get the console host's HWND first
Stack Overflow
How do I get the handle of a console application's window
Can someone tell me how to get the handle of a Windows console application in C#? In a Windows Forms application, I would normally try this.Handle.
Then you call IsZoomed
Alternatively, you can call GetWindowPlacement and compare the returned WINDOWPLACEMENT's showCmd field against SW_MAXIMIZE
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.