home *** CD-ROM | disk | FTP | other *** search
- /* EXAMPLE1.c -- ProView Tutorial example */
-
- #include <windows.h>
- #include <time.h>
- #include "pv.h"
- #include "Example2.h"
-
- /* Handles to View and View Window */
- VIEW Example2;
- HWND hWndExample2;
-
- int PASCAL WinMain(hInstance, hPrevInstance, lpszCmdLine, nCmdShow)
- HANDLE hInstance, hPrevInstance;
- LPSTR lpszCmdLine;
- int nCmdShow;
- {
- static char szAppName[] = "Example2";
- MSG msg;
-
- lpfnMakeLongPointer = MakeProcInstance(MakeLongPointer, hInstance);
-
- Example2 = vwOpenView(hInstance, NULL, WS_POPUP | WS_VISIBLE | WS_DLGFRAME,
- NULL,
- NULL,
- lpfnMakeLongPointer);
-
- vwSetField(Example2, "String", "", WS_CHILD | WS_BORDER, 87, 16, 65, 12, Filename, NULL);
- vwSetField(Example2, "button", "Okay", WS_CHILD | BS_DEFPUSHBUTTON | BS_OKAY, 64, 48, 46, 16, NULL, NULL);
- vwSetField(Example2, "button", "Cancel", WS_CHILD | BS_PUSHBUTTON | BS_CANCEL, 141, 49, 46, 16, NULL, NULL);
-
- vwSetTextField(Example2, 25, 16, "Enter Filename", NULL);
-
- vwSetFieldString(Example2, 1, "@ALPHA, @MND, @MSG(Please enter filename);");
-
- vwSetViewPosition(Example2, 67, 52, 242, 121, VW_DLGCOORD);
-
- hWndExample2 = vwShowView(Example2);
-
- while(GetMessage(&msg, NULL, 0, 0))
- {
- TranslateMessage(&msg);
- DispatchMessage(&msg);
- }
- FreeProcInstance(MakeLongPointer);
-
- return msg.wParam;
- }
-
- BOOL FAR PASCAL MakeLongPointer()
- {
- static void far *Ptr;
- Ptr = &Ptr;
- return(HIWORD(Ptr));
- }
-