3 LRESULT CALLBACK _export
WndProc(HWND hWnd
, UINT message
,
4 WPARAM wParam
, LPARAM lParam
);
6 BOOL CALLBACK _export
DlgProc(HWND hWnd
,UINT msg
,WPARAM wParam
,LPARAM lParam
);
10 extern char sysres_MENU_SYSMENU
[],sysres_BITMAP_WINELOGO
[],sysres_DIALOG_2
[];
12 int PASCAL
WinMain(HINSTANCE hInstance
, HINSTANCE hPrevInstance
,
13 LPSTR lpszCmdLine
, int cmdShow
)
16 WNDCLASS wcHdumpClass
;
21 // Define the window class for this application.
22 wcHdumpClass
.lpszClassName
= "WrcTestClass";
23 wcHdumpClass
.hInstance
= hInstance
;
24 wcHdumpClass
.lpfnWndProc
= WndProc
;
25 wcHdumpClass
.hCursor
= 0;
26 wcHdumpClass
.hIcon
= 0;
27 wcHdumpClass
.lpszMenuName
= 0;
28 wcHdumpClass
.hbrBackground
= GetStockObject(WHITE_BRUSH
);
29 wcHdumpClass
.style
= CS_HREDRAW
| CS_VREDRAW
;
30 wcHdumpClass
.cbClsExtra
= 0;
31 wcHdumpClass
.cbWndExtra
= 0;
32 RegisterClass(&wcHdumpClass
);
34 hWndMain
= CreateWindow("WrcTestClass","WrcTest",
36 CW_USEDEFAULT
, // x window location
38 CW_USEDEFAULT
, // cx and size
40 NULL
, // no parent for this window
41 NULL
, // use the class menu
42 hInstance
, // who created this window
43 NULL
// no parms to pass on
45 ShowWindow(hWndMain
,SW_SHOW
);
46 UpdateWindow(hWndMain
);
47 hMenu
=LoadMenuIndirect(sysres_MENU_SYSMENU
);
49 /* see Q75254 on how to create a popup menu via LoadMenuIndirect */
51 InsertMenu(dummy
,0,MF_POPUP
,hMenu
,NULL
);
52 hMenu
=GetSubMenu(dummy
,0);
54 while (GetMessage(&msg
, NULL
, NULL
, NULL
))
56 TranslateMessage(&msg
);
57 DispatchMessage(&msg
);
63 LRESULT CALLBACK _export
WndProc(HWND hWnd
, UINT message
,
64 WPARAM wParam
, LPARAM lParam
)
70 ptCurrent
=MAKEPOINT(lParam
);
71 ClientToScreen(hWnd
,&ptCurrent
);
72 TrackPopupMenu(hMenu
,0,ptCurrent
.x
,ptCurrent
.y
,0,hWnd
,0);
76 BITMAPINFO
*bm
=sysres_BITMAP_WINELOGO
;
78 bits
+=bm
->bmiHeader
.biSize
;
79 bits
+=(1<<bm
->bmiHeader
.biBitCount
)*sizeof(RGBQUAD
);
81 SetDIBitsToDevice(ps
.hdc
,0,0,bm
->bmiHeader
.biWidth
,
82 bm
->bmiHeader
.biHeight
,0,0,0,bm
->bmiHeader
.biHeight
,
83 bits
,bm
,DIB_RGB_COLORS
);
88 CreateDialogIndirect(hInst
,sysres_DIALOG_2
,hWnd
,DlgProc
);
93 default:return DefWindowProc(hWnd
,message
,wParam
,lParam
);
98 BOOL CALLBACK _export
DlgProc(HWND hWnd
,UINT msg
,WPARAM wParam
,LPARAM lParam
)