Source: tombkeeper
Original link: http://www.bkjia.com/aqgjrj/499358.html
Code
#include
int WINAPI WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)
{
if(OpenClipboard(NULL))
{
HGLOBAL clipbuffer;
char * buffer;
EmptyClipboard();
clipbuffer = GlobalAlloc(GMEM_DDESHARE, lstrlen(lpCmdLine)+1);
buffer = (char*)GlobalLock(clipbuffer);
strcpy(buffer, lpCmdLine);
GlobalUnlock(clipbuffer);
SetClipboardData(CF_TEXT,clipbuffer);
CloseClipboard();
return 0;
}
else
{
return -1;
}
}