Wine, WineLib and "Programming Windows 95"
Last updated: 2001/2/4
Description
Demonstrates the use of a background thread to perform long calculations.
A left-click starts the background thread and a right-click stops it.
Wine tests
Winelib tests
Tested API
- GDI32
GetStockObject
- KERNEL32
CloseHandle, CreateThread, DeleteCriticalSection, EnterCriticalSection, ExitProcess, ExitThread, FlushFileBuffers, FreeEnvironmentStringsA, FreeEnvironmentStringsW, GetACP, GetCPInfo, GetCommandLineA, GetCurrentThreadId, GetEnvironmentStrings, GetEnvironmentStringsW, GetFileType, GetLastError, GetModuleFileNameA, GetModuleHandleA, GetOEMCP, GetProcAddress, GetStartupInfoA, GetStdHandle, GetStringTypeA, GetStringTypeW, GetTickCount, GetVersion, HeapAlloc, HeapCreate, HeapFree, InitializeCriticalSection, LCMapStringA, LCMapStringW, LeaveCriticalSection, LoadLibraryA, MultiByteToWideChar, RaiseException, ResumeThread, RtlUnwind, SetFilePointer, SetHandleCount, SetLastError, SetStdHandle, TlsAlloc, TlsGetValue, TlsSetValue, UnhandledExceptionFilter, WideCharToMultiByte, WriteFile
- USER32
BeginPaint, CreateWindowExA, DefWindowProcA, DispatchMessageA, DrawTextA, EndPaint, GetClientRect, GetMessageA, InvalidateRect, LoadCursorA, LoadIconA, MessageBeep, PostQuitMessage, RegisterClassExA, SendMessageA, ShowWindow, TranslateMessage, UpdateWindow, wsprintfA
Last updated: 2003/5/4
Description
Same as bigjob1 but instead of communicating with the background thread
via a shared boolean variable, bigjob2 uses an Event object.
Wine tests
- Works just like on Windows.
Winelib tests
Tested API
- GDI32
GetStockObject
- KERNEL32
CloseHandle, CreateEventA, CreateThread, DeleteCriticalSection, EnterCriticalSection, ExitProcess, ExitThread, FlushFileBuffers, FreeEnvironmentStringsA, FreeEnvironmentStringsW, GetACP, GetCPInfo, GetCommandLineA, GetCurrentThreadId, GetEnvironmentStrings, GetEnvironmentStringsW, GetFileType, GetLastError, GetModuleFileNameA, GetModuleHandleA, GetOEMCP, GetProcAddress, GetStartupInfoA, GetStdHandle, GetStringTypeA, GetStringTypeW, GetTickCount, GetVersion, HeapAlloc, HeapCreate, HeapFree, InitializeCriticalSection, LCMapStringA, LCMapStringW, LeaveCriticalSection, LoadLibraryA, MultiByteToWideChar, RaiseException, ResumeThread, RtlUnwind, SetEvent, SetFilePointer, SetHandleCount, SetLastError, SetStdHandle, TlsAlloc, TlsGetValue, TlsSetValue, UnhandledExceptionFilter, WaitForSingleObject, WideCharToMultiByte, WriteFile
- USER32
BeginPaint, CreateWindowExA, DefWindowProcA, DispatchMessageA, DrawTextA, EndPaint, GetClientRect, GetMessageA, InvalidateRect, LoadCursorA, LoadIconA, MessageBeep, PostQuitMessage, RegisterClassExA, SendMessageA, ShowWindow, TranslateMessage, UpdateWindow, wsprintfA
Last updated: 2001/2/4
Description
Simulates multi-threading by using a timer. Creates a window which is
divided into four parts. From top left to bottom right, these contain: an
increasing series of numbers, the list of prime numbers, the fibonacci
series (which they quickly wrap to zero), and circle of a random radius.
Wine tests
- Works too slowly. I don't think it's because the
implementation is inefficient because the program's CPU use is almost 0
and its clocked by the timer anyway. So I think there is a problem with
the rate of the timer events.
Winelib tests
Tested API
- GDI32
Ellipse, GetStockObject, TextOutA
- KERNEL32
CloseHandle, ExitProcess, FlushFileBuffers, FreeEnvironmentStringsA, FreeEnvironmentStringsW, GetACP, GetCPInfo, GetCommandLineA, GetEnvironmentStrings, GetEnvironmentStringsW, GetFileType, GetLastError, GetModuleFileNameA, GetModuleHandleA, GetOEMCP, GetProcAddress, GetStartupInfoA, GetStdHandle, GetStringTypeA, GetStringTypeW, GetVersion, HeapAlloc, HeapCreate, HeapFree, LCMapStringA, LCMapStringW, LoadLibraryA, MultiByteToWideChar, RaiseException, RtlUnwind, SetFilePointer, SetHandleCount, SetStdHandle, UnhandledExceptionFilter, WideCharToMultiByte, WriteFile
- USER32
CreateWindowExA, DefWindowProcA, DestroyWindow, DispatchMessageA, GetDC, GetDialogBaseUnits, GetMessageA, GetWindowLongA, InvalidateRect, KillTimer, LoadCursorA, LoadIconA, MoveWindow, PostQuitMessage, RegisterClassExA, ReleaseDC, SendMessageA, SetTimer, ShowWindow, TranslateMessage, UpdateWindow, wsprintfA
Last updated: 2003/5/4
Description
Same as multi1 but based on threads. Note that when you move the window
the processing continues, eventhough the display may no longer be updated.
That's because moving the window only suspends the first thread, the one
with the message loop - the one which was doing all the work in multi1, and
not the other threads.
Wine tests
Winelib tests
Tested API
- GDI32
Ellipse, GetStockObject, TextOutA
- KERNEL32
CloseHandle, CreateThread, DeleteCriticalSection, EnterCriticalSection, ExitProcess, ExitThread, FlushFileBuffers, FreeEnvironmentStringsA, FreeEnvironmentStringsW, GetACP, GetCPInfo, GetCommandLineA, GetCurrentThreadId, GetEnvironmentStrings, GetEnvironmentStringsW, GetFileType, GetLastError, GetModuleFileNameA, GetModuleHandleA, GetOEMCP, GetProcAddress, GetStartupInfoA, GetStdHandle, GetStringTypeA, GetStringTypeW, GetVersion, HeapAlloc, HeapCreate, HeapFree, InitializeCriticalSection, LCMapStringA, LCMapStringW, LeaveCriticalSection, LoadLibraryA, MultiByteToWideChar, RaiseException, ResumeThread, RtlUnwind, SetFilePointer, SetHandleCount, SetLastError, SetStdHandle, TlsAlloc, TlsGetValue, TlsSetValue, UnhandledExceptionFilter, WideCharToMultiByte, WriteFile
- USER32
CreateWindowExA, DefWindowProcA, DestroyWindow, DispatchMessageA, GetDC, GetDialogBaseUnits, GetMessageA, GetWindowLongA, InvalidateRect, LoadCursorA, LoadIconA, MoveWindow, PostQuitMessage, RegisterClassExA, ReleaseDC, ShowWindow, TranslateMessage, UpdateWindow, wsprintfA
Last updated: 2003/5/4
Description
Same as the randrect example in chapter 4 (displays random rectangles in
a window) but with a separate thread to handle drawing the rectangles.
Wine tests
Winelib tests
Tested API
- GDI32
CreateSolidBrush, DeleteObject, GetStockObject, Rectangle, SelectObject
- KERNEL32
CloseHandle, CreateThread, DeleteCriticalSection, EnterCriticalSection, ExitProcess, ExitThread, FlushFileBuffers, FreeEnvironmentStringsA, FreeEnvironmentStringsW, GetACP, GetCPInfo, GetCommandLineA, GetCurrentThreadId, GetEnvironmentStrings, GetEnvironmentStringsW, GetFileType, GetLastError, GetModuleFileNameA, GetModuleHandleA, GetOEMCP, GetProcAddress, GetStartupInfoA, GetStdHandle, GetVersion, HeapAlloc, HeapCreate, HeapFree, InitializeCriticalSection, LeaveCriticalSection, LoadLibraryA, ResumeThread, RtlUnwind, SetFilePointer, SetHandleCount, SetLastError, SetStdHandle, TlsAlloc, TlsGetValue, TlsSetValue, UnhandledExceptionFilter, WideCharToMultiByte, WriteFile
- USER32
CreateWindowExA, DefWindowProcA, DispatchMessageA, GetDC, GetMessageA, LoadCursorA, LoadIconA, PostQuitMessage, RegisterClassExA, ReleaseDC, ShowWindow, TranslateMessage, UpdateWindow