ReactOS 0.4.16-dev-117-g38f21f9
buttontst.c File Reference
#include <windows.h>
Include dependency graph for buttontst.c:

Go to the source code of this file.

Macros

#define DPRINT(s)   OutputDebugStringA("BUTTONTEST: " 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 BUTTON_CLASS = "BUTTON"
 
static LPSTR TEST_WND_CLASS = "TESTWND"
 
HINSTANCE AppInstance = NULL
 

Macro Definition Documentation

◆ DPRINT

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

Definition at line 10 of file buttontst.c.

Function Documentation

◆ TestWndProc()

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

Definition at line 36 of file buttontst.c.

41{
42 switch (Msg) {
43 case WM_CREATE:
44 return WmCreate(Wnd);
45 case WM_DESTROY:
47 return 0;
48 default:
49 return DefWindowProc(Wnd, Msg, wParam, lParam);
50 }
51}
LRESULT WmCreate(HWND Wnd)
Definition: buttontst.c:15
struct @1636 Msg[]
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
#define DefWindowProc
Definition: ros2win.h:31
#define WM_CREATE
Definition: winuser.h:1611
__analysis_noreturn void WINAPI PostQuitMessage(_In_ int)
#define WM_DESTROY
Definition: winuser.h:1612

Referenced by WinMain().

◆ WinMain()

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

Definition at line 53 of file buttontst.c.

58{
60 MSG Msg;
61 HWND MainWindow;
62 WNDCLASSEX TestWndClass = {0};
63 DPRINT("Application starting up.");
64 // Remember instance handle.
66 // Register test window class.
67 TestWndClass.cbSize = sizeof(WNDCLASSEX);
68 TestWndClass.lpfnWndProc = &TestWndProc;
69 TestWndClass.hInstance = AppInstance;
70 TestWndClass.hCursor = LoadCursor(0, (LPCTSTR)IDC_ARROW);
71 TestWndClass.hbrBackground = CreateSolidBrush(RGB(255,255,230));
72 TestWndClass.lpszClassName = TEST_WND_CLASS;
73 Result = RegisterClassEx(&TestWndClass);
74 if (Result == 0) {
75 DPRINT("Error registering class.");
76 MessageBox(0, "Error registering test window class.",
77 "Button control test", MB_ICONSTOP | MB_OK);
78 ExitProcess(0);
79 }
80 // Create main window.
81 DPRINT("Creating main window.");
83 TEST_WND_CLASS, "Button test",
84 WS_OVERLAPPEDWINDOW, 50, 50, 180, 365,
86 if (MainWindow == 0) {
87 DPRINT("Error creating main window.");
89 MessageBox(0, "Error creating test window.",
90 "Static control test", MB_ICONSTOP | MB_OK);
91 ExitProcess(0);
92 }
93 DPRINT("Showing main window.");
94 ShowWindow(MainWindow, SW_SHOWNORMAL);
95 UpdateWindow(MainWindow);
96 // Run message loop.
97 DPRINT("Entering message loop.");
98 while (GetMessage(&Msg, NULL, 0, 0) > 0) {
101 }
102 // Unregister window class.
104 DPRINT("Exiting.");
105
106 return Msg.wParam;
107}
HINSTANCE AppInstance
Definition: buttontst.c:13
static LPSTR TEST_WND_CLASS
Definition: buttontst.c:5
LRESULT CALLBACK TestWndProc(HWND Wnd, UINT Msg, WPARAM wParam, LPARAM lParam)
Definition: buttontst.c:36
#define DPRINT(s)
Definition: buttontst.c:10
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 hInstance
Definition: winuser.h:3209
HCURSOR hCursor
Definition: winuser.h:3211
UINT cbSize
Definition: winuser.h:3204
WNDPROC lpfnWndProc
Definition: winuser.h:3206
LPCSTR lpszClassName
Definition: winuser.h:3214
HBRUSH hbrBackground
Definition: winuser.h:3212
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1829
#define GetModuleHandle
Definition: winbase.h:3827
HBRUSH WINAPI CreateSolidBrush(_In_ COLORREF)
#define SW_SHOWNORMAL
Definition: winuser.h:773
#define CreateWindowEx
Definition: winuser.h:5767
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:5873
#define GetMessage
Definition: winuser.h:5802
#define RegisterClassEx
Definition: winuser.h:5849
BOOL WINAPI UpdateWindow(_In_ HWND)
#define LoadCursor
Definition: winuser.h:5824
WNDCLASSEXA WNDCLASSEX
Definition: winuser.h:5731
#define MB_OK
Definition: winuser.h:793
#define MessageBox
Definition: winuser.h:5834
#define MB_ICONSTOP
Definition: winuser.h:806
#define WS_EX_CLIENTEDGE
Definition: winuser.h:384
#define DispatchMessage
Definition: winuser.h:5777
_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 buttontst.c.

17{
18 DPRINT("WM_CREATE (enter).");
19 DPRINT("test 1");
21 10, 10, 150, 30, Wnd, NULL, AppInstance, NULL);
22 DPRINT("test 2");
24 10, 40, 150, 30, Wnd, NULL, AppInstance, NULL);
25 DPRINT("test 3");
27 10, 70, 150, 30, Wnd, NULL, AppInstance, NULL);
28 DPRINT("test 4");
30 10, 100, 150, 30, Wnd, NULL, AppInstance, NULL);
31
32 DPRINT("WM_CREATE (leave).");
33 return 0;
34}
static LPSTR BUTTON_CLASS
Definition: buttontst.c:4
#define BS_AUTORADIOBUTTON
Definition: pedump.c:660
#define WS_CHILD
Definition: pedump.c:617
#define WS_VISIBLE
Definition: pedump.c:620
#define BS_AUTOCHECKBOX
Definition: pedump.c:654
#define BS_PUSHBUTTON
Definition: pedump.c:651
#define BS_DEFPUSHBUTTON
Definition: pedump.c:652

Referenced by TestWndProc().

Variable Documentation

◆ AppInstance

HINSTANCE AppInstance = NULL

Definition at line 13 of file buttontst.c.

Referenced by WinMain(), and WmCreate().

◆ BUTTON_CLASS

LPSTR BUTTON_CLASS = "BUTTON"
static

Definition at line 4 of file buttontst.c.

Referenced by WmCreate().

◆ TEST_WND_CLASS

LPSTR TEST_WND_CLASS = "TESTWND"
static

Definition at line 5 of file buttontst.c.

Referenced by WinMain().