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