Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

How to make a CALLBACK Function ???

Posted on 2000-03-09
4
Medium Priority
?
287 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 100 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

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

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

Often, when implementing a feature, you won't know how certain events should be handled at the point where they occur and you'd rather defer to the user of your function or class. For example, a XML parser will extract a tag from the source code, wh…
  Included as part of the C++ Standard Template Library (STL) is a collection of generic containers. Each of these containers serves a different purpose and has different pros and cons. It is often difficult to decide which container to use and …
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.
Suggested Courses

916 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