KTools alpha 2

check it out!


BOOL&nbspSetClipData(void&nbsp*Data,&nbspint&nbspSize)
{
HANDLE&nbsphGlob;
char&nbsp*ptr;
&nbsp&nbsphGlob&nbsp=&nbspGlobalAlloc(GHND|GMEM_DDESHARE,&nbspSize&nbsp+&nbsp1);
&nbsp&nbspif&nbsp(!hGlob)&nbspreturn&nbspFALSE;
&nbsp&nbspptr&nbsp=&nbsp(char*)GlobalLock(hGlob);
&nbsp&nbspif&nbsp(!ptr)&nbspreturn&nbspFALSE;
&nbsp&nbspMoveMemory(ptr,Data,Size+1);
&nbsp&nbspptr[Size]&nbsp=&nbsp0;
&nbsp&nbspGlobalUnlock(hGlob);
&nbsp&nbspif&nbsp(OpenClipboard(NULL)){
&nbsp&nbsp&nbsp&nbspEmptyClipboard();
&nbsp&nbsp&nbsp&nbspSetClipboardData(CF_OEMTEXT,hGlob);
&nbsp&nbsp&nbsp&nbspCloseClipboard();
&nbsp&nbsp&nbsp&nbspreturn&nbspTRUE;
&nbsp&nbsp};
&nbsp&nbspreturn&nbspFALSE;
};
BOOL&nbspGetClipData(void&nbsp*Data,&nbspint&nbspSize)
{
HANDLE&nbsphGlob;
char&nbsp*ptr;
&nbsp&nbspif&nbsp(OpenClipboard(NULL)){
&nbsp&nbsp&nbsp&nbsphGlob&nbsp=&nbspGetClipboardData(CF_OEMTEXT);
&nbsp&nbsp&nbsp&nbspptr&nbsp=&nbsp(char*)GlobalLock(hGlob);
&nbsp&nbsp&nbsp&nbspif&nbsp(!ptr)&nbspreturn&nbspFALSE;
&nbsp&nbsp&nbsp&nbspfor(int&nbspi&nbsp=&nbsp0;ptr[i]&nbsp&&&nbspi&nbsp<&nbspSize;i++)
&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp((char*)Data)[i]&nbsp=&nbspptr[i];
&nbsp&nbsp&nbsp&nbsp((char*)Data)[i]&nbsp=&nbsp0;
&nbsp&nbsp&nbsp&nbspGlobalUnlock(hGlob);
&nbsp&nbsp&nbsp&nbspCloseClipboard();
&nbsp&nbsp&nbsp&nbspreturn&nbspTRUE;
&nbsp&nbsp};
&nbsp&nbspreturn&nbspFALSE;
};
/*&nbsp*****&nbspBEGIN&nbspLICENSE&nbspBLOCK&nbsp*****
&nbsp*&nbspVersion:&nbspMPL&nbsp1.1/GPL&nbsp2.0/LGPL&nbsp2.1
&nbsp*
&nbsp*&nbspThe&nbspcontents&nbspof&nbspthis&nbspfile&nbspare&nbspsubject&nbspto&nbspthe&nbspMozilla&nbspPublic&nbspLicense&nbspVersion
&nbsp*&nbsp1.1&nbsp(the&nbsp”License”);&nbspyou&nbspmay&nbspnot&nbspuse&nbspthis&nbspfile&nbspexcept&nbspin&nbspcompliance&nbspwith
&nbsp*&nbspthe&nbspLicense.&nbspYou&nbspmay&nbspobtain&nbspa&nbspcopy&nbspof&nbspthe&nbspLicense&nbspat
&nbsp*&nbsphttp://www.mozilla.org/MPL/
&nbsp*
&nbsp*&nbspSoftware&nbspdistributed&nbspunder&nbspthe&nbspLicense&nbspis&nbspdistributed&nbspon&nbspan&nbsp”AS&nbspIS”&nbspbasis,
&nbsp*&nbspWITHOUT&nbspWARRANTY&nbspOF&nbspANY&nbspKIND,&nbspeither&nbspexpress&nbspor&nbspimplied.&nbspSee&nbspthe&nbspLicense
&nbsp*&nbspfor&nbspthe&nbspspecific&nbsplanguage&nbspgoverning&nbsprights&nbspand&nbsplimitations&nbspunder&nbspthe
&nbsp*&nbspLicense.
&nbsp*
&nbsp*&nbspThe&nbspOriginal&nbspCode&nbspis&nbspthe&nbspColorer&nbspLibrary.
&nbsp*
&nbsp*&nbspThe&nbspInitial&nbspDeveloper&nbspof&nbspthe&nbspOriginal&nbspCode&nbspis
&nbsp*&nbspCail&nbspLomecb&nbsp<cail@nm.ru>.
&nbsp*&nbspPortions&nbspcreated&nbspby&nbspthe&nbspInitial&nbspDeveloper&nbspare&nbspCopyright&nbsp(C)&nbsp1999-2005
&nbsp*&nbspthe&nbspInitial&nbspDeveloper.&nbspAll&nbspRights&nbspReserved.
&nbsp*
&nbsp*&nbspContributor(s):
&nbsp*
&nbsp*&nbspAlternatively,&nbspthe&nbspcontents&nbspof&nbspthis&nbspfile&nbspmay&nbspbe&nbspused&nbspunder&nbspthe&nbspterms&nbspof
&nbsp*&nbspeither&nbspthe&nbspGNU&nbspGeneral&nbspPublic&nbspLicense&nbspVersion&nbsp2&nbspor&nbsplater&nbsp(the&nbsp”GPL”),&nbspor
&nbsp*&nbspthe&nbspGNU&nbspLesser&nbspGeneral&nbspPublic&nbspLicense&nbspVersion&nbsp2.1&nbspor&nbsplater&nbsp(the&nbsp”LGPL”),
&nbsp*&nbspin&nbspwhich&nbspcase&nbspthe&nbspprovisions&nbspof&nbspthe&nbspGPL&nbspor&nbspthe&nbspLGPL&nbspare&nbspapplicable&nbspinstead
&nbsp*&nbspof&nbspthose&nbspabove.&nbspIf&nbspyou&nbspwish&nbspto&nbspallow&nbspuse&nbspof&nbspyour&nbspversion&nbspof&nbspthis&nbspfile&nbsponly
&nbsp*&nbspunder&nbspthe&nbspterms&nbspof&nbspeither&nbspthe&nbspGPL&nbspor&nbspthe&nbspLGPL,&nbspand&nbspnot&nbspto&nbspallow&nbspothers&nbspto
&nbsp*&nbspuse&nbspyour&nbspversion&nbspof&nbspthis&nbspfile&nbspunder&nbspthe&nbspterms&nbspof&nbspthe&nbspMPL,&nbspindicate&nbspyour
&nbsp*&nbspdecision&nbspby&nbspdeleting&nbspthe&nbspprovisions&nbspabove&nbspand&nbspreplace&nbspthem&nbspwith&nbspthe&nbspnotice
&nbsp*&nbspand&nbspother&nbspprovisions&nbsprequired&nbspby&nbspthe&nbspGPL&nbspor&nbspthe&nbspLGPL.&nbspIf&nbspyou&nbspdo&nbspnot&nbspdelete
&nbsp*&nbspthe&nbspprovisions&nbspabove,&nbspa&nbsprecipient&nbspmay&nbspuse&nbspyour&nbspversion&nbspof&nbspthis&nbspfile&nbspunder
&nbsp*&nbspthe&nbspterms&nbspof&nbspany&nbspone&nbspof&nbspthe&nbspMPL,&nbspthe&nbspGPL&nbspor&nbspthe&nbspLGPL.
&nbsp*
&nbsp*&nbsp*****&nbspEND&nbspLICENSE&nbspBLOCK&nbsp*****&nbsp*/

博主友情提示:

如在您的评论中需要提及如QQ号、微信号、电子邮件地址或其他隐私敏感信息,欢迎通过>>博主专用加密工具v2<<加密后发布,原文只有博主可以看到。