|
Anyone tell me some about the WM_TIMER message handler. How it does works? I was try to a switch for nIDEvent but it does not give a result. I am guessing that no need to use CTime() or SetTimer()
Code:
<br />
void CEfeView::OnTimer(UINT nIDEvent) <br />
{ <br />
if((nIDEvent == ID_RECTANGLE)&&(m_bMouseMoving == TRUE))<br />
SetJoyLockRectangle(1700,700,1710,710); <br />
else<br />
AfxMessageBox(...<br />
KillTimer(1);<br />
modified 13-Mar-13 6:09am.
|
|
|
|
|
The nIDEvent passed to the OnTimer handler, according to documentation [^]:
Specifies the identifier of the timer
i.e. the number of the timer you passed as first argument to the SetTimer method.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
[my articles]
|
|
|
|
|
|
Hakan Bulut wrote: I haven't got a result with it statement.
What do you mean with the above?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
[my articles]
|
|
|
|
|
Can be more helper about WM_TIMER? They stole my computer.
modified 13-Mar-13 6:08am.
|
|
|
|
|
Can be more helper about WM_TIMER? They stole my computer. I mean that at this statement:
void CEfeView::OnTimer(UINT nIDEvent) <br />
{ <br />
if((nIDEvent == ID_RECTANGLE)&&(m_bMouseMoving == TRUE))<br />
SetJoyLockRectangle(1700,700,1710,710); <br />
else<br />
AfxMessageBox(...<br />
KillTimer(1);
How much at the time comes to an end to the SetJoyLockRectangle's new parameters?
Bitte tun Sie mir nicht antworten, wenn Sie nicht wissen, die Ursache des Problems wirklich oder nur als Antwort. Was ist das? Dies ist das Buch sitzen.
|
|
|
|
|
Hakan Bulut wrote: if((nIDEvent == ID_RECTANGLE)&&(m_bMouseMoving == TRUE))
Well I can't tell if the above is correct, but it looks pretty strange. Is ID_RECTANGLE your (or one of yours) timer identifier? If the answer is no then the code is wrong.
Hakan Bulut wrote: KillTimer(1);
Why are you killing the timer 1 ?
Hakan Bulut wrote: How much at the time comes to an end to the SetJoyLockRectangle's new parameters?
I cannot even understand the English mean of the above.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
[my articles]
|
|
|
|
|
Oh, it isn't such a difficult topic.
If you need a timer, i.e. a message that OS periodically sends to your window then set a timer (using SetTimer method), specifying:
(1) The timer indentifier, i.e. a number that maybe useful if you app uses two or more timers (though I don't suggest you to use many timers).
(2) The timer elapse, i.e. the time interval separating two timer messages, expressed in ms . Hence, if you need that you timer message handler is called every second, use 1000 as elapse.
(3) an (optional) pointer to a timer callback routine (At the moment,ignore it: use NULL).
Inside OnTimer the message handler:
(1) Check if the timer identifier is the proper one (you may skip this point if you have only a timer in your app, but I don't recommend this behaviour).
(2) Do the timer related operations.
Thats all.
See, there is also an example http://msdn2.microsoft.com/en-us/library/49313fdf(VS.71).aspx[^]
there is also an example.
If you have any doubt, please be detailed about.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
[my articles]
|
|
|
|
|
hi,
When i press {,[ keys in keyboard i get nChar in OnKeyUp() as 219
And when i press },] keys i get 221.
I dont know actually what menas nChar, i see it in MSDN..i get confused...for 1,2,3 keys i get ASCII value of that particular keys coreectly.
But ASCII for { is 123 then why it shows like 219.
Pls clear my confusion.....
Anu
|
|
|
|
|
Well, as stated by the documentation [^], the nChar argument passed to the OnKeyUp() handler, is the virtual key code of the given key, hence it isn't its ASCII code. The fact that the two quantities are the same for numeric (and for letters 'A' to 'Z' ) keys is a mere (well, not casual, and useful ) coincidence. Anyway the ultimate reference for virtual key codes is (again documentation states it) the Winuser.h header file
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
[my articles]
|
|
|
|
|
try WM_CHAR instead of WM_KEYUP.
|
|
|
|
|
It's right, but it is sent when the key is down. He may be demanding the "key up" itself.
|
|
|
|
|
I used WM_CHAR but when i press combiantions like Shift-F1,ctrl-F10 the control does not go to OnChar().
What can i do for that?
I need to find ASCII fro combination of two keys like Ctrl-F1,ctrl-F2..like that.
Anu
|
|
|
|
|
Anu_Bala wrote: when i press combiantions like Shift-F1,ctrl-F10 the control does not go to OnChar().
WM_CHAR message will not be raised for such type keys like functions keys, page up, page down, home, end etc. If you want to handle such keys also then you have to use the WM_KEYUP/WM_KEYDOWN itself.
If you are handling the message in the WM_KEYUP/WM_KEYDOWN, check the nchar aganist the values like
VK_OEM_4 for '[' and '{' ,
VK_OEM_6 for ']' and '}' . Check the winuser.h for all the virtual key codes.
|
|
|
|
|
|
Hi there .
I want to get mouse coordinate on desktop, I can do it and it's worked but only on application own windows. how can i process mouse notification in all other open window include desktop?
Sorry about my English, my English is not so good .
thanks.
DMASTER
|
|
|
|
|
Does GetMouseMovePointsEx [^] help?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
[my articles]
|
|
|
|
|
Dear Pallini thanks to your reply,
Mr.Pallini I know this method, my problem is which message of mouse notification must be process to use this functions ?
thanks.
DMASTER
|
|
|
|
|
You may use this function asynchronously, whenever you need.
However, if you need to stay updated with system-wide mouse notifications, then you probably need to write a mouse hook (see, for instace http://www.codeproject.com/KB/DLL/ParkMouse.aspx[^]).
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
[my articles]
|
|
|
|
|
Thank you my friend ,that was i want .
DMASTER
|
|
|
|
|
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
[my articles]
|
|
|
|
|
I want to create a windows service in VC++ which will run on one machine & create a file on other network machine.
|
|
|
|
|
|
Working in Microsoft Visual C++, WinSock2.h, string.h and time.h all three have the same error:
In the line:
extern "C" {
Error message:
";" missing
Any idea why this could be or how to solve it?
Thanx!!
|
|
|
|
|
That line shouldn't create any problem.
What is included in the extern "C" block?
What file is compiling when the error message appears?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
[my articles]
|
|
|
|