About

I’m a senior freelance software developer specialized in hardware near, industrial automation and desktop development.

I am a Linux user since the late nineties – have seen it grow and started giving back about 2006. I’m glad I don’t have to do Windows to earn a living.

You are going to find here my old Win32 downloads, new open source Linux stuff. I read a lot of science fiction and I’ll recommend some here, too.

I am going to stay with you until peak oil eats our very bandwidth…

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

void CIT46::DoLoop()
{
    USES_CONVERSION;
 
    BOOL bPrev = FALSE, bNew = FALSE;
    DWORD dwStart = GetTickCount();
    while( true )
    {
        DWORD result ; 
        MSG msg ; 
 
        while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) 
        { 
            if (msg.message == WM_QUIT)  
                return; 
            DispatchMessage(&msg); 
        } 
 
        result = MsgWaitForMultipleObjects(1, &hEvent, 
                 FALSE, 1000, QS_ALLINPUT); 
 
        if (result == (WAIT_OBJECT_0 + 1))
        {
            // New messages have arrived. 
            // Continue to the top of the always while loop to 
            // dispatch them and resume waiting.
            continue;
        } 
        else
        { 
            // shut down flag
            if( bAbort )
                break;
 
            // Our Event became signaled or we timed out.
            if( StackSize() )
            {
                int iMsg = PopStack();
                DoCommand(iMsg);
            }
 
            // update data cyclic
            if( IsiTunesRunning() && AppCreate() )
            {
                bNew = TRUE;
 
                // mousewheel messages
                if( addVol )
                {
                    long vol = 0;
                    app->get_SoundVolume(&vol);
                    vol += InterlockedExchange(&addVol, 0);
                    app->put_SoundVolume(vol);
                    if( !StackSize() )
                        continue;
                }
                DoUpdataData( app );
            }
            else
            {
                if( artist && wcscmp(artist, L"N/A") || 
                    album && wcscmp(album, L"N/A") || 
                    track && wcscmp(track, L"N/A"))
                {
                    chg = TRUE;
                    album.Empty();
                    artist.Empty();
                    track.Empty();
                }
                bNew = FALSE;
 
                    // autohide
                if( IsAveDesk() && bAutoHide )
                {
                    DWORD dwNow = GetTickCount();
                    if( dwNow > dwStart + 5000 )
                    {
                        DoUpdateProcessList();
                        std::set::iterator it;
                        for(it = proc.begin(); it != proc.end(); it++ )
                        {
                            if( actproc.find((*it)) != actproc.end() )
                            {
                                dwStart = dwNow;
                                break;
                            }
                        }
                        if( dwStart != dwNow )
                        {
                            DeskletFadeOut(m_hWnd, FALSE, -1);
                            AtlTrace("Hidden!\n");
                        }
                        else
                        {
                            if( !bAbort )//  && !DeskletIsVisible(m_hWnd) )
                            {
                                DeskletFadeIn(m_hWnd, FALSE, -1);
                                AtlTrace("Revealed!\n");
                            }
                        }
                    }
                }
            }
            if( chg || bPrev != bNew )
            {
                chg = TRUE;
                bPrev = bNew;
                wasBusy = TRUE;
                OnSize(0,0,0,bNew);
                DoUpdataData( app );
            }
        }
    }
    // bAbort
    Invoke(9, IID_NULL, 0, 0, NULL, NULL, NULL, NULL);
}

This is a small excerpt from my iTunes46 docklet, ca. 2003