|
OK, no problem. I was intregued that's all.
Ant.
|
|
|
|
|
ya, none of your business, you communist dog
|
|
|
|
|
ya, none of your business, you communist dog
|
|
|
|
|
It is not impolite to ask. If the information is considered confidential, you can always say that you cannot tell it. Shouting up like "None of your business, a$$h*le" will certainly decrease your possibilities of being helped, and hamper your creditability significally.
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
|
Hi every1, lets say i have a Dialog based Win32 application and i want to save and retrive the dialog data (the values of the edit ctrls inside the dialog). Is there any way i can dump the whole dialog into some file and read it later and show it?
-Tareq
|
|
|
|
|
I personally would use INI file to do that...
|
|
|
|
|
If you are using MFC you can use CObject::Serialize()
Ant.
|
|
|
|
|
Which frormat is used for file DRAG to windows explorer ?
I need to create drag source for moving files by mouse to
Windows Explorer.
Which format is used for that?
Is ther sample of drag source for that puprose ?
thanks.
|
|
|
|
|
You need to create CF_HDROP, which is basically a list of file-names, and store it in your data-object.
This looks like a long but helpfull article
http://www.codeproject.com/shell/explorerdragdrop.asp.
|
|
|
|
|
Are not you gettting fun?
I need drag TO explorer, but not from - that is easy.
|
|
|
|
|
That's what I said.
declare a COleDataSource.
allocate memory for a CF_HDROP struct + a list of all your file names
hDrop = GlobalAlloc(GMEM_MOVEABLE, bufSize);
lock it:
pDrop = (DROPFILES*)GlobalLock(hDrop);
Fill it
Unlock and cache it in your data-source
<br />
GlobalUnlock(hgDrop);<br />
<br />
FORMATETC etc = {CF_HDROP, NULL, DVASPECT_CONTENT, -1, TYMED_HGLOBAL};<br />
m_dataSrc.CacheGlobalData ( CF_HDROP, hDrop, &etc );
now just call the data-source's DoDragDrop:
DROPEFFECT dwEffect = m_dataSrc.DoDragDrop();
and the magic will happen.
|
|
|
|
|
I think you typed a good code,
/thanks/
but some incomplete,
after filing that structure - in which function,
(which handler)
of which class, I can realize begin DRAG operation ?
there are many methods to do it, and some are
inconsistent with that way, that need be,as first, found.
Please point me which method you meant?
|
|
|
|
|
I'm abit confused, but here's my word:
You will usually want to begin your drag when someone starts dragging items off a list/tree/any-other control. these controls support drag-notifications (LVN_BEGINDRAG for example).
At that point, or at any other point you wish to begin your drag, declare your COleDataSource on the stack.
Then do the actions in the previous message (allocate, fill and cache your CF_HDROP data into the data-source). After this simply call dataObject.DoDragDrop() and your drag-drop will begin, when it ends dataObject.DoDragDrop will return.
Notice: the destination takes care of performing the operations themselves. So if you're dragging into explorer and drop with a 'copy', explorer will copy the files.
|
|
|
|
|
thanks you.
I only began to work with drag and drop,
so methods of use are important for me to note.
|
|
|
|
|
I've examined XP's behaviour and it seems as if it adds the 'A:' entry to the sendto menu manually, unlike all the other entries which are picked up from "\docs and setts\user\sendto..."...
Can someone elaborate on this ?
Do they store this somewhere in the registry ?
Do they add any other commands to the menu ?
p.s. they do check if an 'A:' exists before adding, i'll give you that, but still...
thanks
|
|
|
|
|
After a quick search of the registry, this seems to be in-built into the Microsoft SendTo Service, and thus is in-built for each OS that uses it. Removing this possibility seems impossible. Why it is implemented, I don't know. Perhaps to ensure that a malign virus cannot completely remove the possibility of moving files away from the computer ?
The default behaviour does not seem to add other commands to the menu, except from the 'A:' target.
If someone has more in-depth knowledge, it is appreciated.
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
Does this interest you as well ?
Do you know if it happens only in XP, or in other Oss' as well (doesn't happen in Windows-2000)...
|
|
|
|
|
I place interest on everything that happens in the Windows OS. I, however, do not know for sure if it is a built-in feature. You should try asking Microsoft directly, I'm sure they can provide a sure answer.
And no, I have not tried if this behaviour is repeatable on other Windows OS revisions.
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
Many programs are now showing a standard file selection dialogue box with the favourites control down the left hand side. How can one add this into a Visual C++ 6 application?
Thanks.
Andrew
|
|
|
|
|
You'll need to use GetOpenFileName() without a hook procedure.
andrew/truckle@atkinsglobal.com wrote:
Many programs are now showing a standard file selection dialogue box with the favourites control down the left hand side.
Office does this (see the HKEY_CURRENT_USER\Software\Microsoft\Office\9.0\Common\Open Find\Places\StandardPlaces\Favorites registry value), but do you have another example?
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
I have tried this code below, and it does indeed show a control on the left. But for some reason it still doesn't list "Favourites" as one of the choices.
Also, it means I loose all the benfits that were in the CFileDialog class. It seems like I am trying to re-invent the wheel here..
Appreciate any advice.
Andrew
void CTestdlgDlg::OnButton1() <br />
{<br />
OPENFILENAME ofn;<br />
TCHAR szFile[_MAX_PATH]=_T("");<br />
ZeroMemory(&ofn, sizeof(OPENFILENAME));<br />
ofn.lStructSize = sizeof(OPENFILENAME);<br />
ofn.hwndOwner = GetSafeHwnd();<br />
ofn.lpstrFile = szFile;<br />
ofn.nMaxFile = sizeof(szFile);<br />
ofn.lpstrFilter = "All\0*.*\0Text\0*.TXT\0";<br />
ofn.nFilterIndex = 1;<br />
ofn.lpstrFileTitle = NULL;<br />
ofn.nMaxFileTitle = 0;<br />
ofn.lpstrInitialDir = NULL;<br />
ofn.Flags = OFN_PATHMUSTEXIST | OFN_FILEMUSTEXIST;<br />
<br />
GetOpenFileName(&ofn);<br />
}
|
|
|
|
|
andrew.truckle@atkinsglobal.com wrote:
I have tried this code below, and it does indeed show a control on the left. But for some reason it still doesn't list "Favourites" as one of the choices.
Does the Places Bar normally contain the Favorites folder? A little research indicates it's not normally there, but it can be added with a registry tweak. In the following registry key, which doesn't exist by default:
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\ComDlg32\PlacesBar
you can specify up to five folders. Each folder is identified by an entry called Place0, Place1, and so forth, up to Place4. The value of these entries can be either a fully qualified path name or a CSIDL value that identifies a special folder independent of the particular machine. If you want to specify an absolute file system path, create a REG_SZ, or REG_EXPAND_SZ, entry. If you plan to use a CSIDL, then a REG_DWORD entry is mandatory. CSIDL values are defined in shlobj.h. Make sure you get the one that ships with the latest Platform SDK if you want the new IDs specific to Windows 2000.
andrew.truckle@atkinsglobal.com wrote:
Also, it means I loose all the benfits that were in the CFileDialog class. It seems like I am trying to re-invent the wheel here..
This is a "bug" with CFileDialog in that it uses a hook, thus preventing the Places Bar from showing up. It's a well documented issue.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
It is a whole new concept in programming. I have not heard of a "Places Bar" or anything, let alone the bug fix. I have been trying to find how to do it on msdn and all that, to no avail.
You are the first person to atleast offer a solution. I suppose i was surprised because the person who wanted this, has been using autocad 2004, and its file dialogue shows the vary same control on the left but with the bar...
can you inform me of the "bug" articles?
Andrew
|
|
|
|
|
andrew.truckle@atkinsglobal.com wrote:
can you inform me of the "bug" articles?
Yep. See here and here.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|