|
this is beacause there will be some other controls in the dialog. Remove all the control and try again.
another way is to overide the PreTranslateMessage and check the WM_KEYDOWN inside it.
nave
|
|
|
|
|
just a guess, but in the MESSAGE_MAP, is it associated to the correct control ?
|
|
|
|
|
Anu_Bala wrote: but the control does not go to that code
are you talking about Program Flow Control Will debugging or Control like BUTTON,EditBox etc
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
BEGIN_MESSAGE_MAP(CFaceDlg, CDialog)
ON_WM_KEYDOWN()
END_MESSAGE_MAP()
This is my BEGIN_MESSAGE_MAP..
Anu
|
|
|
|
|
then it is mapping the event to the CFaceDlg dialog class, not a specific control...
|
|
|
|
|
I dont understand..How can i do that..I dont know to do that.
Anu
|
|
|
|
|
toxcct wrote: is it associated to the correct control ?
in the dialog class he will be able to map only the WM_KEYDOWN for the Dialog. not for any controls. Isn't it?
nave
|
|
|
|
|
yup... but he'll get a DWORD indicating which on control the event is happening
actually, i never had to use it, so wasn't aware of this handler parameters
-- modified at 6:26 Wednesday 2nd August, 2006
|
|
|
|
|
toxcct wrote: but he'll get a DWORD indicating which on control the event is happening
how?
Can u plz explain with the below eg:
// The message map
BEGIN_MESSAGE_MAP(CFaceDlg, CDialog)
ON_WM_KEYDOWN()
END_MESSAGE_MAP()
// the funtion
void CFaceDlg::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags)
{
// This function gets called only when a keydown event happends in that dialog. and
// that too if there is no controls in the dialog
}
in the above example where we get the DWORD indicating the control?
nave
|
|
|
|
|
I use PreTranslateMEssage as follows even it does not happen anything...
if( WM_KEYDOWN == pMsg->message )
{
if( ::GetParent( pMsg->hwnd ) == m_Edata.m_hWnd )
{
TCHAR tcChar[2];
tcChar[0] = pMsg->wParam;
}
}
return CDialog::PreTranslateMessage(pMsg);
Anu
|
|
|
|
|
Anu_Bala wrote: it does not happen anything...
i didn't find anything in the above code for some thing to happen
if( WM_KEYDOWN == pMsg->message )
{
AfxMessageBox( _T("KeyDown"));
}
and check if the message box is comming or not.
whats the purpose of the checking
if( ::GetParent( pMsg->hwnd ) == m_Edata.m_hWnd )
nave
|
|
|
|
|
Ya, i checked like that..MessageBOx came..But the control does not go to OnKeyDown()
Anu
|
|
|
|
|
I already said.. the OnKeyDown() will not be called.
U can do all the thing that u want to do in the OnKeyDown() in the PreTranslateMessage() function.
nave
|
|
|
|
|
I coded like this in my pretransalateMessage() now its working..
Thaknks for all
BOOL CFaceDlg::PreTranslateMessage(MSG* pMsg)
{
if( WM_KEYDOWN == pMsg->message )
{
//AfxMessageBox( _T("KeyDown"));
OnKeyDown( static_cast< UINT >( pMsg->wParam ), LOWORD( pMsg->lParam ), HIWORD( pMsg->lParam ) );
}
return CDialog::PreTranslateMessage(pMsg);
}
Anu
|
|
|
|
|
hello,
i convert .txt file into .wav file ,now i want to know that how to convert .tiff file into .wav file, or is there any way to convert .tiff file into .txt ,so that later i convert it into .wav file
reply soon....
|
|
|
|
|
I would convert the tiff in a txt-File.
I hope you know what youre doing?
Greetings from Germany
|
|
|
|
|
Do you want to convert text to sound and sound to text?
|
|
|
|
|
What you ask for is meaningless without a good explanation. Converting TXT to TIF to EXE to DLL to BIN to WAV is a very simple thing if you don't define what you want. If you don't believe me just create a TXT file and rename it to EXE and you will see how easy it is!!
The best way for us to help is if you explain what you are trying to acomplish. Otherwise simply use the ::rename() function to convert between file types.
|
|
|
|
|
Now there's a project of Dunctment/View that want run another programming file name extension .exe which run in the only directory with many *.dll. I did it by the API CreateProcess, the first arugment is a full file path like "D:\\work\\WorkWithDlls.exe" result with the programming
run error when I put a path like "D:\\work\\WorkWithOutDlls.exe" result with all right.
I just wanted excute the EXE file int the right directory but it seem the API fuc CreateProcess can't do it.
Someon can give some suggestion, thanks!
|
|
|
|
|
hi,
look at this Api's
1) WinExec(..)
2 CreateProcess(...)
3 ShellExecute(...)
This will help you to solve you problems.
uday
|
|
|
|
|
::ShellExecute(NULL, "open", "D:\\work\\WorkWithOutDlls.exe", NULL, NULL, SW_SHOW);
|
|
|
|
|
Hi,
You try this and let me know if this solves u r problem.
STARTUPINFO si;
PROCESS_INFORMATION pi;
ZeroMemory( &si, sizeof(si) );
si.cb = sizeof(si);
ZeroMemory( &pi, sizeof(pi) );
// Start the child process.
if( !CreateProcess( NULL, // No module name (use command line).
"C:\\Sample\\Debug\\sample.exe", // Command line.
NULL, // Process handle not inheritable.
NULL, // Thread handle not inheritable.
TRUE, // Set handle inheritance to FALSE.
0, // No creation flags.
NULL, // Use parent's environment block.
NULL, // Use parent's starting directory.
&si, // Pointer to STARTUPINFO structure.
&pi ) // Pointer to PROCESS_INFORMATION structure.
)
{
AfxMessageBox( "CreateProcess failed." );
}
Ashok
|
|
|
|
|
All above haven't understand my problem. After some rest I find the truth.
I only need use API ::SetCurrentDirectory first, and then erverything is right, howerver thank you very much.
|
|
|
|
|
|