#include <windows.h>
#include <stdio.h>
Go to the source code of this file.
◆ PTHRDCREATEWIN
◆ THRDCREATEWIN
◆ DbgPrint()
◆ MultiWndProc()
Definition at line 154 of file multithrdwin.c.
155{
161
163 {
164 RGB(0x00, 0x00, 0x00),
165 RGB(0x80, 0x00, 0x00),
166 RGB(0x00, 0x80, 0x00),
167 RGB(0x00, 0x00, 0x80),
168 RGB(0x80, 0x80, 0x00),
169 RGB(0x80, 0x00, 0x80),
170 RGB(0x00, 0x80, 0x80),
171 RGB(0x80, 0x80, 0x80),
172 RGB(0xff, 0x00, 0x00),
173 RGB(0x00, 0xff, 0x00),
174 RGB(0x00, 0x00, 0xff),
175 RGB(0xff, 0xff, 0x00),
176 RGB(0xff, 0x00, 0xff),
177 RGB(0x00, 0xff, 0xff),
178 RGB(0xff, 0xff, 0xff)
179 };
181
183 {
192 {
194 }
196 break;
197
200 {
201 case 1:
203 break;
204 case 2:
205 case 3:
206 case 4:
208 {
209 DbgPrint(
"SendMessageTimeout() OK");
211 }
212 else
213 {
215 {
216 DbgPrint(
"SendMessageTimeout() Timeout");
218 }
219 else
220 {
221 DbgPrint(
"SendMessageTimeout() Failed");
223 }
224 }
225 break;
226 }
227 break;
228
231 break;
232
233 default:
235 }
236
237 return 0;
238}
static THRDCREATEWIN wnds[3]
VOID WINAPI DECLSPEC_HOTPATCH Sleep(IN DWORD dwMilliseconds)
DWORD WINAPI GetLastError(void)
int WINAPI FillRect(HDC, LPCRECT, HBRUSH)
HBRUSH WINAPI CreateSolidBrush(_In_ COLORREF)
#define SendMessageTimeout
__analysis_noreturn void WINAPI PostQuitMessage(_In_ int)
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
BOOL WINAPI EndPaint(_In_ HWND, _In_ const PAINTSTRUCT *)
HDC WINAPI BeginPaint(_In_ HWND, _Out_ LPPAINTSTRUCT)
Referenced by WinMain().
◆ WindowThreadProc()
Definition at line 25 of file multithrdwin.c.
26{
28 char caption[64];
30
32
34 caption,
44
46
48 {
51 return 1;
52 }
53 CreateWindow(
"BUTTON",
"Sleep",
WS_CHILD|
WS_VISIBLE|
WS_TABSTOP|
WS_GROUP|
BS_PUSHBUTTON, 10, 10, 70, 23, cw->
Window, (
PVOID)1,
hAppInstance,
NULL);
54 CreateWindow(
"BUTTON",
"1",
WS_CHILD|
WS_VISIBLE|
WS_TABSTOP|
WS_GROUP|
BS_PUSHBUTTON, 83, 10, 20, 23, cw->
Window, (
PVOID)2,
hAppInstance,
NULL);
55 CreateWindow(
"BUTTON",
"2",
WS_CHILD|
WS_VISIBLE|
WS_TABSTOP|
WS_GROUP|
BS_PUSHBUTTON, 105, 10, 20, 23, cw->
Window, (
PVOID)3,
hAppInstance,
NULL);
56 CreateWindow(
"BUTTON",
"3",
WS_CHILD|
WS_VISIBLE|
WS_TABSTOP|
WS_GROUP|
BS_PUSHBUTTON, 127, 10, 20, 23, cw->
Window, (
PVOID)4,
hAppInstance,
NULL);
58 {
61 }
62
63 return 0;
64}
_Check_return_opt_ _CRTIMP int __cdecl fprintf(_Inout_ FILE *_File, _In_z_ _Printf_format_string_ const char *_Format,...)
#define sprintf(buf, format,...)
struct _THRDCREATEWIN * PTHRDCREATEWIN
static HINSTANCE hAppInstance
static HANDLE WinCreatedEvent
BOOL WINAPI DECLSPEC_HOTPATCH SetEvent(IN HANDLE hEvent)
TW_UINT32 TW_UINT16 TW_UINT16 MSG
DWORD WINAPI GetCurrentThreadId(void)
BOOL WINAPI TranslateMessage(_In_ const MSG *)
Referenced by WinMain().
◆ WinMain()
Definition at line 67 of file multithrdwin.c.
71{
75
77
82
84 {
85 fprintf(
stderr,
"Failed to create event (last error 0x%lX)\n",
87 return 1;
88 }
89
101 {
104 return(1);
105 }
106
113
114 wnds[1].
Caption =
"Child1 of TopLevel1 (ThreadID: %d)";
120
128
130 {
132 0,
135 0,
139 {
140 fprintf(
stderr,
"CreateThread #%i failed (last error 0x%lX)\n",
142 return 1;
143 }
145 }
146
148
150
151 return 0;
152}
HANDLE WINAPI DECLSPEC_HOTPATCH CreateThread(IN LPSECURITY_ATTRIBUTES lpThreadAttributes, IN DWORD dwStackSize, IN LPTHREAD_START_ROUTINE lpStartAddress, IN LPVOID lpParameter, IN DWORD dwCreationFlags, OUT LPDWORD lpThreadId)
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
DWORD WINAPI WindowThreadProc(LPVOID lpParameter)
LRESULT WINAPI MultiWndProc(HWND, UINT, WPARAM, LPARAM)
#define WS_OVERLAPPEDWINDOW
DWORD WINAPI WaitForMultipleObjects(IN DWORD nCount, IN CONST HANDLE *lpHandles, IN BOOL bWaitAll, IN DWORD dwMilliseconds)
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
◆ hAppInstance
◆ WinCreatedEvent
◆ wnds