Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

system tray win32

Name: Anonymous 2009-12-19 8:03

Ok you guys I'm a first time poster so be gentle (also I'm not sure how you react to people asking for help)  I'm trying to write a win32 application in C and I'm trying to get it the application to minimize to the system tray.

I looked up some on line tutorials and it seemed simple enough.  Simply add the icon to the system tray then hide the window, unfortunately when I hide the window the icon disappears too.  I'm finding it hard to isolate the issue with my code, has anyone here successfully made a system tray icon using the windows api?

Name: Anonymous 2009-12-19 8:13

Now you have two problems.

Name: Anonymous 2009-12-19 8:15

not anymore

Name: Anonymous 2009-12-19 8:19

yes

Name: Anonymous 2009-12-19 8:26

Now you have NULL problems.

Name: Anonymous 2009-12-19 8:30

>>5
sage really doesn't do anything.  You might as well not waste your time posting.

Name: Anonymous 2009-12-19 8:42

>>6
Why can't people understand that it does

Name: Anonymous 2009-12-19 8:48

>>7
all it does is add a post but it doesn't bump the thread.  Effectively nothing rather then something.  That something would be bumping the thread.

Name: Anonymous 2009-12-19 8:53

>>8
It does show that the poster doesn't like the thread.

Name: Anonymous 2009-12-19 8:55

>>9
oh gees, god forbid that someone doesn't like what I post on the internet.

Name: Anonymous 2009-12-19 9:23

Actually it's not that I don't like the thread, it's just that a) I don't have anything of real value to add, and I want to be discreet or b) bumping it might make more important/interesting threads less visible.

Sage is a complex matter.

Name: Anonymous 2009-12-19 9:23

>>9
Nonsense. That broken mentality only applies to imageboards. In these parts sage is a good thing.

Personally I sage all the time because I don't have anything meaningful to contribute to any discussion.

Name: Anonymous 2009-12-19 9:26

>>11,12
So sage derives from self-esteem issues?

Name: Anonymous 2009-12-19 9:28

>>11
>>12
oh fair enough you elitist text board frequenters.  Although I managed to find a solution.  The trick is if you're going to try and catch the close window message, make sure you don't accidentally call the default windows procedure.  Simple as that.  (can't believe it tripped me up for so long)

Name: Anonymous 2009-12-19 12:51

>>14
Speaking of sage, you solved your problem, so you really should use sage because there is no point in bumping the thread now that your question is answered.

Name: Anonymous 2009-12-19 13:59

I did this with Delphi a few days ago (calling the Windows C API directly, there was no pre-made component that I could see). It worked the first time with no problems. Also I did other "complicated" stuff which is usually a nightmare to do, had no problems at all (I had to debug one segmentation fault in a foreign DLL, took 5 minutes, but I could have just ignored it and hoped for the best since in Delphi that just raises an exception, even if said DLL was written in C and compiled with MSVC). The resulting executable was under 200K in size, has no additional dependencies, works in any Windows version from 95 to 7, and starts up instantly.

Maybe you're just doing things in a really shitty way with really shitty tools.

BTW Delphi was much, much better than .NET has ever managed to be. It's a bit sad but as usual with Microsoft the only thing they manage to do is crappy copies that completely miss the subtle but critical good points of the original. Guess money can't buy you talent after all (even if you buyout the critical people).

Name: Anonymous 2009-12-19 14:00

I'm guessing that you are not actually hiding the window, but destroying it. You probably also quit the program when the main window is destroyed just like in all those tutorials.

Name: Anonymous 2009-12-19 14:03

Used 8mb of Qt libraries and save yourself some time.

Name: Anonymous 2009-12-19 14:17

>>16
Just curious as I've never used Delphi, can you describe some of those critical good points?

Name: Anonymous 2009-12-19 14:21

>>16
Implying 200KB is small
I wrote a Windows IRC client in 10KB.

Name: Anonymous 2009-12-19 14:24

>>20
Implying 10KB is small
I wrote a GUI IP tracker in 62 bytes (exploiting my lossless 2% compression algorithm).

Name: Anonymous 2009-12-19 14:34

>>20-22
Fuck off with that impyling bullshit

Name: Anonymous 2009-12-19 14:50

>>22
impyling
Also, /v/ is broken so it's only natural.

Name: Anonymous 2009-12-19 14:56

>>23
No it isn't.

Name: Anonymous 2009-12-19 14:59

>>24
Yes it is.

Name: Anonymous 2009-12-19 15:09

>>19
It's just everything that's good about, say, C# .NET (safe language, awesome visual GUI designer, easy as fuck, hides Win32 cancer), without all the bullshit (no .NET, generates real native code, you can use pointers and inline asm, interaction with other native stuff is completely seamless, and it lets you go down all you want if you desire (for example process window messages manually, so you can override WM_PAINT on any component and draw it yourself, and this takes a single declaration without messing with the message loop - not sure how this is done in .NET but I guess at the very least it's forcefully very abstracted, if it even uses native controls at all)), a better IDE (I don't know which one is more powerful, but Delphi's sure feels a lot more pleasurable to me - also it's written in Delphi itself), and a compiler so fast that it really makes you wonder what the fuck went wrong when using anything else except maybe tcc. Retro-compatibility between releases it also godlike, I used some code from 1995 and it worked with zero warnings (it was far from trivial code too, I was scared until I tried).

In short, is extremely powerful, very easy and working with it is orgasmic, and it doesn't fuck neither the developer nor the user forcing them to install inane runtime/framework bullshite.

200KB might seem a lot for you, in that case you can optionally install a shared DLL (which is around 5MB IIRC) and then you can link to it to shrink your programs/DLLs to ~4K when empty (and still have the awesome library).

It's a shame it's not in the best state nowadays, but it's still used for plenty of very popular applications (from the top of my head Skype, Teamspeak and Spybot-S&D are sure written in it - not the kind of apps /prog/ would like but then again /prog/ wouldn't like most .NET apps either).

PS.: In case you didn't know MS hired the lead language designer which then went on to design C#. They also hired other key people, most of which have left MS already.

Name: Anonymous 2009-12-19 15:09

>>25
Please explain your reasoning

Name: Anonymous 2009-12-19 15:28

>>26
With all the parentheses in your post, maybe you should give up MS languages and pick up scheme.

Name: Anonymous 2009-12-19 15:34

>>26
Oh, that's interesting.

not sure how this is done in .NET but I guess at the very least it's forcefully very abstracted
I'm not sure if you mean what I think you mean, but you can override OnPaint and whatnot on your own controls.

Name: Anonymous 2009-12-19 15:43

>>28
I can already tell my writing kind of sucks, no need to point it explicitly.

>>29
Yes, I mean that. I kind of screwed up mentioning .NET - it's obvious .NET offers a way to custom paint things - what I meant to say it that it's really generating a "real" Win32 application under the hood, and while normally you wouldn't even know what a "window message" is, if you need to, you can handle them yourself. Or, to put it into another words, if you're a hardcore Win32 programmer you could override everything and write it as you would in C. This lets you use any native feature/API, even those introduced after the corresponding Delphi release, or those that aren't directly exposed. I think the source code for the VLC (Visual Component Library) is included too.

Name: Anonymous 2009-12-19 15:44

>>27
I thought that your post "Yes, it is." was pertaining to the "natural" bit, not the "broken" bit.

Name: Anonymous 2009-12-19 16:01

>>28
W-(

Name: Anonymous 2009-12-19 19:20

>>1
Apologies about people mocking you. This very concern was addressed around page 231 of this book: http://mitpress.mit.edu/sicp/ - this is the online version so you'll have to look around to find the page, you can probably guesstimate from the TOC.

Name: Anonymous 2009-12-19 19:27

Look at the source http://rbtray.sourceforge.net/ - this program is pretty simple so you might find answers there

Name: Anonymous 2009-12-21 16:36

There's no such thing as a system tray on any released version of Microsoft® Windows™.¹

¹http://blogs.msdn.com/oldnewthing/archive/2003/09/10/54831.aspx

Name: Anonymous 2010-12-26 2:40

Don't change these.
Name: Email:
Entire Thread Thread List