|
This will do...
Override WindowProc in CMainFrame class...
Add this to MainFrame.h
LRESULT WindowProc(UINT message, WPARAM wParam, LPARAM lParam);
Add this to MainFrame.cpp
LRESULT CMainFrame::WindowProc(UINT message, WPARAM wParam, LPARAM lParam)
{
if(message == WM_SYSCOMMAND && wParam == SC_CLOSE)
{
MessageBox("Closing application");
}
<font color=blue>return</font> CMDIFrameWnd::WindowProc(message, wParam, lParam);
}
Nibu thomas
Software Developer
|
|
|
|
|
Hi Nibu & Khan,
Now also, the result is same. Control is not coming to "CMainFrame::WindowProc(..)"
Sarvan AL
|
|
|
|
|
I did test it. It's working here!
Nibu thomas
Software Developer
|
|
|
|
|
Exactly which frame window are you trying to handle the message for? Do you mean CChildFrame or CMainFrame ? because both the solutions work (WindowProc and WM_CLOSE ).
this is this.
|
|
|
|
|
Hi Nibu & Khan,
I am able to trap the close event by overriding the document class member function, "BOOL SaveModified()".
Now I got the expected results.
Thanks a Lot to spend your precious time for me.
Sarvan AL
-- modified at 7:04 Monday 3rd April, 2006
|
|
|
|
|
Sarvan AL wrote: How should I handle this?
Handle what? If the document has indeed been modified, why would you not want the "save document yes / no" message when the X is clicked?
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
Hi all,
Pls help me to see all of my questions and their corresponding replies.
Thanks in advance,
Sarvan AL
|
|
|
|
|
|
|
Hi,
I have to develop an Audio Player with most of functionality in it.
How to Play Audio Files in VC6?
I think, it can be done by use of DirectX in VC.
But is there any other option for it?
|
|
|
|
|
Aniket Salunkhe wrote: How to Play Audio Files in VC6?
I think, it can be done by use of DirectX in VC.
But is there any other option for it?
Media Control Interface(MCI) is an option.
Nibu thomas
Software Developer
|
|
|
|
|
|
DirectX can play a lot of audio with different settings, though there are many alternatives. For a simple player you could use the simple 'MultiMedia interface' of windows. Search for winMM. Another alternative is to use media library. These are addons which people have coded and deal with all types of media making life easier.
Try here[^] and here[^]
|
|
|
|
|
Thanks for ur help.
But can i get full details of any audio file (wav, mp3, etc..) before playing it. Details like play-time of audio file, bit-rate,title, artist,etc. & Full control on that audio file so that ican play it from any position of Track.
Aniket
|
|
|
|
|
Aniket Salunkhe wrote: How to Play Audio Files in VC6?
One of the simplest ways is by using sndPlaySound() .
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
Hi,
Using sndPlaySound() i can play a '*.wav' file & it can play '*.mp3'. I want to play most of audio files.
Aniket
|
|
|
|
|
Aniket Salunkhe wrote: I want to play most of audio files.
It helps to be specific.
If you want to use the default audio player, just use ShellExecute() . If you are not against ActiveX controls, use Microsoft's Multimedia control (mci32.ocx). It can be controlled programmatically.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
this may be another dumb question, but i'm sure VC++ CPians are pretty good to answer this.
i've made a dialogBox using MFC 7.1 with several buttons with no text (icon buttons) and i'd like the button to display a tooltip when the mouse hovers them...
any tips ??
|
|
|
|
|
v2.0 wrote: i've made a dialogBox using MFC 7.1 with several buttons with no text (icon buttons) and i'd like the button to display a tooltip when the mouse hovers them...
This[^] should help.
Nibu thomas
Software Developer
|
|
|
|
|
i'll try to do it, but the solution explained is not clear...
thanks anyway
|
|
|
|
|
v2.0 wrote: but the solution explained is not clear...
What is not clear?
Nibu thomas
Software Developer
|
|
|
|
|
where to put what code...
|
|
|
|
|
v2.0 wrote: where to put what code...
1. Add a member variable in YourDlg.h --> <code>CToolTipCtrl m_ttc</code>;
2. Inside <code>OnInitDialog </code>create your tooltip and tell the tooltip
what are the controls that require a tooltip...
For Eg:
<code>m_ttc.Create(this);
EnableToolTips(true);
m_ttc.AddTool(GetDlgItem(IDC_ABUTTON),_T("A tooltip"));
m_ttc.Activate(true);</code>
3. Override <code>PreTranslateMessage </code>and relay the <code>WM_MOUSEMOVE</code> event to the
tooltip control. For eg:
<code>BOOL CYourDlg::PreTranslateMessage(MSG *pMsg)
{
if(pMsg->message == WM_MOUSEMOVE)
m_ttc.RelayEvent(pMsg);
return CDialog::PreTranslateMessage();
}</code>
This is required coz we must tell the tooltip where the mouse pointer is
and the tooltip control then decides whether the pointer is within the
bounds of a control registered with it.
Hope this should suffice!
Nibu thomas
Software Developer
|
|
|
|
|
|
i don't have a toolbar, only single buttons...
|
|
|
|