|
CWnd::OnSysChar
Sorry to dissapoint you all with my lack of a witty or poignant signature.
|
|
|
|
|
Thank you for your help, but this does not work either.
I just tried it... and I receive no calls on this, when I use this in my CEdit derived class.
Thomas
modified 29-Aug-18 21:01pm.
|
|
|
|
|
What you CAN do, is to detect the loss of focus. This covers a return character, as well as mouse moves and etc. (You probably want to remove the highlight if the user clicks in another control, don't you?)
Try using this:
CWnd::OnKillFocus
afx_msg void OnKillFocus( CWnd* pNewWnd );
Parameters
pNewWnd
Specifies a pointer to the window that receives the input focus (may be NULL or may be temporary).
Remarks
The framework calls this member function immediately before losing the input focus.
If the CWnd object is displaying a caret, the caret should be destroyed at this point.
Note This member function is called by the framework to allow your application to handle a Windows message. The parameters passed to your function reflect the parameters received by the framework when the message was received. If you call the base-class implementation of this function, that implementation will use the parameters originally passed with the message and not the parameters you supply to the function.
CWnd Overview | Class Members | Hierarchy Chart
See Also CWnd::SetFocus,WM_KILLFOCUS
--------------------------------------------------------------------------------
Send feedback to MSDN.Look here for MSDN Online resources.
|
|
|
|
|
The situation is different.
I have a window that has a dialogbar that contains this editbox.
When Enter key is pressed, there is no focus change. and the ENTER can be seen only in the parent window derived from CFrameWnd.
Thomas
modified 29-Aug-18 21:01pm.
|
|
|
|
|
|
Try handling the WM_GETDLGCODE windows message.
---
CPUA 0x5041
Sonork 100.11743 Chicken Little
It may be that your sole purpose in life is simply to serve as a warning to others.
|
|
|
|
|
I implemented the PreTranslateMessage and handled the WM_KEYDOWN as Matt Gullet suggested and it works great. I had done that before I saw your post and did not try this.
Anyway, Thank you for the help
Thomas
modified 29-Aug-18 21:01pm.
|
|
|
|
|
Just overide PreTranslateMessage and look for a WM_KEYDOWN message with a wParam of VK_RETURN. You will also have to check the status of the alt/control/shift keys (if needed).
|
|
|
|
|
works like a charm.
Thank you very much
Thomas
modified 29-Aug-18 21:01pm.
|
|
|
|
|
I created an edit control in Win32 as following:
hwndEdit = CreateWindow( TEXT("edit"), tcLabel,
WS_CHILD | WS_VISIBLE | WS_BORDER | ES_LEFT | ES_AUTOHSCROLL ,
cxChar + 100, cyChar * (2 * i ) /* * (1 + 2 * i) */, 20 * cxChar + 100,
cyChar * (1.25), hwndDlg, (HMENU) i,
((LPCREATESTRUCT) lParam)->hInstance, NULL)
However, the following catch inside my dialog's WM_COMMAND catch statement, no longer works after creating my edit box :
if (HIWORD(wParam) == EN_CHANGE ||
HIWORD(wParam) == CBN_SELCHANGE)
When I click inside the text boxes, a couple of messages are generated, but they don't correspond to "EN_CHANGE". How would I find out what those messages are within VC btw? Any idea what this problem maybe?
thanks
|
|
|
|
|
When you click in the edit control, Windows will send a WM_SETFOCUS to your dialog to indicate that the focus has changed. The EN_CHANGE notification is sent when the text inside the control changes. A CBN_CHANGE notification is not sent for an edit control.
/ravi
"There is always one more bug..."
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
You must to Write into the edit for the message EN_CANGE will be cached...;)
Best Reagards...
Carlos Antollini.
Sonork ID 100.10529 cantollini
|
|
|
|
|
I'm trying to create TAb views like in the Vusial Studio Work space browser or in the Output window, but my project always crashes. Has someone experience on how to program this?
Thanks
|
|
|
|
|
When a file is saved using CArchive, is it then posible to read the file in an application created for Linux??
|
|
|
|
|
Sure, a file is a file is a file. You will just need to mimic CArchive in your linux program.
Tim Smith
I know what you're thinking punk, you're thinking did he spell check this document? Well, to tell you the truth I kinda forgot myself in all this excitement. But being this here's CodeProject, the most powerful forums in the world and would blow your head clean off, you've got to ask yourself one question, Do I feel lucky? Well do ya punk?
|
|
|
|
|
Tim Smith wrote:
Sure, a file is a file is a file.
Which brings up the age-old question... Which came first, the file or the filers?
Jeremy L. Falcon
"The One Who Said, 'The One Who Said...'"
<nobr>
Homepage : Sonork = 100.16311 01000010011011110110001000100000011101110110000101110011 00100000011010000110010101110010011001010010111000000000
|
|
|
|
|
Thanks and yes, that makes sence..
|
|
|
|
|
... so this is what I need : I want to know last write time for a file, let's say, for example, "http://www.website.com/Index.htm" ... I tried with CFileFind but I get no results ... so, if anyone can help me with some sample code ????
10x, Cretze
|
|
|
|
|
telnet www.website.com 80
Trying ##.##.##.##.##...
Connected to website.com.
Escape character is '^]'.
GET /index.htm HTTP/1.1
Host: BAB
HTTP/1.1 200 OK
Date: Thu, 18 Apr 2002 18:12:13 GMT
Server: Apache/1.3.23
Last-Modified: Fri, 14 Jul 2000 05:58:20 GMT
ETag: "2c6a3a-cc7-396eabfc"
Accept-Ranges: bytes
Content-Length: 3271
Content-Type: text/html
Note the Last-Modified date. That's the date of the file unless the file you are trying to access is a script in which case there isn't a Last-Modified header in the response.
Todd Smith
|
|
|
|
|
Does anybody know how to convert CString to COleDateTime?
Nope
|
|
|
|
|
If your CString contains a value in a valid date-time format you can do this...
CString strSomeString
COleDateTime dtSomeDate;
strSomeString = '[some valid date format]';
dtSomeDate.ParseDateTime(strSomeString);
|
|
|
|
|
Hi all,
I have a dll which I would like to load from myapp.exe. Currently I'm doing this through the use of LoadLibrary. However, this causes the dll to be loaded each time myapp.exe starts. Is there a way to leave the dll in memory after it has been loaded the first time...? Well, maybe I could ignore freing it with FreeLibrary when myapp.exe closes but how can I detect if the library is loaded so that I don't load it again next time myapp.exe is executed?
Can I load a dll when the computer starts up? So that it is always in memory? But how then can I get hold of the functions contained withing the dll from myapp.exe now that myapp.exe doesn't have a handle to the loaded module?
Lots of questions, dig in!
Thx,
/Tommy
|
|
|
|
|
In Win32 when you load a dll the read-only code section is shared through all processes that uses that particular dll, if you omit the FreeLibray call it should allready be loaded (ok, i am actually not 100% sure about that ).
Read/write sections however belongs to the individual processes and are not shared.
Tommy Svensson wrote:
how can I detect if the library is loaded so that I don't load it again next time myapp.exe is executed?
You can say that this is what LoadLibrary actually does for you.
Jan
"It could have been worse, it could have been ME!"
|
|
|
|
|
No, this can't be done unless you have a process that loads the library and does not exit.
As it should, WIN32 will unload a DLL used by a process when the process exits.
Why do you need your DLL to remain in memory?
Tim Smith
I know what you're thinking punk, you're thinking did he spell check this document? Well, to tell you the truth I kinda forgot myself in all this excitement. But being this here's CodeProject, the most powerful forums in the world and would blow your head clean off, you've got to ask yourself one question, Do I feel lucky? Well do ya punk?
|
|
|
|
|
Hi,
I want to have margins like MSWord in my CView, i.e there
should be Grey area around the document , in which we cannot
type anything.
Can someone tell me how it can be done.
Thanks
Sansky
God is Good, all the Time.
All the Time, God is Good.
|
|
|
|