ReactOS 0.4.15-dev-7677-g8209aa5
guithreadinfo.c File Reference
#include <windows.h>
#include <stdio.h>
#include <string.h>
Include dependency graph for guithreadinfo.c:

Go to the source code of this file.

Functions

LRESULT WINAPI MainWndProc (HWND, UINT, WPARAM, LPARAM)
 
int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpszCmdLine, int nCmdShow)
 

Variables

static GUITHREADINFO gti
 

Function Documentation

◆ MainWndProc()

LRESULT WINAPI MainWndProc ( HWND  hWnd,
UINT  msg,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 75 of file guithreadinfo.c.

76{
77 PAINTSTRUCT ps;
78 HDC hDC;
79 char str[255];
80
81 switch(msg)
82 {
83
84 case WM_PAINT:
85 hDC = BeginPaint(hWnd, &ps);
86 wsprintf(str, "flags: ");
87 if(gti.flags & GUI_16BITTASK) lstrcat(str, "GUI_16BITTASK ");
88 if(gti.flags & GUI_CARETBLINKING) lstrcat(str, "GUI_CARETBLINKING ");
89 if(gti.flags & GUI_INMENUMODE) lstrcat(str, "GUI_INMENUMODE ");
90 if(gti.flags & GUI_INMOVESIZE) lstrcat(str, "GUI_INMOVESIZE ");
91 if(gti.flags & GUI_POPUPMENUMODE) lstrcat(str, "GUI_POPUPMENUMODE ");
92 if(gti.flags & GUI_SYSTEMMENUMODE) lstrcat(str, "GUI_SYSTEMMENUMODE ");
93 TextOut(hDC, 10, 10, str, strlen(str));
94
95 wsprintf(str, "hwndActive == %08X", gti.hwndActive);
96 TextOut(hDC, 10, 30, str, strlen(str));
97 wsprintf(str, "hwndFocus == %08X", gti.hwndFocus);
98 TextOut(hDC, 10, 50, str, strlen(str));
99 wsprintf(str, "hwndCapture == %08X", gti.hwndCapture);
100 TextOut(hDC, 10, 70, str, strlen(str));
101 wsprintf(str, "hwndMenuOwner == %08X", gti.hwndMenuOwner);
102 TextOut(hDC, 10, 90, str, strlen(str));
103 wsprintf(str, "hwndMoveSize == %08X", gti.hwndMoveSize);
104 TextOut(hDC, 10, 110, str, strlen(str));
105 wsprintf(str, "hwndCaret == %08X", gti.hwndCaret);
106 TextOut(hDC, 10, 130, str, strlen(str));
107 wsprintf(str, "rcCaret == (%lu, %lu, %lu, %lu)", gti.rcCaret.left, gti.rcCaret.top, gti.rcCaret.right, gti.rcCaret.bottom);
108 TextOut(hDC, 10, 150, str, strlen(str));
109
110 wsprintf(str, "GetGuiResources for the current process: %08X", GetCurrentProcess());
111 TextOut(hDC, 10, 180, str, strlen(str));
112 wsprintf(str, "GetGuiResources: GR_GDIOBJECTS == %04X", GetGuiResources(GetCurrentProcess(), GR_GDIOBJECTS));
113 TextOut(hDC, 10, 200, str, strlen(str));
114 wsprintf(str, "GetGuiResources: GR_USEROBJECTS == %04x", GetGuiResources(GetCurrentProcess(), GR_USEROBJECTS));
115 TextOut(hDC, 10, 220, str, strlen(str));
116 EndPaint(hWnd, &ps);
117 break;
118
119 case WM_TIMER:
122 break;
123
124 case WM_DESTROY:
126 break;
127
128 default:
130 }
131 return 0;
132}
static HDC hDC
Definition: 3dtext.c:33
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
#define msg(x)
Definition: auth_time.c:54
HWND hWnd
Definition: settings.c:17
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define GetCurrentProcess()
Definition: compat.h:759
static GUITHREADINFO gti
Definition: guithreadinfo.c:5
static HDC
Definition: imagelist.c:92
EXTINLINE DWORD WINAPI GetGuiResources(HANDLE hProcess, DWORD uiFlags)
Definition: ntwrapper.h:64
#define DefWindowProc
Definition: ros2win.h:31
const WCHAR * str
HWND hwndCaret
Definition: winable.h:77
HWND hwndFocus
Definition: winable.h:73
HWND hwndMenuOwner
Definition: winable.h:75
HWND hwndMoveSize
Definition: winable.h:76
HWND hwndCapture
Definition: winable.h:74
HWND hwndActive
Definition: winable.h:72
LONG right
Definition: windef.h:308
LONG bottom
Definition: windef.h:309
LONG top
Definition: windef.h:307
LONG left
Definition: windef.h:306
#define GUI_POPUPMENUMODE
Definition: winable.h:31
#define GUI_SYSTEMMENUMODE
Definition: winable.h:30
#define GUI_INMENUMODE
Definition: winable.h:29
#define GUI_CARETBLINKING
Definition: winable.h:27
#define GUI_INMOVESIZE
Definition: winable.h:28
BOOL WINAPI GetGUIThreadInfo(DWORD, LPGUITHREADINFO)
Definition: ntwrapper.h:398
#define lstrcat
Definition: winbase.h:3806
#define TextOut
Definition: wingdi.h:4483
#define WM_PAINT
Definition: winuser.h:1619
__analysis_noreturn void WINAPI PostQuitMessage(_In_ int)
#define WM_TIMER
Definition: winuser.h:1741
BOOL WINAPI EndPaint(_In_ HWND, _In_ const PAINTSTRUCT *)
#define wsprintf
Definition: winuser.h:5864
#define WM_DESTROY
Definition: winuser.h:1608
BOOL WINAPI InvalidateRect(_In_opt_ HWND, _In_opt_ LPCRECT, _In_ BOOL)
HDC WINAPI BeginPaint(_In_ HWND, _Out_ LPPAINTSTRUCT)

Referenced by WinMain().

◆ WinMain()

int WINAPI WinMain ( HINSTANCE  hInstance,
HINSTANCE  hPrevInstance,
LPSTR  lpszCmdLine,
int  nCmdShow 
)

Definition at line 10 of file guithreadinfo.c.

14{
15 WNDCLASS wc;
16 MSG msg;
17 HWND hWnd;
18
19 wc.lpszClassName = "GuiThreadInfoClass";
26 wc.lpszMenuName = NULL;
27 wc.cbClsExtra = 0;
28 wc.cbWndExtra = 0;
29 if (RegisterClass(&wc) == 0)
30 {
31 fprintf(stderr, "RegisterClass failed (last error 0x%lX)\n",
32 GetLastError());
33 return(1);
34 }
35
36 hWnd = CreateWindow("GuiThreadInfoClass",
37 "GetGUIThreadInfo",
39 0,
40 0,
43 NULL,
44 NULL,
46 NULL);
47 if (hWnd == NULL)
48 {
49 fprintf(stderr, "CreateWindow failed (last error 0x%lX)\n",
50 GetLastError());
51 return(1);
52 }
53
54 //tf = CreateFontA(14, 0, 0, TA_BASELINE, FW_NORMAL, FALSE, FALSE, FALSE,
55 // ANSI_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS,
56 // DEFAULT_QUALITY, FIXED_PITCH|FF_DONTCARE, "Timmons");
57
58 gti.cbSize = sizeof(GUITHREADINFO);
60
61 SetTimer(hWnd, 1, 1000, NULL);
62 ShowWindow(hWnd, nCmdShow);
63
64 while(GetMessage(&msg, NULL, 0, 0))
65 {
68 }
69
70 //DeleteObject(tf);
71
72 return msg.wParam;
73}
HINSTANCE hInstance
Definition: charmap.c:19
LRESULT WINAPI MainWndProc(HWND, UINT, WPARAM, LPARAM)
Definition: guithreadinfo.c:75
#define stderr
Definition: stdio.h:100
_Check_return_opt_ _CRTIMP int __cdecl fprintf(_Inout_ FILE *_File, _In_z_ _Printf_format_string_ const char *_Format,...)
#define WS_OVERLAPPEDWINDOW
Definition: pedump.c:637
#define WS_VSCROLL
Definition: pedump.c:627
#define WS_HSCROLL
Definition: pedump.c:628
HBRUSH hbrBackground
Definition: winuser.h:3169
HICON hIcon
Definition: winuser.h:3167
HINSTANCE hInstance
Definition: winuser.h:3166
HCURSOR hCursor
Definition: winuser.h:3168
int cbWndExtra
Definition: winuser.h:3165
UINT style
Definition: winuser.h:3162
LPCSTR lpszMenuName
Definition: winuser.h:3170
LPCSTR lpszClassName
Definition: winuser.h:3171
WNDPROC lpfnWndProc
Definition: winuser.h:3163
int cbClsExtra
Definition: winuser.h:3164
DWORD cbSize
Definition: winable.h:70
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1829
struct tagGUITHREADINFO GUITHREADINFO
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
HGDIOBJ WINAPI GetStockObject(_In_ int)
#define GRAY_BRUSH
Definition: wingdi.h:898
#define CS_VREDRAW
Definition: winuser.h:658
BOOL WINAPI TranslateMessage(_In_ const MSG *)
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
#define CS_HREDRAW
Definition: winuser.h:653
#define IDC_ARROW
Definition: winuser.h:687
UINT_PTR WINAPI SetTimer(_In_opt_ HWND, _In_ UINT_PTR, _In_ UINT, _In_opt_ TIMERPROC)
#define IDI_APPLICATION
Definition: winuser.h:704
#define CreateWindow
Definition: winuser.h:5753
#define GetMessage
Definition: winuser.h:5789
#define LoadIcon
Definition: winuser.h:5812
#define LoadCursor
Definition: winuser.h:5811
#define CW_USEDEFAULT
Definition: winuser.h:225
#define RegisterClass
Definition: winuser.h:5835
#define DispatchMessage
Definition: winuser.h:5764
const CHAR * LPCTSTR
Definition: xmlstorage.h:193

Variable Documentation

◆ gti

GUITHREADINFO gti
static

Definition at line 5 of file guithreadinfo.c.

Referenced by MainWndProc(), test_capture_4_proc(), and WinMain().