|
I've tried both WM_NCMBUTTONDOWN and WM_NCLBUTTONDOWN, but neither works.
|
|
|
|
|
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 />
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 />
ReleaseCapture();<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
|
|
|
|
|
I do it this way, but the controls in the dialog doesn't receive messages.
-- modified at 7:30 Friday 4th November, 2005
|
|
|
|
|
hi,
where do you capture the WM_LBUTTONUP (or DOWN) messages, in the messageloop of the dialog or in one of the child controls.
If you capture/process it in the messageloop of the dialog it should, work
I tried it with a small sample app and didn't get any problems
codito ergo sum
|
|
|
|
|
Could you send me your app source? I'm cofused.
|
|
|
|
|
There is no SetCapture?
Could you send me the whole project in an attachment? I want to try it. Thanks.
|
|
|
|
|
There is no SetCapture in the fragment.
Could send the whole project to me? I want to try it. Thank you.
|
|
|
|
|
|
Might be it is stored in the registery
have u tried to search that .
Vikas Amin
Embin Technology
Bombay
vikas.amin@embin.com
|
|
|
|
|
How to show File properties dialog and delete to recycle bin dialog(Confirm file delete dlg)?
I want to do these just from the full file path.
And how to rename a file using system method?
Thank you.
|
|
|
|
|
use GetFileAttributesEx to obtains special attributes.
d
|
|
|
|
|
Thank you for your reply.
I mean that I just want to show the peoperty dialog. I don't need to get the file property .
|
|
|
|
|
SHMultiFileProperties
My blogs:
http://blog.joycode.com/jiangsheng
http://blog.csdn.net/jiangsheng
http://bloglines.com/public/jiangsheng
Command what is yours
Conquer what is not
---Kane
|
|
|
|
|
I need to display a dialog box in the default desktop in windows XP with multiple desktops.
Could anybody help me?
- NS -
|
|
|
|
|
I create a big file, using the SetEndofFile, then i Seek the filepointer and write some data in it, but i found the func WriteFile take a long time, Why?
HANDLE hFile = CreateFile(_T("D:\\writetest.dat"),
GENERIC_WRITE,
FILE_SHARE_WRITE|FILE_SHARE_READ,
NULL,
CREATE_ALWAYS,
FILE_ATTRIBUTE_NORMAL|FILE_FLAG_RANDOM_ACCESS,
NULL);
LARGE_INTEGER llPos, llNew;
llPos.QuadPart = 2000*1024;
llPos.QuadPart *= 1024;
SetFilePointerEx(hFile, llPos, &llNew, FILE_BEGIN);
SetEndOfFile(hFile);
llPos.QuadPart = 1800*1024;
llPos.QuadPart *= 1024;
SetFilePointerEx(hFile, llPos, &llNew, FILE_BEGIN);
DWORD dwBytes = 256 * 1024;
BYTE * pBuffer = new BYTE[dwBytes];
DWORD dwBytesWritten;
DWORD dwBegin = GetTickCount();
WriteFile(hFile, pBuffer, dwBytes, &dwBytesWritten, NULL);
DWORD dwTime = GetTickCount() - dwBegin;
CString strTime;
strTime.Format(_T("Time: %d"), dwTime);
AfxMessageBox(strTime);
delete []pBuffer;
CloseHandle(hFile);
|
|
|
|
|
Thats' a big file alright. So it will take it's time to handle.
But you might speed it up by replacing FILE_FLAG_RANDOM_ACCESS with FILE_FLAG_SEQUENTIAL_SCAN or FILE_FLAG_WRITE_THROUGH.
I suspect FILE_FLAG_SEQUENTIAL_SCAN will give the most performance gain. (You aren't really doing random access of the file, just sequential writing).
|
|
|
|
|
I tried to use the flag, but unfortunately, it's no effect.
|
|
|
|
|
OK, then I'm out of ideas.
Except for the usual: Get a faster machine and a faster hard disk.
|
|
|
|
|
I need to extract the appointments from Outllok calendar using a MFC application...
pls help me..
|
|
|
|
|
|
Vikas Amin
Embin Technology
Bombay
vikas.amin@embin.com
|
|
|
|
|
I am trying to use MessageBox in .NET but I keep getting an error.
Code I am using:
MessageBox( NULL, "This is the text", "MessageBox", MB_OK );
Error I am recieving:
error C2065: 'MB_OK' : undeclared identifier
I get this error, however, when I mouse over MB_OK it gives me a tooltip saying "#define MB_OK 0x00000000L". Anyone know what I can use in it's place or how to fix this?
Thanks,
Tom Sapp
http://www.sappsworld.com
|
|
|
|
|
I just use 0.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Well, that resolved that issue. Now I have this issue:
error C2514: 'System::Windows::Forms::MessageBox' : class has no constructors
Guess I am not doing something right!
Thanks,
Tom Sapp
http://www.sappsworld.com
|
|
|
|
|
Oh, this is a managed C++ message box. In that case - MessageBox has no constructors. Instead, it has a static method called Show. In that case, you need to pass in the managed enum, you can't pass in a MB value or a number.
Christian Graus - Microsoft MVP - C++
|
|
|
|