home *** CD-ROM | disk | FTP | other *** search
- // OSCustom.cpp Copyright (c) 1996 Celtech Software
- //
- // Registered users may use this code to create custom DLLs that work with
- // O'Setup during the installation process.
- //
- // This example project was created using Visual C++ 4.00
-
- #include <windows.h>
-
- HWND hParentWindow;
-
- int FAR PASCAL ExampleDLLFunc(HWND hParent, LPCSTR lpParam)
- {
- //save the setup main window handle
- hParentWindow = hParent;
-
- //build a string for message box
- char* pMsg = new char[256];
- strcpy(pMsg, "Parameter=");
- strcat(pMsg, lpParam);
-
- //show string
- MessageBox(hParentWindow, pMsg, "DLL Function", MB_OK);
-
- //create buffer for return values to O'Setup
- //return values are accessed with the %R variable
- HGLOBAL hClip = GlobalAlloc(GMEM_FIXED, 1024);
- if(hClip)
- {
- //get pointer to buffer
- char far* pClip = (char far*)GlobalLock(hClip);
- if(pClip)
- {
- //build series of values in the format:
- // key=value
- // key=value
- // key=value
- //key/value pairs are separated by return characters
- strcpy(pClip, "Value1=This is value 1\rValue2=This is value 2");
- GlobalUnlock(hClip);
-
- //set values to unique clipboard format
- if(OpenClipboard(hParentWindow))
- {
- SetClipboardData(RegisterClipboardFormat("OSETUP_RETURN_VALUES"), hClip);
- CloseClipboard();
- }
- }
- }
-
- return 1;
- }
-