Click here to Skip to main content
15,898,035 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Statusbar icon Pin
Tomasz Sowinski31-Jul-01 4:16
Tomasz Sowinski31-Jul-01 4:16 
GeneralRe: Statusbar icon Pin
31-Jul-01 4:56
suss31-Jul-01 4:56 
GeneralRe: Statusbar icon Pin
Tomasz Sowinski31-Jul-01 5:04
Tomasz Sowinski31-Jul-01 5:04 
GeneralRe: Statusbar icon Pin
31-Jul-01 22:22
suss31-Jul-01 22:22 
GeneralRe: Statusbar icon Pin
Tomasz Sowinski1-Aug-01 2:34
Tomasz Sowinski1-Aug-01 2:34 
GeneralRe: Statusbar icon Pin
1-Aug-01 3:39
suss1-Aug-01 3:39 
GeneralRe: Statusbar icon Pin
Tomasz Sowinski1-Aug-01 5:51
Tomasz Sowinski1-Aug-01 5:51 
GeneralRe: Statusbar icon Pin
1-Aug-01 20:41
suss1-Aug-01 20:41 
If I call MAKEINTRESOURCE(101), i get a yellow warining triangle. Numbers 100-105 shows Icons, the others that I have tryed are empty.

My own Icon is defined in the resource.h
#define IDI_ICON1 101

In the .rc file the icon is defined like this:
IDI_ICON1 ICON DISCARDABLE "MyIcon.ico"

But if I make the call

LoadIcon(g_hInstance, MAKEINTRESOURCE(IDI_ICON1) )

an empty space will show.
I have tryed to change the define to some other number and call that number with MAKEINTRESOURCE. That also creates empty space.

The cpp file:

/*--------------------------------------------------*/
#include <stdio.h>
#include <windows.h>
//#include <commctrl.h>
#include <shellapi.h>
#include <winuser.h>
#include "resource.h"
//#import "Comctl32.dll"

//#define IDI_ICON1 1

#define WM_TRAYMESSAGE WM_USER

HINSTANCE g_hInstance;

static VOID ShowNotifyIcon(HWND hWnd,BOOL bAdd)
{
NOTIFYICONDATA nid;
ZeroMemory(&nid,sizeof(nid));
nid.cbSize=sizeof(NOTIFYICONDATA);
nid.hWnd= NULL;
nid.uID=0;
nid.uFlags=NIF_ICON | NIF_MESSAGE | NIF_TIP;
nid.uCallbackMessage=NULL;
nid.hIcon =LoadIcon(g_hInstance, MAKEINTRESOURCE(101) );
lstrcpy(nid.szTip,TEXT("Dryer is active"));

if(bAdd)
Shell_NotifyIcon(NIM_ADD,&nid);
else
Shell_NotifyIcon(NIM_DELETE,&nid);
}

void main(void)
{
ShowNotifyIcon(NULL,1);
Sleep(3000);
ShowNotifyIcon(NULL,0);
}

/*----------------------------------------------------------*/

resource.h:

/*----------------------------------------------------------*/
//{{NO_DEPENDENCIES}}
// Microsoft Developer Studio generated include file.
// Used by Icon1.rc
//
#define IDI_ICON1 101

// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 102
#define _APS_NEXT_COMMAND_VALUE 40001
#define _APS_NEXT_CONTROL_VALUE 1000
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif

/*----------------------------------------------------*/

The project is a console application in VC++ 6
GeneralCxShadeButton Pin
Annette31-Jul-01 4:07
Annette31-Jul-01 4:07 
GeneralResizing Property Pages Pin
Derek Lakin31-Jul-01 3:18
Derek Lakin31-Jul-01 3:18 
GeneralRe: Resizing Property Pages Pin
Tomasz Sowinski31-Jul-01 3:31
Tomasz Sowinski31-Jul-01 3:31 
Question_cpp_max? Pin
Gérald Mercet31-Jul-01 3:12
Gérald Mercet31-Jul-01 3:12 
GeneralQuery ... Pin
Hadi Rezaee31-Jul-01 2:35
Hadi Rezaee31-Jul-01 2:35 
GeneralRe: Query ... Pin
31-Jul-01 2:58
suss31-Jul-01 2:58 
GeneralFile I/O using MFC Pin
Peter Liddle31-Jul-01 1:51
Peter Liddle31-Jul-01 1:51 
GeneralRe: File I/O using MFC Pin
#realJSOP31-Jul-01 1:54
professional#realJSOP31-Jul-01 1:54 
GeneralActive X installation Pin
31-Jul-01 1:20
suss31-Jul-01 1:20 
GeneralRe: Active X installation Pin
Derek Waters31-Jul-01 14:42
Derek Waters31-Jul-01 14:42 
GeneralTab control breakdown Pin
31-Jul-01 1:01
suss31-Jul-01 1:01 
GeneralRe: Tab control breakdown Pin
Tomasz Sowinski31-Jul-01 2:49
Tomasz Sowinski31-Jul-01 2:49 
GeneralDCOM Access Denied problem Pin
yamini31-Jul-01 0:28
yamini31-Jul-01 0:28 
GeneralDCOM Access Denied problem Pin
yamini31-Jul-01 0:28
yamini31-Jul-01 0:28 
GeneralBSC File format Pin
Franz Klein30-Jul-01 23:54
Franz Klein30-Jul-01 23:54 
GeneralCToolTipCtrl & Baloon Style Pin
AJ12330-Jul-01 23:13
AJ12330-Jul-01 23:13 
GeneralRe: CToolTipCtrl & Baloon Style Pin
30-Jul-01 23:32
suss30-Jul-01 23:32 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.