how to detect Clipboard Format under harbour ?

how to detect Clipboard Format under harbour ?

Postby Jimmy » Mon Dec 18, 2023 6:09 am

hi,

default Clipboard use CF_TEXT
Image
but can also use CF_BITMAP or OLE
Image
under Xbase++ i have QueryGetFormat() to ask which Format is used, how using harbour :?:
Code: Select all  Expand view
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
User avatar
Jimmy
 
Posts: 1585
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

Re: how to detect Clipboard Format under harbour ?

Postby Antonio Linares » Tue Dec 19, 2023 7: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
User avatar
Antonio Linares
Site Admin
 
Posts: 41314
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: how to detect Clipboard Format under harbour ?

Postby Jimmy » Tue Dec 19, 2023 9:50 am

hi Antonio,

thx, i will try that Way
greeting,
Jimmy
User avatar
Jimmy
 
Posts: 1585
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Rick Lipkin and 87 guests