Ignore:
Timestamp:
Aug 30, 2002, 1:21:47 AM (23 years ago)
Author:
umoeller
Message:

Misc changes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/helpers/winh.c

    r216 r217  
    6767#define INCL_WINCIRCULARSLIDER
    6868#define INCL_WINSTDFILE
     69#define INCL_WINCLIPBOARD
    6970
    7071#define INCL_SPL
     
    47054706
    47064707/*
     4708 *@@ winhSetClipboardText:
     4709 *      sets the clipboard data to the given text,
     4710 *      replacing the current clipboard contents.
     4711 *
     4712 *@@added V0.9.21 (2002-08-28) [umoeller]
     4713 */
     4714
     4715BOOL winhSetClipboardText(HAB hab,
     4716                          PCSZ pcsz,
     4717                          ULONG cbSize)     // in: size of buffer INCLUDING null byte
     4718{
     4719    BOOL    fSuccess = FALSE;
     4720
     4721    if (WinOpenClipbrd(hab))
     4722    {
     4723        PSZ pszDest;
     4724        if (!DosAllocSharedMem((PVOID*)&pszDest,
     4725                               NULL,
     4726                               cbSize,
     4727                               PAG_WRITE | PAG_COMMIT | OBJ_GIVEABLE))
     4728        {
     4729            memcpy(pszDest,
     4730                   pcsz,
     4731                   cbSize);
     4732
     4733            WinEmptyClipbrd(hab);
     4734
     4735            fSuccess = WinSetClipbrdData(hab,       // anchor-block handle
     4736                                         (ULONG)pszDest, // pointer to text data
     4737                                         CF_TEXT,        // data is in text format
     4738                                         CFI_POINTER);   // passing a pointer
     4739
     4740            // PMREF says (implicitly) it is not necessary to call
     4741            // DosFreeMem. I hope that is correct.
     4742            // V0.9.19 (2002-06-02) [umoeller]
     4743        }
     4744
     4745        WinCloseClipbrd(hab);
     4746    }
     4747
     4748    return fSuccess;
     4749}
     4750
     4751/*
    47074752 *@@category: Helpers\PM helpers\Extended frame windows
    47084753 */
     
    49534998    {
    49544999        // allocate buffer
    4955         pObjClass = (POBJCLASS)malloc(ulSize+1);
     5000        pObjClass = (POBJCLASS)malloc(ulSize + 1);
    49565001        // and load the classes into it
    49575002        WinEnumObjectClasses(pObjClass, &ulSize);
    49585003    }
    49595004
    4960     return ((PBYTE)pObjClass);
     5005    return (PBYTE)pObjClass;
    49615006}
    49625007
Note: See TracChangeset for help on using the changeset viewer.