|
One solution is to derive a class from CListCtrl and do custom drawing. Check out CodeProject code section for examples.
Kuphryn
|
|
|
|
|
I have a client application which playbacks remote video files time-synchronous. I used CAsyncSocket derrived class for TCP/IP transaction.
In order to display video frames time-synchronous I have to place "Sleep(...)" method in OnReceive(...) procedure. But "Sleep(...)" method blocks message processing of main thread in specified time-period, so the application is not responding the mouse and keyboard events or responding with 30-40 second delay. Because the socket generating messages heavily.
So, I used PeekMessage(.....), TranslateMessage(...),DispatchMessage(...) in specified time-period instead of Sleep(...) method in order to proceed messages during waiting period. It is working correctly. I filtered a lot of message that may be dangerous to dispatch in OnReceive(...) procedure. Everything seems OK. The mouse and keyboard messages are being handled correctly.
But I noticed a strange behaviour; there is a drop-down list box in the main window. Normally, the selected item of drop-down list box should change when mouse pointer comes over (without clicking). But it is not working. Selected item (blue printed item) does not change when mouse pointer comes over.
I thing, It is dispatching all messages except some socket messages in OnReceive(...) procedure. What may cause this problem. Does anyone have an idea.
Thanks.
Erkan Ermis
Erkan Ermis
|
|
|
|
|
Selected item (blue printed item) does not change when mouse pointer comes over
It maybe processed in IsDialogMessage()...
"...Ability to type is not enough to become a Programmer. Unless you type in VB. But then again you have to type really fast..."
Me
|
|
|
|
|
|
|
And what is your f-ing problem?
What 40 years have to do with your question and my answer?
$6000/month? Idiot: +/-$6000 is usual for 5 minutes off my stock account fluctuations.
Now: you get back to work -- sun is high enough...
"...Ability to type is not enough to become a Programmer. Unless you type in VB. But then again you have to type really fast..."
Me
|
|
|
|
|
Hi,
i've just installed VisualC++ on w2k.
Everything is fine apart from the setup of the symbols which fails due to inconsistency between many .dll present of my w2k and the files to be installed.
Any idea on how to solve the issue?
Thanks,
Teo
|
|
|
|
|
How to know when mouse to move over the toolbar and when leave it?
Best regards,
Eugene Pustovoyt
|
|
|
|
|
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
|
|
|
|