FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour how to detect Clipboard Format under harbour ?
Posts: 1772
Joined: Thu Sep 05, 2019 05:32 AM
how to detect Clipboard Format under harbour ?
Posted: Mon Dec 18, 2023 06:09 AM
hi,

default Clipboard use CF_TEXT

but can also use CF_BITMAP or OLE

under Xbase++ i have QueryGetFormat() to ask which Format is used, how using harbour :?:
Code (fw): Select all Collapse
Function DoMyDrag(oDlg, oDrag, bArchivname)
   LOCAL oOutlook
   LOCAL aFile := {}
   LOCAL i, iCnt
   LOCAL cBase, cFile

   oDlg:setpointer(, XBPSTATIC_SYSICON_WAIT, XBPWINDOW_POINTERTYPE_SYSPOINTER)

   // email speichern in TEMP
   if oDrag:queryGetFormat( "FileGroupDescriptor")
      oOutlook := createobject("outlook.application")
      if IsObject(oOutlook)
         iCnt  := oOutlook:ActiveExplorer:selection:count
         aFile := array(iCnt)
         for i := 1 to iCnt
            // cBase ist der Betraff der Nachricht
            cBase    := ValidFileName(oOutlook:ActiveExplorer:selection:item(i):subject)

            // dieser Codeblock erzeugt den Name der zu speichernen Datei, incl Pfad, etc
*           aFile[i] := eval( bArchivname, cBase )
            aFile[i] := "C:\TEMP\TEXTXXX"

            oOutlook:ActiveExplorer:selection:item(i):saveas(aFile[i], olMSGUnicode)
         next
         oOutlook:destroy()
      else
         Msgbox("Fehler beim Zugriff auf Outlook !")
      endif
      oOutlook:= NIL

   elseif oDrag:queryGetFormat(XBPCLPBRD_FILELIST)
      aFile := oDrag:getdata( XBPCLPBRD_FILELIST)
      iCnt  := len( aFile)

      for i := 1 to iCnt

            // dieser Codeblock erzeugt den Name der zu speichernen Datei, incl Pfad, etc
            cFile := eval( bArchivname, aFile[i] )

            if fcopy(aFile[i], cFile, .T. )
               aFile[i] := cFile
            else
               aFile[i] := ""
            endif

      next
   else
      // kein verarbeitung hier definiert
   endif
   oDlg:setpointer()
RETURN aFile
greeting,

Jimmy
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: how to detect Clipboard Format under harbour ?
Posted: Tue Dec 19, 2023 07:26 AM
Dear Jimmy,

This Windows API function seems to do what you are looking for:

https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-enumclipboardformats
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1772
Joined: Thu Sep 05, 2019 05:32 AM
Re: how to detect Clipboard Format under harbour ?
Posted: Tue Dec 19, 2023 09:50 AM

hi Antonio,

thx, i will try that Way

greeting,

Jimmy

Continue the discussion