how to measurewaveIn staggering

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Hello,

I am developing a HAM radio digital modes chat-like software, which
uses sound input and output as a modem.
The application is for free at http://pocketdigi.sourceforge.net

Some of the digital signal processing methods are quite CPU intensive.
User may select mode, for which the CPU power is not sufficient. In
worst case the waveIn messages are processed first, there will be no
idle times so WM_PAINT will never be sent and the application will
respond to user interaction extremely slowly if at all. I would like
to detect this case and offer the user to switch to a less CPU
intensive mode.

My application is pure Win32 written in C. My first attempt was to
detect cases when the main message loop does not idle for a long time.
This seems to work quite well, but fails when I open a message box.
System function DialogBox creates its own message loop and my
detection of Idle state does not work anymore. I believe writing a
custom replacement of DialogBox will work, but I am a bit worried that
some dialog functions like common accelerators will not work. I expect
troubles with Smartphones. On Desktop there are message hooks, but on
Windows CE they are not officially supported.

The other idea was to measure time the messages (mainly the waveIn
messages) spend in application message queue. MSG structure contains
time member. The idea was to compare MSG.time with GetTickCount().
This solution has the same problem. DialogBox creates its own message
loop, over I have no control. After the messages are dispatched,
MSG.time is no more available at window functions.

The other idea is to use GetIdleTime(). Unfortunatelly this function
is not officially supported by Windows CE. I know the function is
there in coredll.dll, but I do not want to risk that my application
will not work on some devices.

Thanks in forward for any hint.
Vojtech
.



Relevant Pages

  • Re: MSProvide::Logon and Modal Dialog
    ... The benefit of doing it this way is that MFC owns the dialog's ... message loop, whereas the message loop was formerly hidden inside the ... Windows API function::DialogBox. ...
    (microsoft.public.win32.programmer.messaging)
  • Re: Idle wont start
    ... but I am finding that IDLE has conflicts with other ... I have been running Python 2.3 under Windows ... I would blame the Ruby installer for this particular mess. ...
    (comp.lang.python)
  • Re: Why RosAsm Breaks on a large number of symbols
    ... > and it does exactly what every other polling loop does, ... > Windows message loop is a good starting point. ... multi-tasking designs achieve synchronicity: they _BLOCK_...and ...
    (alt.lang.asm)
  • Re: PythonWin, python thread and PostQuitMessage?
    ... > to write a client for the Windows platform. ... I'm listening for keyboard ... If you have a GUI, then very likely it has its own message loop, so you should not create another. ... however in the case of Windows I don't know how to stop the keylogger. ...
    (comp.lang.python)
  • Re: Der unbekannte Kasten - Fragen vor der Kaufentscheidung
    ... die Maus mehr benutzen muss als unter Windows. ... Zumindest alles was man per Menü oder Dialogbox erreichen kann: ... MS wirklich von Apple gelernt. ... Festplattendienstprogrammdarauf anlegen. ...
    (de.comp.sys.mac.misc)