lisp2arx
Visual Programming for AutoLisp Mathématiques en programmation Lisp.. doc2cpp,doc2lsp, sld2lsp, bmp2dcl, free__GifCcapture for all-CAD'platforms..
Lista Forumurilor Pe Tematici
lisp2arx | Reguli | Inregistrare | Login

POZE LISP2ARX

Nu sunteti logat.
Nou pe simpatie:
alexxandra
Femeie
24 ani
Timis
cauta Barbat
24 - 57 ani
lisp2arx / Delphi , InnoPascal / Delphi32- Clipboard Strlen,  
Autor
Mesaj Pagini: 1
admin
Administrator

Din: Bucharest
Inregistrat: acum 13 ani
Postari: 516


Code:

Uses Windows;
Function php_clipboard_strlen:integer;
var
  hData:  DWORD;
  pData:  Pointer;
  dwSize: DWORD;
begin
   //Out:(<0.error fail, or reject system)(>0.okai)(0.empty)
  Result := RTCAN;
  if OpenClipBoard(0) then
  begin
    Result := RTREJ;
    hData := GetClipBoardData(CF_TEXT);
    if hData <> 0 then
    begin
      Result := RTFAIL;
      pData := GlobalLock(hData);
      if pData <> nil then
      begin
        Result := RTKWORD;
        dwSize := GlobalSize(hData);
        if dwSize > 0 then result:=dwSize
                      else result:=RTERROR;
        GlobalUnlock(DWORD(pData));
      end;
    end;
    CloseClipBoard;
  end;
end;



Code:

Function php_get_clipboardtext(var szText:string):boolean;
var
  hData:  DWORD;
  pData:  Pointer;
  dwSize: DWORD;
begin
  Result := FALSE;
  if OpenClipBoard(0) then
  begin
    hData := GetClipBoardData(CF_TEXT);
    if hData <> 0 then
    begin
      pData := GlobalLock(hData);
      if pData <> nil then
      begin
        dwSize := GlobalSize(hData);
        if dwSize <> 0 then
        begin
          SetLength(szText, dwSize);
          CopyMemory(@szText[1], pData, dwSize);
          Result := TRUE;
        end;
        GlobalUnlock(DWORD(pData));
      end;
    end;
    CloseClipBoard;
  end;
end;



_______________________________________


pus acum 4 ani
   
Pagini: 1  

Mergi la