| TIP: Click on subject to list as thread! | ANSI |
| echo: | |
|---|---|
| to: | |
| from: | |
| date: | |
| subject: | Drop |
SE> How can I catch the DM_DRAGOVER when it is over a control or child
SE> window of a dialogue window so that I can return DOR_DROP for that
SE> button and not just for the background?
CH> Subclass each control window.
Well, I did that (it was easier than I thought it would be :)) but I still
have a problem.
The DM_DRAGOVER message never seems to be recognized in the subclassed
window procedure.
In the following lstProc() is the old default window procedure for the
listbox (used in my tests) and the subclassing was done as:
lstProc=WinSubclassWindow(WinWindowFromID(hwnd,LIST),ListSubProc);
MRESULT EXPENTRY ListSubProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2 )
{
switch(msg) {
case DM_DRAGOVER:
{
PDRAGINFO pdinfo = (PDRAGINFO) mp1;
PDRAGITEM pditem = NULL;
DrgAccessDraginfo(pdinfo);
pditem = DrgQueryDragitemPtr(pdinfo, 0);
if(DrgVerifyRMF(pditem, "DRM_OS2FILE", "DRF_TEXT")) {
DrgFreeDraginfo (pdinfo) ;
return(MRFROM2SHORT(DOR_DROP, DO_COPY));
} else {
DrgFreeDraginfo (pdinfo) ;
return(MRFROM2SHORT(DOR_NEVERDROP, 0));
}
}
case DM_DROP:
{
PDRAGINFO pdinfo = (PDRAGINFO) mp1;
PDRAGITEM pditem = NULL;
DrgAccessDraginfo(pdinfo);
pditem = DrgQueryDragitemPtr(pdinfo, 0) ;
DrgQueryStrName (pditem->hstrContainerName, CCHMAXPATH, tbuf);
DrgQueryStrName (pditem->hstrSourceName, CCHMAXPATH,
&tbuf[strlen(tbuf)]);
strupr(tbuf);
WinSetWindowText(hwnd,tbuf);
DrgFreeDraginfo (pdinfo) ;
break;
}
}
return (MRESULT)lstProc(hwnd, msg, mp1, mp2);
}
I have proven that the subclassed procedure is being called but the code
statements in the case of DM_DRAGOVER are never being executed.
Any thoughts?
Simon
---
* Origin: Net 250 Gateway :: (1:250/98)SEEN-BY: 50/99 270/101 620/243 625/160 711/401 409 410 413 430 808 809 934 SEEN-BY: 711/955 712/407 515 624 628 713/317 800/1 @PATH: 250/98 99 3615/50 396/1 270/101 712/515 711/808 934 |
|
| SOURCE: echomail via fidonet.ozzmosis.com | |
Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.