|
I search to add, in the left icon bar of the XP Filedialog, some shortcut (Favorite, or other directory)
Can you help me?
|
|
|
|
|
if i understood u correctly, u want to add a icon to a folder.
But what folder, where, how ,why??
Plz be more accurate so we can help u
/\|-||\/|/\|)
|
|
|
|
|
In the CFileDialog in XP , when you use the CFile with the last param dwsize = 0 (VC7):
CFileDialog dlgFile(
TRUE,
_T(".Xls"),
NULL,
OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT,
_T("Excel (*.xls)|*.Xls|All (*.*)|*.*||"),this,0);
You have in the left bar some icon shortcut : (i think in english is same of that )
My recent document;
Desk;
My document ;
My Computer;
My Network P...;
I want add New icon like that :
Favorite ("C:\documents and settings\MyName\favorites")
Project ("H:\Drawing Project")
or other ....
to access quickly to this directory
|
|
|
|
|
The area you wish to add to is called the Places Bar. You'll first need to modify the HKEY_CURRENT_USER\Software\Microsoft\Office\9.0\Common\Open Find\Places\UserDefinedPlaces registry key. See MSDN article Q205041 for an example.
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
Thank you
It's good for MSOffice Open save dialog box... But when I add the CFileDialog in C++ I have not the tools combo, and the cfiledialog don't add my userdefinedplaces ...
|
|
|
|
|
Thierry Lebrun wrote:
...the cfiledialog don't add my userdefinedplaces ...
That's because you are using CFileDialog instead of GetOpenFileName() . The former uses OFN_ENABLEHOOK while the latter does not.
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
|
Thank,
I come back from holidays ,
I have add the place in registry and it work fine for MSWord
but not in my program
I have add this (msdn)sample, the dialog file is XP look but the place Bar is the standard
OPENFILENAME ofn; // common dialog box structure
char szFile[260]; // buffer for file name
HWND hwnd; // owner window
HANDLE hf; // file handle
hwnd = GetSafeHwnd();
// Initialize OPENFILENAME
ZeroMemory(&ofn, sizeof(ofn));
ofn.lStructSize = sizeof(ofn);
ofn.hwndOwner = hwnd;
ofn.lpstrFile = szFile;
//
//
ofn.lpstrFile[0] = '\0';
ofn.nMaxFile = sizeof(szFile);
ofn.lpstrFilter = "All\0*.*\0Text\0*.TXT\0";
ofn.nFilterIndex = 1;
ofn.lpstrFileTitle = NULL;
ofn.nMaxFileTitle = 0;
ofn.lpstrInitialDir = NULL;
ofn.Flags = OFN_PATHMUSTEXIST | OFN_FILEMUSTEXIST;
// Display the Open dialog box.
if (GetOpenFileName(&ofn)==TRUE)
hf = CreateFile(ofn.lpstrFile, GENERIC_READ,
0, (LPSECURITY_ATTRIBUTES) NULL,
OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL,
(HANDLE) NULL);
|
|
|
|
|
I have found the solution !!!!!
OPENFILENAME l_ofn; // common dialog box structure
char l_szFile[260]; // buffer for file name
HWND l_hwnd; // owner window
HANDLE l_hf; // file handle
char l_szBuf[80];
DWORD l_dwData;
HKEY l_hkMyCU;
HKEY l_hkPlaceBar;
CString l_Key_PlacesBar = "Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\ComDlg32\\PlacesBar";
RegCreateKey(HKEY_CURRENT_USER, "CALLuna", &l_hkMyCU);
RegOverridePredefKey(HKEY_CURRENT_USER, l_hkMyCU);
if (RegCreateKey(HKEY_CURRENT_USER, l_Key_PlacesBar, &l_hkPlaceBar) != ERROR_SUCCESS)
{
AfxMessageBox ("Could not create the registry key.");
}
/*
predefined decimal values
=========================
Windows Defined Folder Decimal Code
All Users Desktop 25
All Users Documents 46
All Users Programs 23
All Users Start Menu 22
All Users StartUp Folder 24
Common Files 43
Control Panel 3
Cookies 33
Current Users Programs 2
Current Users Start Menu 11
Current User StartUp Folder 7
Desktop 0
Documents and Settings 40
Favorites 6
Fonts 20
History 34
My Computer 17
My Documents 5
My Music 13
My Pictures 39
My Video 14
Network Neighborhood 18
Program Files 38
Recent Documents 8
Recycle Bin 10
System32 37
Temporary Internet Files 32
Windows 36
*/
// Disque C:
strcpy(l_szBuf, "c:\\");
if (RegSetValueEx(l_hkPlaceBar,
"Place0",
0,
REG_EXPAND_SZ,
(LPBYTE) l_szBuf,
strlen(l_szBuf) + 1)) AfxMessageBox("Could not set the event message file.");
// My Computer
l_dwData = 17;
if (RegSetValueEx(l_hkPlaceBar,
"Place1",
0,
REG_DWORD,
(LPBYTE) &l_dwData,
sizeof(DWORD))) AfxMessageBox("Could not set the supported types.");
// My Document
l_dwData = 5;
if (RegSetValueEx(l_hkPlaceBar, // subkey handle
"Place2", // value name
0, // must be zero
REG_DWORD, // value type
(LPBYTE) &l_dwData, // pointer to value data
sizeof(DWORD))) // length of value data
AfxMessageBox("Could not set the supported types.");
strcpy(l_szBuf, "d:\\Perso");
if (RegSetValueEx(l_hkPlaceBar, // subkey handle
"Place3", // value name
0, // must be zero
REG_EXPAND_SZ, // value type
(LPBYTE) l_szBuf, // pointer to value data
strlen(l_szBuf) + 1)) // length of value data
AfxMessageBox("Could not set the event message file.");
// Favorites
l_dwData = 6;
if (RegSetValueEx(l_hkPlaceBar, // subkey handle
"Place4", // value name
0, // must be zero
REG_DWORD, // value type
(LPBYTE) &l_dwData, // pointer to value data
sizeof(DWORD))) // length of value data
AfxMessageBox("Could not set the supported types.");
RegCloseKey(l_hkPlaceBar);
l_hwnd = GetSafeHwnd();
// Initialize OPENFILENAME
ZeroMemory(&l_ofn, sizeof(l_ofn));
l_ofn.lStructSize = sizeof(l_ofn);
l_ofn.hwndOwner = l_hwnd;
l_ofn.lpstrFile = l_szFile;
//
// Set lpstrFile[0] to '\0' so that GetOpenFileName does not
// use the contents of l_szFile to initialize itself.
//
l_ofn.lpstrFile[0] = '\0';
l_ofn.nMaxFile = sizeof(l_szFile);
l_ofn.lpstrFilter = "All\0*.*\0Text\0*.TXT\0";
l_ofn.nFilterIndex = 1;
l_ofn.lpstrFileTitle = NULL;
l_ofn.nMaxFileTitle = 0;
l_ofn.lpstrInitialDir = NULL;
l_ofn.Flags = OFN_PATHMUSTEXIST | OFN_FILEMUSTEXIST ;
// Display the Open dialog box.
if (GetOpenFileName(&l_ofn)==TRUE)
l_hf = CreateFile(l_ofn.lpstrFile, GENERIC_READ,
0, (LPSECURITY_ATTRIBUTES) NULL,
OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL,
(HANDLE) NULL);
RegOverridePredefKey(HKEY_CURRENT_USER, NULL);
RegCloseKey(l_hkMyCU);
|
|
|
|
|
I have a problem with timer,
I set a timer to enable each 1 mili second .
and i have written a handler when WM_TIMER occured.
For example in my timer handler have this function:
i++;
after 1 minute(eaual to 60000 ms) the value of i should be 60000.
But it;s value near to 4000.
I think windows timer could not send WM_TIMER every 1 ms.
Also I test some of OS definition such as CRITICAL SECTION for handler .
Do you have any suggestion to solve this problem.
|
|
|
|
|
Windows 9i, 2000, XP is not a Hard Real Time OS and it's impossible to reach 1 ms timer resolution. You can make threads and set its priority to have a better result than 4000 ticks i a minut but you'll never reach 1 ms without adding a patch (Venturcom RTX) or changing to Windows CE that I think it reaches it.
Marc Soleda.
... she said you are the perfect stranger she said baby let's keep it like this... Tunnel of Love, Dire Straits.
|
|
|
|
|
|
I'm including #import <mshtml.tlb> in my VC 6.0/SP5 project. When I remove this line, compilation fails, but building of the "browse info" (bscmake) will complete sucessfully.
But when I include this line in the source, bscmake will crash with unhandled exception.
How to solve this ? I've tried this command line switch for bscmake: /Ei (mshtml.tli mshtml.tlh)
It worked when I've executed bscmake from command line, but it's not working when I include it in the GUI's project settings.
Is there some preprocessor directive or variable defined when bscmake is parsing the sources ? I'd try to force bscmake to skip #import line in some way.
Thank you!
rrrado
|
|
|
|
|
nevermind i've found solution
rrrado
|
|
|
|
|
HI all..
i want to know of any function to disable/remove the close Button on a dialog(CROSS button on top right corner).
It can be done by setting the property of the dialog but that is not what i want.
Thanks
|
|
|
|
|
Try this: GetSystemMenu(FALSE)->EnableMenuItem(SC_CLOSE, FALSE);
|
|
|
|
|
Stlan wrote:
Try this: GetSystemMenu(FALSE)->EnableMenuItem(SC_CLOSE, FALSE);
HI Stlan, Hows life going long time no see, no mail
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
Fine, Thanks! I had not too much time to wander on CP in the last days! (heavy work load this last days ) The week-end was fine however. And you ? How is your new job ? Are your new colleagues nice ?
By the way, I see at the TV there is a lot of troubles in India because of floods due the rain season. I hope everything is OK for you and your family.
|
|
|
|
|
I want resize a bitmap and save it again
how can do it?
|
|
|
|
|
If u mean at run time you have to use OnSize();
/\|-||\/|/\|)
|
|
|
|
|
Try to load the BMP into a CBitmap/CImage object, attach it to a CDC
and then you can use CDC.StrechBlt, now come back to the CImage and save it!
Let me know. Bye bye
|
|
|
|
|
Hello,
I'm experiancing some trouble with an MMF. I've created a class that manages one MMF and one view of that file. I've also created another class that manages some cache using the MMF class.
The MMF class has no problems of its own that I'm aware of, but the caching class has a problem when a new view has to be created. After I cross the view boundraries (and map a new view), one pointer in the heap becomes invalid. The data it holds is still the same, but operator delete[] asserts with an invalid heap pointer exception.
I must also note that the base address of the view is almost the same as the variable. The base address = 0x01b40000. The address of the variable is: 0x01c0e988 and the size is 72 bytes. To me it seems that the variable is not in the view, but I don't know why my pointer is corrupted.
After the initial write I perform some validation checks: IsBadReadPointer() to be precise and it succeeds.
Did anybody experiance something like this before? Anybody has any idea what might be the problem?
Behind every great black man...
... is the police. - Conspiracy brother
Blog[^]
|
|
|
|
|
Well, I solved the problem. The problem was not in unmapping the view, not in mapping the view, it was in the function which calculated the offset of the data in the view. The offset was reset when a new MMF was created, but not when a new view of a MMF was created. This lead to writing outside the view, which in turn corrupted the heap.
I guess that a complete heap check is done after each allocation and deallocation.
Behind every great black man...
... is the police. - Conspiracy brother
Blog[^]
|
|
|
|
|
Respected all
Regards!
how i can read data from a data file which has extenstion is *.Dat which is in the follwing format
---------------------------
filename.dat
data file
genertaed from the processing of the control system
XLOC YLOC INDIX
45 56 2344
56 67 1245
50 90 4562
45 87 9337
-----------------------------
and in the given data file i have to read only the data of columns under XLOC,YLOC,INDIX and the file always is in this format.
So please guide me.
waiting for + response.
david
|
|
|
|
|
Use an ifstream. Once you get past the first lines, declaring an int and using >> will work fine, so long as you have some error handling code if the file is corrupted.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|