Click here to Skip to main content
15,910,787 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Arrays from VC++ to VB using SAFEARRAY Pin
JonEngle4-Nov-05 10:47
JonEngle4-Nov-05 10:47 
QuestionWhat's the meaning of "USES_CONVERSION" Pin
chenxiujie3-Nov-05 19:23
chenxiujie3-Nov-05 19:23 
AnswerRe: What's the meaning of "USES_CONVERSION" Pin
Rob Caldecott3-Nov-05 20:37
Rob Caldecott3-Nov-05 20:37 
GeneralRe: What's the meaning of "USES_CONVERSION" Pin
chenxiujie3-Nov-05 20:55
chenxiujie3-Nov-05 20:55 
QuestionHow to process the msg when clicking outside a DoModal-Dialog? Pin
followait3-Nov-05 19:13
followait3-Nov-05 19:13 
AnswerRe: How to process the msg when clicking outside a DoModal-Dialog? Pin
GflPower3-Nov-05 19:41
GflPower3-Nov-05 19:41 
GeneralRe: How to process the msg when clicking outside a DoModal-Dialog? Pin
followait3-Nov-05 20:07
followait3-Nov-05 20:07 
AnswerRe: How to process the msg when clicking outside a DoModal-Dialog? Pin
BadKarma3-Nov-05 22:28
BadKarma3-Nov-05 22:28 
Hi
You need to lock the mouse cursor to your windows.
During this lock all messages will be parsed by you.

In the close function you can relase the mouse

If you use MFC you can call CWnd::SetCapture like this
<br />
BOOL CMyDlg::OnInitDialog()<br />
{<br />
...<br />
// Capture the mouse<br />
this->SetCapture();<br />
...<br />
}<br />


You then need to capture the WM_LBUTTONUP message since the whole desktop is now client arrea you will get this message then simply check whether the point is your window rectangle or not.
<br />
void CdlgcloseDlg::OnLButtonUp(UINT nFlags, CPoint point)<br />
{<br />
  CRect rtWnd;<br />
  GetWindowRect(&rtWnd);<br />
  ScreenToClient(&rtWnd);<br />
  <br />
  if(!rtWnd.PtInRect(point))<br />
  {<br />
    // Release the mouse<br />
    ReleaseCapture();<br />
    //  Invoke WM_QUIT<br />
    PostQuitMessage(0);  <br />
  } <br />
  <br />
  CDialog::OnLButtonUp(nFlags, point);<br />
}<br />


If you use the win32 API the funtions are:
<br />
SetCapture(HWND hWnd);<br />
ReleaseCapture();<br />


Hope that this is what you needed

codito ergo sum
GeneralRe: How to process the msg when clicking outside a DoModal-Dialog? Pin
followait4-Nov-05 1:28
followait4-Nov-05 1:28 
GeneralRe: How to process the msg when clicking outside a DoModal-Dialog? Pin
BadKarma4-Nov-05 6:57
BadKarma4-Nov-05 6:57 
GeneralRe: How to process the msg when clicking outside a DoModal-Dialog? Pin
followait4-Nov-05 16:27
followait4-Nov-05 16:27 
GeneralRe: How to process the msg when clicking outside a DoModal-Dialog? Pin
followait6-Nov-05 2:21
followait6-Nov-05 2:21 
GeneralRe: How to process the msg when clicking outside a DoModal-Dialog? Pin
followait13-Nov-05 2:08
followait13-Nov-05 2:08 
QuestionGet Temporary Internet Files amount of disk space to use variable Pin
Andrei B3-Nov-05 18:48
Andrei B3-Nov-05 18:48 
AnswerRe: Get Temporary Internet Files amount of disk space to use variable Pin
vikas amin4-Nov-05 2:18
vikas amin4-Nov-05 2:18 
QuestionHow to show file properties dialog?and delete to recycle bin dialog(Confirm file delete dlg)? Pin
Tcpip20053-Nov-05 17:59
Tcpip20053-Nov-05 17:59 
AnswerRe: How to show file properties dialog?and delete to recycle bin dialog(Confirm file delete dlg)? Pin
GflPower3-Nov-05 19:15
GflPower3-Nov-05 19:15 
GeneralRe: How to show file properties dialog?and delete to recycle bin dialog(Confirm file delete dlg)? Pin
Tcpip20053-Nov-05 19:32
Tcpip20053-Nov-05 19:32 
GeneralRe: How to show file properties dialog?and delete to recycle bin dialog(Confirm file delete dlg)? Pin
Sheng Jiang 蒋晟4-Nov-05 7:37
Sheng Jiang 蒋晟4-Nov-05 7:37 
QuestionDefault desktop Pin
Nishad S3-Nov-05 17:47
Nishad S3-Nov-05 17:47 
QuestionWriteFile take a long time, Why? Pin
newsb3-Nov-05 16:55
newsb3-Nov-05 16:55 
AnswerRe: WriteFile take a long time, Why? Pin
kakan3-Nov-05 18:58
professionalkakan3-Nov-05 18:58 
GeneralRe: WriteFile take a long time, Why? Pin
newsb3-Nov-05 19:57
newsb3-Nov-05 19:57 
GeneralRe: WriteFile take a long time, Why? Pin
kakan3-Nov-05 20:01
professionalkakan3-Nov-05 20:01 
QuestionExtracting Calendar Information from MSOUTLOOK using MFC Pin
Warier3-Nov-05 16:46
Warier3-Nov-05 16:46 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.