Solved

How to make a CALLBACK Function ???

Posted on 2000-03-09
4
269 Views
Last Modified: 2008-02-01
I have made a function that shows an Icon in the taskbar of windows98, and in that funtion I've told windows to make a callback message by using NOTIFYICONDATA structure.
My question now is, how do I make a funtion in my c++builder 5 that recieves the message from windows, when my mouse click's on the icon ???
I have read, that I should make a callback function, but I don't know how to do that. The function that I want to receive the windows message is called:
void On_MYWM_NOTIFYICON(WPARAM wParam, LPARAM lParam)
so I hope you know what is missing ???
0
Comment
Question by:RO
  • 2
4 Comments
 
LVL 8

Accepted Solution

by:
gelbert earned 50 total points
Comment Utility
h

class CMainFrame : public CFrameWnd
{
DECLARE_DYNAMIC(CMainFrame)  
//{{AFX_MSG(CMainFrame)
....
afx_msg LRESULT OnTrayNotification(WPARAM wp, LPARAM lp);  
....
//}}AFX_MSG  
DECLARE_MESSAGE_MAP()};

..cpp

BEGIN_MESSAGE_MAP(CMainFrame, CFrameWnd)  
//{{AFX_MSG_MAP(CMainFrame)  
....
ON_MESSAGE(WM_MY_TRAY_NOTIFICATION, OnTrayNotification)  
....
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
0
 
LVL 5

Expert Comment

by:Wyn
Comment Utility
c++builder 5 !!!
0
 
LVL 8

Expert Comment

by:gelbert
Comment Utility
Use in .h
LRESULT CALLBACK OnTrayNotification(WPARAM wp, LPARAM lp);
Use in .cpp
LRESULT CALLBACK OnTrayNotification(WPARAM wp, LPARAM lp)
{
   return (long)0;
}
0
 

Author Comment

by:RO
Comment Utility
I'm sorry that I distorbed you, but your answer wasn't what I was looking for. I've solved my problem by using something called message map in borland c++ builder 5.
Thanks anyway for traying to help!!!
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Article by: SunnyDark
This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
Written by John Humphreys C++ Threading and the POSIX Library This article will cover the basic information that you need to know in order to make use of the POSIX threading library available for C and C++ on UNIX and most Linux systems.   [s…
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

7 Experts available now in Live!

Get 1:1 Help Now