Windows have message driven architecture basically. Messages are nothing but events (in VB). For every action a window will get a message like, WM_LBUTTONDOWN, WM_LBUTTONUP, WM_MOUSEMOVE, WM_MOUSEWHEEL etc., The above said messages are mouse click events that will be sent to a window if user clicks on it. Say, if a user clicks on a window... that window will get WM_LBUTTONDOWN message first and WM_LBUTTONUP when he release it. With this message additional information like X,Y positions where the user clicked also will be sent to that window.
Ok... now come to SendMessage() function. SendMessage function is having as u said four parameters,
LRESULT SendMessage(HWND hWnd,UINT Msg,WPARAM wParam, LPARAM lParam);
here hWnd is the handle to the window where you want to send the message
Msg is the Message as above said WM_LBUTTONDOWN or WM_LBUTTONUP (see msdn for all messages starting with WM_XXXXXXX)
wParam additional information
lParam additional information
for example, let us send a message to a window like user ctrl+clicks on it...
wParam and lParam will vary depends on the message you send. For WM_CLOSE, no need for wParam and lParam, so ::SendMessage(hWnd,WM_CLOSE,0,0); will close the window.
As our Friend Parthi said, difference between SendMessage and PostMessage is, SendMessage will send message and wait till the window process the message. PostMessage will post the message in the message queue and wont wait anymore.
I think the reply is pretty long, but clear enough.
if((insidepoint == true ) && (nFlags & MK_LBUTTON))
old = dc.SelectObject(&one);
dc.Ellipse(OldPoint.x+ array,OldPoint.y+array,(point.x + array),(point.y + array)); // Here the Position is not getting Correctly
dc.Ellipse(OldPoint.x+ array,OldPoint.y+array,(point.x + array),(point.y + array)); //A slight Difference in Position I cant Understand why this happens. please help me out.
OldPoint = point;
DrawPixel(); //Call this Function to Paint the Back Ground
GetClientRect(&rect); //Capture the Image of the Screen what we Want
nRet = dcMem.CreateCompatibleDC(&dc);
nRet = bmpMem.CreateCompatibleBitmap(&dc,rect.Width(),rect.Height());
CBitmap *pOldBmp = (CBitmap *)(dcMem.SelectObject(&bmpMem));
int index = -1,ind=0;
for(int i =0; i< strCollect.GetSize(); i++)
strReadBuffer = strCollect.GetAt(i);
index = strReadBuffer.Find(",");
strTokenizer = strReadBuffer.Left(index);
strReadBuffer = strReadBuffer.Mid(index+1);
index = strReadBuffer.Find(",");
}while(index != -1);
I can run your code one black page with dots and (it doesnt work i change bEllipseFlag/insidepoint/circleDrawn to true)and when i lbutton it draws a circle but i think your code needs a lot of works for move circle(and...) in the OnLButtonDown you have a for that i think its for move you have a cstringarray that i think you get four numbers in this array and convert them for CreateEllipticRgn but how do you move circle,now:
I have a suggestion for you see this[^] i think your program needs to another things (for example when you draw your circle aftre draw you want to change size of previous circle or need to undo/redo and ...) i dont know you want these things in your program or no but if yes see this link
(2)you want to draw a circle and drag and drop well you can draw your circle and set this circle or circles to a control or controls like static and use from drag drop
overide the WM_LBUTTONDOWN message. Inside that call CTabCtrl::HitTest() to find the item. If the item is the one that u dont want to act as disabled, simply return the function with out calling the CTabCtrl::OnLButtonDown(..)
The limit on the user-mode virtual address space for a process is well-defined for each OS. In Win32 it's normally 2GB, but on some versions of NT you can change it to some other value at boot time with boot.ini switches. The most common value to change to is 3GB. 64-bit Windows has different limits for each CPU type.