I have my project working the way I want it to, but I have one little quirk I 
am hoping to fix.
When I look at the clipboard, the entry for MSDEVColumnSelect has zero length. 
I’m not too familiar with PChars, but is there a way to set it to zero length?
I set it to #0 and it works ok with the #0 in there with Notepadd++ but I think 
it’s technically not correct.
Is there some way to call   SetClipboardData(); to have it write just the 
format ID and zero length data?
 
Here’s a code snip of the relevant section:
 
 
  EmptyClipBoard;
  h:=GlobalAlloc(GMEM_MOVEABLE or GMEM_DDESHARE,l+1);
  pp:=pchar(GlobalLock(h));
  move(p^,pp^,l+1);
  GlobalUnlock(h);
  res:=(SetClipboardData(CF_OEMTEXT,h)=h);
  h:=GlobalAlloc(GMEM_MOVEABLE or GMEM_DDESHARE,l+1);
  pp:=pchar(GlobalLock(h));
  OemToCharBuffA(p,pp,l+1);
  SetClipboardData(CF_TEXT,h);
  GlobalUnlock(h);
  If Vertical then
    Begin
      q:=#0;
      h:=GlobalAlloc(GMEM_MOVEABLE or GMEM_DDESHARE,l+1);
      pp:=pchar(GlobalLock(h));
      move(q^,pp^,l+1);
      SetClipboardData(MSDEVColumnSelect,h);
      GlobalUnlock(h);
      q:=#2#0;
      h:=GlobalAlloc(GMEM_MOVEABLE or GMEM_DDESHARE,l+1);
      pp:=pchar(GlobalLock(h));
      move(q^,pp^,l+1);
      SetClipboardData(BorlandIDEBlockType,h);
      GlobalUnlock(h);
    End;
 
 
James
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to