Click here to Skip to main content
15,895,557 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
Can anybody explain me:

C#
int Form1.SendMessage(int hwnd, int wMsg,int wParam, object IParam)


It is used to copy image to clipboard.

EXAMPLE:
C#
SendMessage(hHwnd, WM_CAP_EDIT_COPY, 0, 0);



Here what are those parameters(hwnd,wMsg,wParam,IParam) mean??
Posted
Comments
madhav_jain 25-Jul-13 14:57pm    
explain ur ques in detail..
[no name] 25-Jul-13 14:58pm    
The documentation explains it pretty well, http://msdn.microsoft.com/en-us/library/windows/desktop/ms644950(v=vs.85).aspx

SendMessage is not a part of "normal" .NET - it's a Windows function that you access from an external native DLL.
Look at the MSDN article on SendMessage[^] and it tells you what the parameters mean - or at least the loose overview of them. The values you pass in the wMsg parameter will affect what the values in wParam mean, and the values in wParam (as modified by the wMsg parameter) will affect what the IParam parameter should be and what it does. So it's not as simple as "this is what it does" or "this is what it means".

But why are you using that? Is there some good reason why you aren't just saying
C#
Image im = Image.FromFile(@"D:\Temp\MyPic.jpg");
Clipboard.SetDataObject(im);
 
Share this answer
 
Comments
ridoy 25-Jul-13 15:30pm    
+5
Matt T Heffron 25-Jul-13 16:43pm    
+5
Sergey Alexandrovich Kryukov 25-Jul-13 17:37pm    
Exactly. 5ed.
—SA
Refer these two links

MessageWindow.SendMessage Method[^]

MessageWindow Members[^]

Regards..:laugh:
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 25-Jul-13 17:37pm    
Why? Please see more correct Solution 2.
—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900