/* 클립보드에 데이터 밀어넣기 */
BOOL CRandomDlg::ClipCopy(
char
 *szTXT)
{
        HGLOBAL hglbCopy;
        
char
* lptstrCopy; 

        
if
 (!OpenClipboard()) 
                
return
 FALSE;

        EmptyClipboard();

        hglbCopy = GlobalAlloc(GMEM_MOVEABLE, szTXT(txt)+
1
);
        
if
 (hglbCopy == NULL)
        {
                CloseClipboard(); 
                
return
 FALSE; 
        } 
        lptstrCopy =(
char
*)GlobalLock(hglbCopy); 
        memcpy(lptstrCopy, szTXT, strlen(szTXT)+
1
); 
        GlobalUnlock(hglbCopy); 
        SetClipboardData(CF_TEXT, hglbCopy); 

        CloseClipboard();  
        
return
 TRUE;
}

+ Recent posts