ReactOS 0.4.15-dev-7842-g558ab78
statst.c File Reference
#include <windows.h>
Include dependency graph for statst.c:

Go to the source code of this file.

Macros

#define DPRINT(s)   OutputDebugStringA("STATICTEST: " s "\n")
 

Functions

LRESULT WmCreate (HWND Wnd)
 
LRESULT CALLBACK TestWndProc (HWND Wnd, UINT Msg, WPARAM wParam, LPARAM lParam)
 
int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd)
 

Variables

static LPSTR STATIC_CLASS = "STATIC"
 
static LPSTR TEST_WND_CLASS = "TESTWND"
 
HINSTANCE AppInstance = NULL
 

Macro Definition Documentation

◆ DPRINT

#define DPRINT (   s)    OutputDebugStringA("STATICTEST: " s "\n")

Definition at line 10 of file statst.c.

Function Documentation

◆ TestWndProc()

LRESULT CALLBACK TestWndProc ( HWND  Wnd,
UINT  Msg,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 94 of file statst.c.

99{
100 switch (Msg) {
101 case WM_CREATE:
102 return WmCreate(Wnd);
103 case WM_DESTROY:
105 return 0;
106 default:
107 return DefWindowProc(Wnd, Msg, wParam, lParam);
108 }
109}
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
struct @1627 Msg[]
#define DefWindowProc
Definition: ros2win.h:31
LRESULT WmCreate(HWND Wnd)
Definition: statst.c:15
#define WM_CREATE
Definition: winuser.h:1608
__analysis_noreturn void WINAPI PostQuitMessage(_In_ int)
#define WM_DESTROY
Definition: winuser.h:1609

Referenced by WinMain().

◆ WinMain()

int WINAPI WinMain ( HINSTANCE  hInstance,
HINSTANCE  hPrevInstance,
LPSTR  lpCmdLine,
int  nShowCmd 
)

Definition at line 111 of file statst.c.

116{
117 ATOM Result;
118 MSG Msg;
119 HWND MainWindow;
120 WNDCLASSEX TestWndClass = {0};
121 DPRINT("Application starting up.");
122 // Remember instance handle.
124 // Register test window class.
125 TestWndClass.cbSize = sizeof(WNDCLASSEX);
126 TestWndClass.lpfnWndProc = &TestWndProc;
127 TestWndClass.hInstance = AppInstance;
128 TestWndClass.hCursor = LoadCursor(0, (LPCTSTR)IDC_ARROW);
129 TestWndClass.hbrBackground = CreateSolidBrush(RGB(255,255,230));
130 TestWndClass.lpszClassName = TEST_WND_CLASS;
131 Result = RegisterClassEx(&TestWndClass);
132 if (Result == 0) {
133 DPRINT("Error registering class.");
134 MessageBox(0, "Error registering test window class.",
135 "Static control test", MB_ICONSTOP | MB_OK);
136 ExitProcess(0);
137 }
138 // Create main window.
139 DPRINT("Creating main window.");
141 TEST_WND_CLASS, "Static control test",
142 WS_OVERLAPPEDWINDOW, 50, 50, 245, 365,
144 if (MainWindow == 0) {
145 DPRINT("Error creating main window.");
147 MessageBox(0, "Error creating test window.",
148 "Static control test", MB_ICONSTOP | MB_OK);
149 ExitProcess(0);
150 }
151 DPRINT("Showing main window.");
152 ShowWindow(MainWindow, SW_SHOWNORMAL);
153 UpdateWindow(MainWindow);
154 // Run message loop.
155 DPRINT("Entering message loop.");
156 while (GetMessage(&Msg, NULL, 0, 0) > 0) {
159 }
160 // Unregister window class.
162 DPRINT("Exiting.");
163
164 return Msg.wParam;
165}
WORD ATOM
Definition: dimm.idl:113
#define NULL
Definition: types.h:112
VOID WINAPI ExitProcess(IN UINT uExitCode)
Definition: proc.c:1487
#define RGB(r, g, b)
Definition: precomp.h:71
#define WS_OVERLAPPEDWINDOW
Definition: pedump.c:637
HINSTANCE AppInstance
Definition: statst.c:13
static LPSTR TEST_WND_CLASS
Definition: statst.c:5
LRESULT CALLBACK TestWndProc(HWND Wnd, UINT Msg, WPARAM wParam, LPARAM lParam)
Definition: statst.c:94
#define DPRINT(s)
Definition: statst.c:10
HINSTANCE hInstance
Definition: winuser.h:3206
HCURSOR hCursor
Definition: winuser.h:3208
UINT cbSize
Definition: winuser.h:3201
WNDPROC lpfnWndProc
Definition: winuser.h:3203
LPCSTR lpszClassName
Definition: winuser.h:3211
HBRUSH hbrBackground
Definition: winuser.h:3209
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1829
#define GetModuleHandle
Definition: winbase.h:3762
HBRUSH WINAPI CreateSolidBrush(_In_ COLORREF)
#define SW_SHOWNORMAL
Definition: winuser.h:770
#define CreateWindowEx
Definition: winuser.h:5755
BOOL WINAPI TranslateMessage(_In_ const MSG *)
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
#define WS_EX_APPWINDOW
Definition: winuser.h:383
#define IDC_ARROW
Definition: winuser.h:687
#define UnregisterClass
Definition: winuser.h:5861
#define GetMessage
Definition: winuser.h:5790
#define RegisterClassEx
Definition: winuser.h:5837
BOOL WINAPI UpdateWindow(_In_ HWND)
#define LoadCursor
Definition: winuser.h:5812
WNDCLASSEXA WNDCLASSEX
Definition: winuser.h:5719
#define MB_OK
Definition: winuser.h:790
#define MessageBox
Definition: winuser.h:5822
#define MB_ICONSTOP
Definition: winuser.h:803
#define WS_EX_CLIENTEDGE
Definition: winuser.h:384
#define DispatchMessage
Definition: winuser.h:5765
_At_(*)(_In_ PWSK_CLIENT Client, _In_opt_ PUNICODE_STRING NodeName, _In_opt_ PUNICODE_STRING ServiceName, _In_opt_ ULONG NameSpace, _In_opt_ GUID *Provider, _In_opt_ PADDRINFOEXW Hints, _Outptr_ PADDRINFOEXW *Result, _In_opt_ PEPROCESS OwningProcess, _In_opt_ PETHREAD OwningThread, _Inout_ PIRP Irp Result)(Mem)) NTSTATUS(WSKAPI *PFN_WSK_GET_ADDRESS_INFO
Definition: wsk.h:409
const CHAR * LPCTSTR
Definition: xmlstorage.h:193

◆ WmCreate()

LRESULT WmCreate ( HWND  Wnd)

Definition at line 15 of file statst.c.

17{
18 UCHAR i;
19 DPRINT("WM_CREATE (enter).");
20 // Test 1 - black rectangle.
21 DPRINT("test 1");
23 10, 10, 100, 20, Wnd, NULL, AppInstance, NULL);
24 // Test 2 - black frame.
25 DPRINT("test 2");
27 10, 40, 100, 20, Wnd, NULL, AppInstance, NULL);
28 // Test 3 - gray rectangle.
29 DPRINT("test 3");
31 10, 70, 100, 20, Wnd, NULL, AppInstance, NULL);
32 // Test 4 - gray frame.
33 DPRINT("test 4");
35 10, 100, 100, 20, Wnd, NULL, AppInstance, NULL);
36 // Test 5 - left-aligned text.
37 DPRINT("test 5");
39 "&Left-aligned text &static control window",
41 10, 130, 100, 50, Wnd, NULL, AppInstance, NULL);
42 // Test 6 - right-aligned text.
43 DPRINT("test 6");
45 "&Right-aligned text &static control window",
47 10, 185, 100, 50, Wnd, NULL, AppInstance, NULL);
48 // Test 7 - centered text.
49 DPRINT("test 7");
51 "&Centered text &static control window",
53 10, 240, 100, 50, Wnd, NULL, AppInstance, NULL);
54 // Test 8 - left-aligned text with no word wrap and no prefixes.
55 DPRINT("test 8");
57 "&No prefix and no word wrapping",
59 10, 295, 100, 20, Wnd, NULL, AppInstance, NULL);
60 // Test 9 - white rectangle.
61 DPRINT("test 9");
63 120, 10, 100, 20, Wnd, NULL, AppInstance, NULL);
64 // Test 10 - white frame.
65 DPRINT("test 10");
67 120, 40, 100, 20, Wnd, NULL, AppInstance, NULL);
68 // Test 11 - etched frame.
69 DPRINT("test 11");
71 | SS_ETCHEDFRAME, 120, 70, 100, 20, Wnd, NULL, AppInstance, NULL);
72 // Test 12 - etched horizontal lines.
73 DPRINT("test 12");
74 for (i = 0; i < 5; ++i)
76 | SS_ETCHEDHORZ, 120, 100 + (4L * i), 100, 4, Wnd,
78 // Test 13 - etched vertical lines.
79 DPRINT("test 13");
80 for (i = 0; i < 25; ++i)
82 | SS_ETCHEDVERT, 120 + (4L * i), 130, 4, 20, Wnd,
84 // Test 14 - sunken border.
85 DPRINT("test 14");
87 "Sunken frame and word ellipsis",
89 120, 160, 100, 20, Wnd, NULL, AppInstance, NULL);
90 DPRINT("WM_CREATE (leave).");
91 return 0;
92}
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
Definition: glfuncs.h:248
#define SS_WHITERECT
Definition: pedump.c:698
#define SS_WHITEFRAME
Definition: pedump.c:701
#define WS_CHILD
Definition: pedump.c:617
#define SS_BLACKRECT
Definition: pedump.c:696
#define SS_RIGHT
Definition: pedump.c:694
#define WS_VISIBLE
Definition: pedump.c:620
#define SS_GRAYFRAME
Definition: pedump.c:700
#define SS_LEFTNOWORDWRAP
Definition: pedump.c:703
#define SS_CENTER
Definition: pedump.c:693
#define SS_LEFT
Definition: pedump.c:692
#define SS_GRAYRECT
Definition: pedump.c:697
#define SS_BLACKFRAME
Definition: pedump.c:699
static LPSTR STATIC_CLASS
Definition: statst.c:4
#define SS_ETCHEDFRAME
Definition: winuser.h:342
#define SS_NOPREFIX
Definition: winuser.h:350
#define SS_ETCHEDHORZ
Definition: winuser.h:343
#define SS_ETCHEDVERT
Definition: winuser.h:344
#define SS_WORDELLIPSIS
Definition: winuser.h:365
#define SS_SUNKEN
Definition: winuser.h:358
unsigned char UCHAR
Definition: xmlstorage.h:181

Referenced by TestWndProc().

Variable Documentation

◆ AppInstance

HINSTANCE AppInstance = NULL

Definition at line 13 of file statst.c.

Referenced by WinMain(), and WmCreate().

◆ STATIC_CLASS

LPSTR STATIC_CLASS = "STATIC"
static

Definition at line 4 of file statst.c.

Referenced by WmCreate().

◆ TEST_WND_CLASS

LPSTR TEST_WND_CLASS = "TESTWND"
static

Definition at line 5 of file statst.c.

Referenced by WinMain().