Solved

How to make a CALLBACK Function ???

Posted on 2000-03-09
4
272 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
ID: 2601861
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
ID: 2601935
c++builder 5 !!!
0
 
LVL 8

Expert Comment

by:gelbert
ID: 2602031
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
ID: 2612444
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

Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Errors will happen. It is a fact of life for the programmer. How and when errors are detected have a great impact on quality and cost of a product. It is better to detect errors at compile time, when possible and practical. Errors that make their wa…
This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

778 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