Hi all, I need a sample win32api code for putting a icon in the system tray.
And one more, sample code for startup application with system, i know this going via registry, but don't know exactly.
Printable View
Hi all, I need a sample win32api code for putting a icon in the system tray.
And one more, sample code for startup application with system, i know this going via registry, but don't know exactly.
This should help.
Thanks man, this is what needed ;-)
Just left a start of my application with system startup, sample code too, it is best way.
That's terrible code...Quote:
Originally Posted by jverkoey
Not only did i spend 15 minutes getting header files, and placing them in my folders. Only to find out the header files themselves don't work either, just errors everywhere. I've included everything, and no libraries were mentioned to link to.
Please post code and then explain what they do.... what to link.... and what libraries are needed. This code requires specstring.h, safestr.h, and safestr.h just gives error after error.
I'm either missing a library or this was coded by someone who wasn't thinking about ming compiler.
You're right, I wasn't thinking about the ming compiler. I use a real windows compiler for making windows-specific apps.Quote:
Originally Posted by execute
Also, if you want the source of this information, I shelled the code from a C++ class here: http://www.codeproject.com/shell/system_tray.asp
So enjoy using that code if you like.
Code:// Required for balloon text information.
#define _WIN32_IE 0x0600
#include <windows.h>
#include <string.h>
#include <stdio.h>
#include <commctrl.h>
#include <shellapi.h>
#include <richedit.h>
#include <wininet.h>
#include <time.h>
#include "resource.h"
// Taskbar Icon include. This is located in a library directory
// of code. Feel free to move TaskBarIcons.h/.cpp to this
// folder and change the relative path to include it easier.
#include <TaskBarIcons.h>
#include <strsafe.h>
#include <shellapi.h>
//////////////////////////////////////////////////////////////////
///////////////////////// LIBRARIES //////////////////////////////
//////////////////////////////////////////////////////////////////
#pragma comment(lib, "comctl32.lib")
#pragma comment(lib, "shell32.lib")
#pragma comment(lib, "winInet.lib")
#pragma comment(lib, "comctl32.lib")
//////////////////////////////////////////////////////////////////
//////////////////////// DEFINITIONS /////////////////////////////
//////////////////////////////////////////////////////////////////
#define ICONID 0
Thanks jverkoey I was actually messing around with tray icons too, this helped out a bit.
Ok First code was allright, I because he cotainded a basic example functions of creating system tray icons, I just needed that, some to pushme from starting point of that problem.
But I steel don't have a startup code .
Ok, but registry is much better solution.Quote:
Originally Posted by anonytmouse
I have one problem with system tray icon, I can't use a szInfo in NOTIFYICONDATA struct, when I use that I got error ('szInfo' is not a member of 'NOTIFYICONDATA'.
So this problem is only with szInfo and szInfoTitle, but with others members I haven't a problem.
I using MSVS 2003.NET