|
Consider a solution in which you handle the WM_SETCURSOR notification. Within the OnSetCursor handler, obtain the mouse coordinates with GetCursorPos , make a test and call SetCursor to set your cursor, then return TRUE . Otherwise, call the parent OnSetCursor handler and return its value.
Hope it will work.
|
|
|
|
|
You forgot to convert the points (pMessage->pt) to client coordinates, because they are in screen coordinates.
- NS -
|
|
|
|
|
hello everyone:
In a window service, I want to create a dummy window for receiving some messages from other exe. Is it possible?
Thanks.
-Freehawk
|
|
|
|
|
|
How do i capture the key event in a split window. I have a MFC SDI window which contain two splited window. One derived derived from CFormView to create a control planel, other renders a opengl scene. i am not able to capture key events (up and down) from my Mainframe. Please help
Sandip
|
|
|
|
|
Capture it in your CFormView's WM_KEYDOWN and WM_KEYUP.
Regards,
FarPointer
Blog:http://farpointer.blogspot.com/
|
|
|
|
|
I mean if u enter some data after clicking enter then it should perform some action say displaying messageBox
anyone please help me to get of the problem
-- modified at 7:28 Wednesday 7th June, 2006
|
|
|
|
|
can u be more specific
nave
|
|
|
|
|
sree_as wrote: in edit box i want to activates the directions key in my keyboard.
See the Following properties of EDIT CONTROL
Multiline
AutoHScroll
AutoVScroll
Want return
Knock out 't' from can't,
You can if you think you can
|
|
|
|
|
I mean if u enter some data after clicking enter then it should perform some action say displaying messageBox.
SO i need keystrokes
|
|
|
|
|
Derive a class from CEdit and make the object of this class as member variable of the edit control.
Overide the WM_KEYDOWN message in the new class and then u can trap the enter key fro that funtion...
nave
|
|
|
|
|
Thank u naveen.
please give me rough coding.actually my domain is java but unfortunately i czme to Vc++ one month so please give me
rough code,
|
|
|
|
|
here i have derived a class from the CEdit say EditCtrlEx . Then using the class wizard i mapped the WM_KEYDOWN message( this will create a stub function with name void EditCtrlEx::OnKeyDown( UINT uChar_i, UINT uRepCnt_i, UINT uFlags_i )
inside this write
void EditCtrlEx::OnKeyDown( UINT uChar_i, UINT uRepCnt_i, UINT uFlags_i )
{
CEdit::OnKeyDown( uChar_i, uRepCnt_i, uFlags_i );
if( VK_RETURN == uChar_i )
{
AfxMessageBox( _T("Enter clicked ));
}
}
Remeber to give the Want-Return style to the edit ctrl
nave
|
|
|
|
|
thank u very much.
i done it but the editbox but not responding when we click enter.
anyway thanks for ur code
|
|
|
|
|
i tried but not working editbox is not responding for entry key.
sorry for disturbing
sree
|
|
|
|
|
Hi ,
Add the ON_WM_GETDLGCODE() along with the above code
UINT Cmyedit::OnGetDlgCode()
{
return CEdit::OnGetDlgCode()|DLGC_DEFPUSHBUTTON|DLGC_WANTALLKEYS;
}
Regards,
FarPointer
Blog:http://farpointer.blogspot.com/
|
|
|
|
|
Either give the Want return and multiline style to the edit ctrl or do as the FarPointer said in the above post.
nave
|
|
|
|
|
Hi,
I am a bit confused on how VC++ linker is resolving the function signatures. I have a windows Dll and a corresponding header file and I wanted to build a lib file out of it. So I dumped the exported methods from the DLL using Dumpbin utility. I then wrote a .def file for the exported methods and generated a .lib file from the DLL file.
Everthing was fine however I got confused regarding one thing. It is that the dumpbin produced the exported methods list with no underscore in the method name. E.g. Foo
When I ran the dumpbin utility on the generated lib file, I got underscore in method signature E.g. _Foo, so I assume that the methods must have been exported using __cdecl calling convention. When I look the method signature in the header file the prototype contains the __stdcall in the method prototype like
void LIBAPI Foo(); and LIBAPI is defined as
#if defined _WIN32
#define LIBAPI WINAPI
#endif
I was able to successfully create the .exe file using the generated lib file. Now my query is how is the linker resolving the differences in the method signatures?
Or is it the case that I am missing something basic here?
Can someone please clarify what is happening here.
Thanks and Regards.
|
|
|
|
|
Hello. everyone
I want to change a exe application to a window service. The application(exe) can receive some self-defined messages from other exe, so I want to receive same messages in the service too. Please teach me how to realize it?
Thanks.
-Freehawk
|
|
|
|
|
sunyw_2006 wrote: I want to change a exe application to a window servic
See the Service(.exe) option of the ATL com Project.
Knock out 't' from can't,
You can if you think you can
|
|
|
|
|
|
Thanks for reply.
In "xyntservice.asp" sample, it can not receive messages from other exe.
I need to handle some messages from other exe.
-Freehawk.
|
|
|
|
|
As far as I know, xyntservice can execute Win32 GUI apps (who has got a message pump). So it wouldn't be a problem for you.
Check out the ini-file sample (that starts up Notepad). If Notepad can be started under xyntservice, so will your app. And if Notepad will receive Windows messages, so will your app.
Try it out!
|
|
|
|
|
Thanks.
But when the current user log off, the exe is quited.
1.During logged off, can the window service call the exe?
2.Can the window service receive "log off" message?
-Freehawk
|
|
|
|
|
sunyw_2006 wrote: 1.During logged off, can the window service call the exe?
2.Can the window service receive "log off" message?
1.
Nope. A service can of course not send messages to a terminated app.
2.
Check out WM_ENDSESSION. MSDN:
[^]
|
|
|
|