Code Newbie
News     Forums     Search     Members     Sign Up    

My Code Newbie
Username

Password

Articles/Snippets
ASP Classic
ASP.NET
C
C#
C++
HTML / CSS
Java
Javascript
Linux / BSD
Perl
PHP
Python
Ruby
SQL
VB 6
VB.NET

C.N. Friends
  Planet Rome

Link to Us!
Code Newbie
  Code Newbie
    forums
Old 02-27-2006, 08:16 PM   #1 (permalink)
DJMaze
Senior Contributor
 
DJMaze's Avatar
 
Join Date: Mar 2005
Posts: 672
DJMaze is on a distinguished road
shell32.dll + code:blocks + mingw howto?

while starting to use Code::Blocks and FLTK with the mingw compiler, i've noticed there's no library for shell32.dll functions.
Since i've always used MSVC and BCB i have no clue what to do now.

I am writing my own .h and .cxx file to call the Shell_NotifyIconA and Shell_NotifyIconW functions which reside in the shellapi.

Code:
#ifndef _NOTIFYICON_H
#define _NOTIFYICON_H

//#include <shellapi.h>

extern "C" {
#ifndef WINSHELLAPI
	#define WINSHELLAPI DECLSPEC_IMPORT
#endif

#define NIM_ADD         0x00000000
#define NIM_MODIFY      0x00000001
#define NIM_DELETE      0x00000002

#define NIM_SETFOCUS    0x00000003
#define NIM_SETVERSION  0x00000004
#define NOTIFYICON_VERSION 3

#define NIF_MESSAGE     0x00000001
#define NIF_ICON        0x00000002
#define NIF_TIP         0x00000004
#define NIF_STATE       0x00000008
#define NIF_INFO        0x00000010

#define NIS_HIDDEN      0x00000001
#define NIS_SHAREDICON  0x00000002

// Notify Icon Infotip flags
#define NIIF_NONE       0x00000000
#define NIIF_INFO       0x00000001
#define NIIF_WARNING    0x00000002
#define NIIF_ERROR      0x00000003

typedef struct _TRAYICONDATAA {
	DWORD cbSize;
	HWND  hWnd;
	UINT  uID;
	UINT  uFlags;
	UINT  uCallbackMessage;
	HICON hIcon;
#if (_WIN32_IE < 0x0500)
	char *szTip[64];
#else
	char *szTip[128];
	DWORD dwState;
	DWORD dwStateMask;
	char *szInfo[256];
	union {
		UINT uTimeout;
		UINT uVersion;
	} DUMMYUNIONNAME;
	char *szInfoTitle[64];
	DWORD dwInfoFlags;
#if (_WIN32_IE >= 0x600)
	GUID guidItem;
#endif /* _WIN32_IE >= 0x600 */
#endif /* _WIN32_IE < 0x0500 */
} TRAYICONDATAA, *PTRAYICONDATAA;

typedef struct _TRAYICONDATAW {
	DWORD    cbSize;
	HWND     hWnd;
	UINT     uID;
	UINT     uFlags;
	UINT     uCallbackMessage;
	HICON    hIcon;
#if (_WIN32_IE < 0x0500)
	wchar_t *szTip[64];
#else
	wchar_t *szTip[128];
	DWORD    dwState;
	DWORD    dwStateMask;
	wchar_t *szInfo[256];
	union {
		UINT uTimeout;
		UINT uVersion;
	} DUMMYUNIONNAME;
	wchar_t *szInfoTitle[64];
	DWORD    dwInfoFlags;
#if (_WIN32_IE >= 0x600)
	GUID guidItem;
#endif /* _WIN32_IE >= 0x600 */
#endif /* _WIN32_IE < 0x0500 */
} TRAYICONDATA, TRAYICONDATAW, *PTRAYICONDATAW;


// Function pointer declarations
typedef BOOL (WINAPI *pfShell_NotifyIcon)(DWORD dwMessage, PTRAYICONDATAW lpData);

extern pfShell_NotifyIcon __Shell_NotifyIcon;

} /* extern "C" */

#endif /* _NOTIFYICON_H */
is the following correct?
Code:
typedef BOOL (WINAPI *pfShell_NotifyIcon)(DWORD dwMessage, PTRAYICONDATAW lpData);
Since MSDN defines it as
Code:
WINSHELLAPI BOOL WINAPI Shell_NotifyIconW(DWORD dwMessage, PTRAYICONDATAW lpData);
And now should i build a .lib for shell32.dll and include it somehow?
DJMaze is offline   Reply With Quote
Old 02-28-2006, 07:12 AM   #2 (permalink)
DJMaze
Senior Contributor
 
DJMaze's Avatar
 
Join Date: Mar 2005
Posts: 672
DJMaze is on a distinguished road
nvm found the mingw w32api
DJMaze is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help compiling GSL with MinGW rhzehr Platform/API C++ 0 04-24-2005 07:11 PM
Functions available using MinGW.... Surveyor Standard C, C++ 2 04-05-2005 05:52 AM


All times are GMT -8. The time now is 09:07 PM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0 RC8





Copyright © 2000-2008, Milano Interactive
Web Hosting provided by Portal 360 Web Hosting