Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to Get Text From Clipboard everytime when it is changed

Status
Not open for further replies.

wardhan

Programmer
Sep 15, 2001
10
JP
Dear Friends/Sir
I am new to VC++.So please help me in getting the solution.
I want to get data(Text)from ClipBoard everytime whenever it is changed by Pressing Ctrl+c(As u know Clipboard data will be changed with previousone everytime whenever CTRL +c is pressed).
My programme code is like this in a WM_Paint message--

if (hGlobal != NULL)
{
pGlobal = (PTSTR) GlobalLock (hGlobal) ;
pText = (char *)
malloc (GlobalSize (hGlobal)) ;
strcpy(pText,pGlobal);
DrawText (hdc, pText[1], -1, &rect, DT_EXPANDTABS) ;
GlobalUnlock (hGlobal) ;
}
CloseClipboard () ;
EndPaint (hwnd, &ps) ;
return 0 ;
But i am unable to get previous data in an array pText[].I declared i as static int.
So please let me know what is problem with my code.and kindly let me know too how to store pText[] elements in a database like MicrosoftAccess.
i tried by menu and accelerator but is not working.But is not working.In this case my programme code is like this,----

case IDM_EDIT_CUT:
SendMessage (hwndEdit, WM_CUT, 0, 0) ;
return 0 ;

case IDM_EDIT_COPY:
SendMessage (hwndEdit, WM_COPY, 0, 0) ;
return 0 ;


case WM_COPY:
case WM_CUT:
" Same as Previous programe Segment"

So kindly let me know about my mistake and please give me the solution so i can go froward.
Thanks in advance
Binay
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top