Solved

How to make a CALLBACK Function ???

Posted on 2000-03-09
4
270 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Implementing a ResolveEventHandler in C++ 13 115
Move constructor only called if marked noexcept? 6 98
Best book to learn C++ 4 70
c++ syntax question 9 44
In days of old, returning something by value from a function in C++ was necessarily avoided because it would, invariably, involve one or even two copies of the object being created and potentially costly calls to a copy-constructor and destructor. A…
Templates For Beginners Or How To Encourage The Compiler To Work For You Introduction This tutorial is targeted at the reader who is, perhaps, familiar with the basics of C++ but would prefer a little slower introduction to the more ad…
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 be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

910 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

24 Experts available now in Live!

Get 1:1 Help Now