|
Hitting the ESC key calls CDialog::OnCancel() which closes the dialog. You just have to override OnCancel() and make the handler empty (don't call the base class OnCancel)
As for the static controls, add a handler for WM_CTLCOLOR, and when nCtlColor is CTLCOLOR_STATIC, return a null brush.
--Mike--
==================
The original message was:
Pls help me some other problem:
- Can I creat and activate other child Dialog from a Dialog ? - How to throw ESC keystroke while activating dialog. I try to write a Dialog base program with MFC Wizard. When main window (dialog) activated, if ESC pressed, the window (program) also deactivate. Whate can I do to avoid this ? - I want to make my main window (dialog) to have a background with a small picture (bmp) like webpage (by "tile" way. Can you help me to do this ? Can you send me a dialog class with the this properties ? I have download a source nearly with my taget (BmpDlg - from CodeProject/Codeguru), but I could not to change Static Control to not transparent.
Please help me asap.
Thank you,
Hai Le
|
|
|
|
|
I'm using SHBrowseForFolder to create a browse dialog. The problem is when I change the
CD the CD volume label on the dialog is not refreshed. Even if I cancel out of the dialog and
then put in a new CD the label in the dialog still reflects the old CD.
|
|
|
|
|
I have a dialog derived from CFileDialog. I override OnLBSelChangedNotify. According to Microsoft documentation this should get called every time the selection changes, but it doesn't.
Any ideas or workarounds?
|
|
|
|
|
Is there any API to play MP3 files ?
Alex
|
|
|
|
|
Take a look at Microsoft's Media Player ActiveX control.
Plays MP3, WMA and a bunch of other stuff.
Sergei
|
|
|
|
|
APIs can play only .wav files, according to my knowledge.
==================
The original message was:
Is there any API to play MP3 files ? Alex
|
|
|
|
|
I am developing an activex Control which constists of Treectrl and IE. I would like to Splitter Ctrl between these two so that i can resize them. Please help me
|
|
|
|
|
How do I capture the carriage return in a simple single line edit box in a dialog so that the default button is not pressed?
|
|
|
|
|
Check out,
http://www.codeguru.com/editctrl/edit_cr.shtml
Make sure you read the comments at the bottom.
==================
The original message was:
How do I capture the carriage return in a simple single line edit box in a dialog so that the default button is not pressed?
|
|
|
|
|
The following code will convert CR to a TAB for
jumping to the next control and only when the
OK button has focus CR will close the dialog.
void CMyDlg:: OnOK()
{
CWnd *pWnd = GetFocus();
ASSERT (pWnd);
if (IDOK == pWnd ->GetDlgCtrlID())
{
CDialog::OnOK();
}
else
{
NextDlgCtrl();
}
}
==================
The original message was:
How do I capture the carriage return in a simple single line edit box in a dialog so that the default button is not pressed?
|
|
|
|
|
In my application I am sending plain text to the dot matrix printer. I am having problems to force the printer to print the text in condenced mode.
Can someone please help me with this.
Thank you
Peter Zajac
|
|
|
|
|
Just send ASCII character #15
cheers,
Chris
==================
The original message was:
In my application I am sending plain text to the dot matrix printer. I am having problems to force the printer to print the text in condenced mode.
Can someone please help me with this.
Thank you Peter Zajac
|
|
|
|
|
I think there may be difficulty in sending control characters to a dot matrix printer using the standard windows printing system, so I'm not sure you can just send character 15 to the printer....
Troy in our office mentioned that Windows supports a "plain text" printer driver that has limited capabilities (ie, might not support networkable connections etc.) but does allow you to send control codes.
I'm sure I read an article in MSDN about this topic, when reviewing material on how to write a printer driver (we flirted with writing a fax printer driver years and years ago), and remember reading a passage about this.
Sorry I don't have a more specific solution.
David
==================
The original message was:
Just send ASCII character #15
cheers, Chris
================== The original message was: In my application I am sending plain text to the dot matrix printer. I am having problems to force the printer to print the text in condenced mode.
Can someone please help me with this.
Thank you Peter Zajac
|
|
|
|
|
Your opinion please.
I want to create a menu system. In addition to starting and stopping apps, I want the menu to display what view each app is on.
In this example http://www.codeproject.com/threads/sendmsg.asp, Martin-Pierre Frenette shows how to pass data from one app to another. He uses the WM_COPYDATA.
In this example http://www.codeproject.com/dll/data_seg_share.asp, Phil Mcgahan shows how to do a similar thing using PostMessage and a shared data segment.
I have a lot of C experience, but only a few months of Visual C++. If you have experience in these types of matters, would you please express the pros and cons of each to me.
The basic question is WM_COPYDATA verses Shared Data Segment.
Thank you.
|
|
|
|
|
Hi, I'm working on making my own simple proxy server to learn a bit about socket programming. I'm also implementing the main loop as a seperate thread but since my CSocket.Accept(CSocket) call is in its own loop waiting for a connection, I can't send it a CEvent to shut down.
Any help would be appreciated.
|
|
|
|
|
CSocket::CancelBlockingCall() will abort the Accept.
--Mike--
==================
The original message was:
Hi, I'm working on making my own simple proxy server to learn a bit about socket programming. I'm also implementing the main loop as a seperate thread but since my CSocket.Accept(CSocket) call is in its own loop waiting for a connection, I can't send it a CEvent to shut down.
Any help would be appreciated.
|
|
|
|
|
Accept in a loop? Thats not a correct way. Create a user interface thread of which the socket is a member and call Accept just once in the Initinstance of the thread
==================
The original message was:
Hi, I'm working on making my own simple proxy server to learn a bit about socket programming. I'm also implementing the main loop as a seperate thread but since my CSocket.Accept(CSocket) call is in its own loop waiting for a connection, I can't send it a CEvent to shut down.
Any help would be appreciated.
|
|
|
|
|
I have a dialog based app whose main screen consists of at least 4 tabs. What I would like to know is,
is it better o use property sheets or a tab control?
Thanks
Matt
|
|
|
|
|
I would like to create a program that can read the GUID from an ActiveX control. I will be reading each dll/ocx in a directory and storing the GUID and version information in a database. I have the version part but need to read the GUID.
|
|
|
|
|
__uuidof ( expression )
thought this might help.
==================
The original message was:
I would like to create a program that can read the GUID from an ActiveX control. I will be reading each dll/ocx in a directory and storing the GUID and version information in a database. I have the version part but need to read the GUID.
|
|
|
|
|
Hi, All!
How Do I use VirtualListView (LVN_GETDISPINFO) with CRecordset? Unlike CDaoRecordset here no a absolute position.
Thanks.
|
|
|
|
|
Sorry, All!
Help does not need, I simply unattentive look MSDN.
Sorry.
==================
The original message was:
Hi, All! How Do I use VirtualListView (LVN_GETDISPINFO) with CRecordset? Unlike CDaoRecordset here no a absolute position. Thanks.
|
|
|
|
|
how do i lock the position of two toolbars after docking them side by side?
|
|
|
|
|
You have 2 options:
1. Implement state persistence - in CMainFrame::OnCreate() call LoadBarState(), and in OnClose() or DestroyWindow() call SaveBarState(). You have to make sure the toolbars have different IDs. (see the toolbars & docking windows section for related info).
2. Derive your own classes from CToolbar or whatever, and block WM_LBUTTONDOWN and WM_LBUTTONDBLCLK (handle the messages and do nothing in the handlers' implementations).
The drawback is thath the user will no longer able to drag the toolbars around, nor to float them, but you can control them programmatically (using CFrameWnd's ShowControlBar(), DockControlBar(), FloatControlBar(), etc.).
Another problem of this approach is that the bars will be arranged on different rows if the user resizes the main window in a way the second toolbar is completely invisible.
Personally, I preffer (1).
Cristi
==================
The original message was:
how do i lock the position of two toolbars after docking them side by side?
|
|
|
|
|
The whole point of Dockable toolbars is so that they can be moved. The best thing to do is not to lock them. I can't see any reason why it would ultimately benefit the user in the end. Users like to be able to arrange things any way they want.
|
|
|
|