How can i minimize a console app to the tray
I could only find outdated things online i use C# .net 8.0
54 Replies
There's not really anything that won't be a kludge that I'm aware of.
oh ok its just because i wanna hide the console fully
I mean if you want to just hide the console that's easier
yea that will also work
You'll have to do some research here, you'll need to bring some [DllImport]s
I found this https://stackoverflow.com/questions/3571627/show-hide-the-console-window-of-a-c-sharp-console-application
Stack Overflow
Show/Hide the console window of a C# console application
I googled around for information on how to hide one’s own console window. Amazingly, the only solutions I could find were hacky solutions that involved FindWindow() to find the console window by its
yeah that's using some DLLImports
I'm not certain about the other answer, changing to a windows application
That just minimized the window
which the dll import?
The code
Changing to a windows application appears to work fine
Not for me the is exits with code 0
$code
To post C# code type the following:
```cs
// code here
```
Get an example by typing
$codegif
in chat
For longer snippets, use: https://paste.mod.gg/BlazeBin - vcopxspiyefl
A tool for sharing your source code with the world!
here
@<![cdata[🧀]]> ?
did you try to change to a windows application?
ye
I tried locally with a console application, creates a number of problems
Not for me
my main issues was that sigint isn't intercepted at that point
though that's likely fixable
It works fine as a console app
I HATE CHATGPT
I mean I had...
WHAT????
like I said, this breaks some things
how did you even phrase the question?
idk
"idk"?
you can just copy/paste it here
I mean this is starting to sound sus 😦
Because i want to hide a console for an application for my personal use?
no because you got dodgy about what you asked chatgpt
but like I said, setting to a windows application does what you want ¯\_(ツ)_/¯
it just has some consequences
Not for me it just closes with code 0
did you run my code?
idk where to put it
I'd now really like to see what you asked chatgpt
oh, hiding in task manager is a whole other ball of wax
yeah that's a malware thing buddy
and you're in a bad land at that point
the answer is "you can't" and "if you figured out how to, you'd go collect your nice bug bounty check"
it's how root kits work
and ummm
@<![cdata[🧀]]> Where do i put your code
I mean that you're doing some questionable stuff I need to bow out
I just need to have a console app running 24/7 on my pc
there's literally no good reason to hide an application from task manager
hiding it from desktop, sure. minimising to tray, absolutely.
hiding it from the tray and desktop? questionnable.
hiding it from task manager? no.
I need to hide it to the tray works also but its imposible
this is just some crappy malware/joke app.
!ban 1118073170499473431 Now I ain't much of a learn-ed man. Ain't know nothin' 'bout hidin' applications from yer good ol' task manager, no sir. I'm a simple boy, I run my applications in the god-given foreground like ma momma was done tought me. But what I do know is that some some of a gun comes into MY town, asking to do the devil's work of hiding applications in the background - no siree, we don't tolerate that here. No new folks comin' in with good intentions askin' questions like that. Good day to ya sir.
@Nox 🌺 how long did you spend writing that?
give or take 30 seconds.
so does this forum thread need to get deleted @Nox 🌺 @Patrick ?
hwhich
oh
need to?
I like the precedent.
what stare decisis?