|
Override PreTranslateMessage and intercept WM_MOUSEMOVE: it will be sent when the mouse is present on the toolbar window. Hope this help
|
|
|
|
|
First, I need always check window under the mouse for this. This isn't good idea. Second, I may have more than one toolbar and don't know ID toolbar. Another idea!?
Best regards,
Eugene Pustovoyt
|
|
|
|
|
Eugene Pustovoyt wrote:
First, I need always check window under the mouse for this. This isn't good idea.
Well, that's the point, to know if something leaves an area, you need to know if it was inside.
Second, you will need to have a different class for each toolbar in which to put the Pretranslate message, so, no need to check for the toolbar ID.
also Have a look at _TrackMouseEvent and the TRACKMOUSEEVENT structure.
Maximilien Lincourt
"Never underestimate the bandwidth of a station wagon filled with backup tapes." ("Computer Networks" by Andrew S Tannenbaum )
|
|
|
|
|
I would add WindowFromPoint to know the handle fo the window the mouse id over it and thus to get the ID of the toolbar
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
Hi,
I have a multithreaded application, that reads from one queue. This queue is proteced by a crtitcal section (enter/leave critcal section). When I ran this program and start process explorer from sysinternals, I can see that the amount of the unnamed event objects is raising. I dont do any CreateEvent or something like this.
thanks in advance
|
|
|
|
|
Sounds like recursion to me. Make sure you are not calling a function (most likely in a thread) that causes this probem. Of course if you want to be sure it is a recursion problem, just let it run until your system crashes ( NOT RECOMMENED - damn I forgot XP/2000+ tends to stop that [the crash part not the problem] ).
INTP
|
|
|
|
|
I remeber I've read something about this before. But I just could not find it when I actually need it . could anyone of you give me some tips? many many thanks.
|
|
|
|
|
Use _chmod() to remove the r/o attribute for you try and delete it.
Neville Franks, Author of ED for Windows. Free Trial at www.getsoft.com
|
|
|
|
|
it works! many thxs
|
|
|
|
|
hello!
i have heard that register type should be used for faster computations,
can register represent any data type? (int, char, float, long)
is it true that changing variable type from int to register will increase speed of computations made on such variable?
thanks
Pawel Olszewski
|
|
|
|
|
The register keyword is used to modify a variable to say it should be stored in a register if possible, for example
register int foo;
It is only a suggestion to the compiler which may be ignored. I think VC++ always ignores it because it can generally do a better job of optimisation by itself. So try turning optimisations on.
Mike
|
|
|
|
|
The register keyword specifies that the variable is to be stored in a machine register, if possible.
This means that there's a chance that this wont happen in some cases, when the Processor registers are occupied.
If your variable is really treated as register, the CPU will grant you faster execution, cos direct computation are done on you register var.
Lets say you want to calculate in a loop i ++
Youll have something like this:
loop:
mov edx , 1
add eax , edx
jmp loop
But if the Processor doesnt give u access you'll have at least command that moves your var to a register to do the calc, and back from the register to your var, thus calculation in long loops can generate at least 2 * Number of loops instruction.
Hope this helps,
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
Thank You very much
Both answeres were helpful
Pawel Olszewski
|
|
|
|
|
Register variables is not all that usefull for normal application thaat we make, it is usefull where heavy computation is required like 3d coordinate calculations... etc.
My God is more powerfull Than Your God. (the line that divides the world)
|
|
|
|
|
register dates back to the days before optimizing compilers. On modern compilers, register is pretty much useless because it's a user optimization, which is bound to be less effective than whatever optimizations the compiler can do itself. And VC totally ignores register anyway.
--Mike--
Ericahist | CP SearchBar v2.0.2 | Homepage | RightClick-Encrypt | 1ClickPicGrabber
There is a saying in statistics that a million monkeys pounding on typewriters would eventually create a work of Shakespeare. Thanks to the Internet, we now know that this is not true.
|
|
|
|
|
Hi all,
is it possible to intercept keystrokes in a service?
Every Service run in a different desktop from the one a user logs, so basically I think this service should grab any keystrokes in any desktop. Do you have any experience on that?
Thanx alot n' Merry Xmas.
|
|
|
|
|
> ..so basically I think this service should grab any keystrokes in any desktop
Not at all.
To grab keystrokes you have to call the SetWindowsHookEx API. Problem: SetWindowsHookEx resides in user32.dll and user32 functions are generally bound to a specific desktop. Because most services don't run under the logged-on user account you won't be able to grab the keystrokes of the loged-on user either (nor the keystrokes of any other desktop, like WinLogon for example) - at least not directly.
Fortunately there are two exceptions to the above rule:
1. Services running under the local System account can be made interactive. In other words, they can interact with the user and thus grab its keystrokes too. But this way you will only grab the keystrokes of the loged-on users desktop -> it's the same as if you would make an ordinary win32 exe right away.
2. You can "connect" a (service) thread to a desktop via SetThreadDesktop . Knowing this, you could try on of the following:
a) Spawn a new thread for each desktop that is present on the system; then call SetThreadDesktop and SetWindowsHookEx from within each thread.
b) Since there is only one interactive desktop (=desktop, that receives the user input) at any time, simply call SetThreadDesktop and SetWindowsHookEx always when the active desktop gets switched.
Note: This were just presumptions from the top of my head -> for the exact behavior/terminology and implementation check the MSDN documentation.
RK
|
|
|
|
|
Thanx a lot. I will check for something.
Merry xmas
|
|
|
|
|
I used two socket to communication with two computer,and My Computer acts as Server and Client。Socket1 receive order of "Connect A" from the Clent(now my computer is server)and connect Machine A(now my computer is clent) by Socket2。when Received "Stop" order,my computer disconnect A.I have tried,but failured.the error is that Socket2 can't connect Machine A in the Child thread.
Please help me,thanks a lot
|
|
|
|
|
As I undestand, you are trying to use socket in a thread which have not message pump. It is not works. Because CAsyncSocket ar CSocket derived classes have to be used in thread which have message pump. Sockets are needs message pump interface.
Try to use in main thread or another process which have message pump.
Erkan Ermis
|
|
|
|
|
hi ,
i have created an activex control in vb. in one of the method the user passes the file path to the control.
in vb i used string to get the file path... now in vc++ when i insert the control its been declared i.e the string variable is been declared as BSTR* filepath...so i cant pass the variable which i am capturing as a CString.
What is the problem???
Thanking you.
Satadru.
|
|
|
|
|
strings are used as BSTR in COM
VB Hides this complexity from the user
but in VC u'll have to convert BSTR in to CString
there are many good bstr classes in VC u can use
Live as if your were to die tomorrow. Learn as if you were to live forever.
-Mahatma Gandhi
|
|
|
|
|
hi thanks for your reply ..
i have found out the problem... while creating the methods for the control i used functions which are by default reference but in vc++ its by value .... that was the problem ..thanks anyway
|
|
|
|
|
|
You bet
My God is more powerfull Than Your God. (the line that divides the world)
|
|
|
|