|
You have to override the PreTranslateMessage handler. Something like the following:
BOOL CMyDlg::PreTranslateMessage(MSG* pMsg)
{
if ( pMsg->message == WM_KEYDOWN && ( pMsg->wParam == VK_ESCAPE || pMsg->wParam == VK_RETURN ) )
{
return 0;
}
return CDialog::PreTranslateMessage(pMsg);
}
Hope that helps...
|
|
|
|
|
|
|
tasleem143 wrote: when i click the enter button then application terminate i tried to handle it by adding function on key down event , is there any other alternate way to do it
Handle OnOk handller and remove default call to CDialog::OnOk()
"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
|
|
|
|
|
thanks it works from when i want to exit the application i was calling OnOK(),now its not working bcos i had overwrited it,then another solution is use exitprocess or exit which i dont think is good aproach..
is there is any other function except those two or i had to use 1 of thenm.
Tasleem Arif
|
|
|
|
|
|
cpallini wrote:
You're welcome.
ok
"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
|
|
|
|
|
tasleem143 wrote:
is there is any other function except those two or i had to use 1 of thenm.
PostQuitMessage() in case of Window and EndDialog() in case of dialog based application
"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
|
|
|
|
|
Hi Guys
Just anyone got any code or design sample for web scrapper? I want to develop it to grab the information from websites.
thanks in advance
Pats
|
|
|
|
|
NitinPatil wrote: Just anyone got any code or design sample for web scrapper?
I do, but it's a VB Script file.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Hi can you share the code ? or give me the idea how to do it? do you know how to build interactive web scrapper?
Thanks
Pats
|
|
|
|
|
NitinPatil wrote: Hi can you share the code ?
Here's one I used to get the current threat level:
Dim objIE
Set objIE = WScript.CreateObject("InternetExplorer.Application")
objIE.Navigate "http://www.whitehouse.gov/homeland/"
objIE.Visible = true
While objIE.Busy = true
Wend
Dim objTables
Set objTables = objIE.Document.all.tags("TABLE")
Dim objTable
Set objTable = objTables(12) ' get the 13th <TABLE> tag
Dim objRow
Set objRow = objTable.rows(0) ' get the 1st <TR> tag
Dim objCol
Set objCol = objRow.cells(0) ' get the 1st <TD> tag
Dim objImg
Set objImg = objCol.all(0) ' get the 1st <IMG> tag
MsgBox objImg.src The site has since been rearranged so the references are not accurate.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
For vs 2005 win xp
I can run one file but can't change to another file.
I tryed Msdn help but it's for Vs 6 and it doesn't work in vs 2005
Thanks
Moreno
|
|
|
|
|
|
sir_moreno wrote: I tryed Msdn help but it's for Vs 6 and it doesn't work in vs 2005
Says who?
http://msdn.microsoft.com[^]
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
|
Thank's a lot it worked;)
Moreno
|
|
|
|
|
Hi all.
How can I retrive the complete path of "My Documents" folder?
Thanks
Rakesh Thakur
|
|
|
|
|
Try this.
TCHAR szPath[MAX_PATH];
SHGetFolderPath(NULL, CSIDL_PERSONAL , NULL, 0, szPath);
|
|
|
|
|
Hi,
Try this:
BOOL SHGetSpecialFolderPath(
HWND hwndOwner,
LPTSTR lpszPath,
int nFolder,
BOOL fCreate
);
-----------
Mila
|
|
|
|
|
Rakesh_Thakur wrote:
How can I retrive the complete path of "My Documents" folder?
have a look at http://www.codeproject.com/shell/shellextguide6.asp
"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
|
|
|
|
|
Hi all friends .
I develop a program that always read a data buffer from hardware very fast and display it on a dialog . It is not possible use of GDI's API for data displaying because it's very slow . I use DirectDraw but using of it is very hard and produce bugs ( example its draw in space of other windows and ...) . Now I search for an function , technology or ... that I give it a buffer of color data with it's elements position to draw it in correct position .
the buffer is similar this :
_______________________________________________________
| RGB(,,) | RGB(,,) | RGB(,,) | ... |
-------------------------------------------------------
and element's position of buffer is similar to :
_______________________________________________________
| (x1,y1) | (x2,y2) | (x3,y3) | ... |
-------------------------------------------------------
If you know please help me !
thanks a'lot
|
|
|
|
|
A_Fa wrote: It is not possible use of GDI's API for data displaying because it's very slow
Really? I find it capable of rendering screens of pixels faster than my human eye can perceive
them.
A_Fa wrote: I use DirectDraw but using of it is very hard and produce bugs
DirectDraw with a DirectX-enabled/capable video card is probably the best performance you'll
get. DirectDraw is "hard" - there is a learning curve, but it doesn't Produce bugs - It renders
YOUR bugs very quickly.
You must be working with REALLY FAST hardware
|
|
|
|
|
Or alternatively, very bad at writing efficient GDI code.
Very early on, I learned the benefits of Polyline over MoveTo/LineTo/LineTo/LineTo etc., and similar things. I do like your comment about DirectDraw!
Steve S
Developer for hire
|
|
|
|
|
Steve S wrote: Or alternatively, very bad at writing efficient GDI code.
Si!
|
|
|
|