-
June 8th, 2006, 10:05 AM
#1
[RESOLVED] F1Book - Drag and Drop
Does anyone know how to disable drag and drop on an F1Book (Tidestone Formula One ActiveX grid control)? I want to prevent users from dropping data from other applications onto the control. Not sure what other information will be helpful. Thanks for your help.
-
June 8th, 2006, 10:35 AM
#2
Re: F1Book - Drag and Drop
How are you using the control? Do you have a wrapper class? How is the control instantiated?
Gort...Klaatu, Barada Nikto!
-
June 8th, 2006, 10:44 AM
#3
Re: F1Book - Drag and Drop
The control is linked to a resource on my dialog through DDE. The wrapper class for the control is CF1Book (generated by Visual Studio). I have the User's Guide for the control, but haven't been able to find anything related to disabling drag and drop.
-
June 8th, 2006, 10:51 AM
#4
Re: F1Book - Drag and Drop
If the wrapper is dervied from COleControl, you can try to use DragAcceptFiles().
Gort...Klaatu, Barada Nikto!
-
June 8th, 2006, 12:11 PM
#5
Re: F1Book - Drag and Drop
The wrapper is derived from CWnd.
-
June 8th, 2006, 12:28 PM
#6
Re: F1Book - Drag and Drop
Not a problem. COleControl is derived from CWnd and DragAcceptFiles is actually a method of CWnd.
Gort...Klaatu, Barada Nikto!
-
June 8th, 2006, 12:39 PM
#7
Re: F1Book - Drag and Drop
I tried calling DragAcceptFiles(FALSE) on my CF1Book in OnInitDialog and it still accepts the drop.
-
June 9th, 2006, 08:38 AM
#8
Re: F1Book - Drag and Drop
Found the answer...
Code:
WINOLEAPI RevokeDragDrop(
HWND hwnd //Handle to a window that can accept drops
);
Code:
// m_f1 is a member variable of type CF1Book (the wrapper class)
RevokeDragDrop((HWND)m_f1.GetHWnd());
);
Thanks for helping, Mike!
-
August 13th, 2017, 08:18 PM
#9
Re: F1Book - Drag and Drop
anybody knows where could get F1Book?
-
August 13th, 2017, 11:28 PM
#10
Re: F1Book - Drag and Drop
Originally Posted by germanrachid
anybody knows where could get F1Book?
Perhaps, from Tidestone web site?
Victor Nijegorodov
-
September 16th, 2020, 02:00 AM
#11
Re: [RESOLVED] F1Book - Drag and Drop
In related to the drag and drop functionality in the above thread discussion, I have some doubts.
I have some 4 cstatic controls on my dialog box and drag and drop functionality works randomnly.
But I want specific file to be loaded on to that specific CStatic box window when the user drags and drops over it.
Please let me know how to do this in specific for each individual cstatic controls
-
September 16th, 2020, 04:00 AM
#12
Re: [RESOLVED] F1Book - Drag and Drop
1. You should have started the new thread with your problem, since it has nothing to do with the F1Book ActiveX control.
2. What would you like to accomplish with the "drag and drop functionality" with the static controls? What did you expect and what have you got?
3. How did you implement your "drag and drop functionality"?
4. Define "drag and drop functionality works randomnly".
Victor Nijegorodov
-
September 16th, 2020, 08:39 AM
#13
Re: [RESOLVED] F1Book - Drag and Drop
Originally Posted by VictorN
1. You should have started the new thread with your problem, since it has nothing to do with the F1Book ActiveX control.
2. What would you like to accomplish with the "drag and drop functionality" with the static controls? What did you expect and what have you got?
3. How did you implement your "drag and drop functionality"?
4. Define "drag and drop functionality works randomnly".
sorry for continuing in this thread itself.
I have written the below code to capture drag and drop file names on my dialog box:
Code:
void CDashOfflineSelMapDumpFile::OnDropFiles(HDROP hDropInfo)
{
UINT fileCount = DragQueryFile(hDropInfo, 0xFFFFFFFF, NULL, 0);
for (UINT i = 0; i < fileCount; i++ )
{
char* pBuf = fileName.GetBuffer(MAX_PATH+11);
UINT fnchars = DragQueryFile(hDropInfo, i, pBuf, MAX_PATH);
fileNames.AddTail(pBuf);
fileName.ReleaseBuffer();
}
// Free the memory block containing the dropped-file information
DragFinish(hDropInfo);
CDialogEx::OnDropFiles(hDropInfo);
}
in the OnIntiDialog() function I am calling "this->DragAcceptFiles();"
my question is I have some 4 CStatic controls, how can I redirect each file that is selected from window explorer and dropped on each CStatic control seperately. I tried capturing the mouse click point as shown below
Code:
POINT p;
GetCursorPos(&p);
CRect rect;
GetWindowRect(&rect);
//GetClientRect(&rect);
//POINT pt = rect.CenterPoint();
//ScreenToClient(hwnd, &p);
//if(rect.PtInRect(p))
if(m_control_str_event_log_ioc.DragDetect(p))
{
//cursor position now in p.x and p.y
//if((p.x > rect.TopLeft().x) && (p.y < rect.BottomRight().y) )
{
m_str_event_log_ioc = fileName;
UpdateData(FALSE);
}
}
my question how exactly can I capture the mouse file drag point onthe different CStatic control so that I can update that file on that particular control.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|