|
I tried that a long time ago. It didnt work. I even used the correct includes.
-Ryan M.
|
|
|
|
|
Well, I assure you it works. I have a half dozen programs that use this code, with some minor modifications of course.
Anyone who thinks he has a better idea of what's good for people than people do is a swine.
- P.J. O'Rourke
|
|
|
|
|
sorry buddy but it doesnt seem to search for folders that "contain a certain string" and not only that it doesn't seem to go through sub folders. Also it doesnt find all the folders that contain the string. Just another thing to say it doesnt start from the top level directory, C:\ for instance. So dont go saying that yours works because it dont
-Ryan M.
|
|
|
|
|
It doesn't search for folders which contain part of a string, it recursively looks for folders which ARE a specified string starting from the current directory, which is what the original poster was looking for. I never said otherwise. It is your job to modify the source for your own use.
If you modify the "else if" section in "walk" to the following:
else if (!IsDots(findData.cFileName))
{
::SetCurrentDirectory(findData.cFileName);
TCHAR path[260];
::GetCurrentDirectory(sizeof(path) / sizeof(TCHAR), path);
_tprintf(_T("Changing to: %s\n"), path);
foundDir = Walk(pDirToFind, pFinalPath);
::SetCurrentDirectory(_T(".."));
}
Then add:
::SetCurrentDirectory(_T("\\"));
in main() just after the first if() section, it will search the entire drive, displaying the directories recursed, until it finds the directory MATCHING that from the command line.
If this doesn't work for you, you are compiling and/or running it incorrectly. You are also making no effort to determine why it isn't performing as you expected.
Anyone who thinks he has a better idea of what's good for people than people do is a swine.
- P.J. O'Rourke
|
|
|
|
|
thanks. I got it to work. sorry i got pissy.
-Ryan M.
|
|
|
|
|
|
uhh yeah they can. folder name like "Program Files" Okey. "Files" is a string geneous
-Ryan M.
|
|
|
|
|
Heh, that would have almost been a good flame except you misspelled "genius".
My apologies for trying to help you. I will not make that mistake again.
--Mike--
Personal stuff:: Ericahist | Homepage
Shareware stuff:: 1ClickPicGrabber | RightClick-Encrypt
CP stuff:: CP SearchBar v2.0.2 | C++ Forum FAQ
----
Pinky, are you pondering what I'm pondering?
I think so Brain, but if we shaved our heads, we'd look like weasels!
|
|
|
|
|
I forgot to tell you i am stupid. sorry for getting angry.
-Ryan M.
|
|
|
|
|
I need to handle and override the event that works when user presses the close button on the upper right (on the left of minimize and maximize buttons)?
Thanks;)
|
|
|
|
|
That event is signaled via a WM_SYSCOMMAND notification message, with the wParam value set to SC_CLOSE .
Software Zen: delete this;
|
|
|
|
|
You could probably just handle the WM_CLOSE message and accomplish what you want.
|
|
|
|
|
Nope, it didn't work out
|
|
|
|
|
Then either I'm not sure what you're trying to accomplish, or you went about it the wrong way.
If you could post a code snippet (the part that didn't work), or if you could explain exactly what you are wanting to accomplish, then either myself or someone else would surely be able to help you.
|
|
|
|
|
I agree with Curious_George since your app may be closed by other methods, such as right clicking on the app in the task bar and selecting close or using Alt-F4.
Otherwise, use Spy++ to see what the message is.
Anyone who thinks he has a better idea of what's good for people than people do is a swine.
- P.J. O'Rourke
|
|
|
|
|
I process the WM_CLOSE message and override the virtual OnCancel() if it is a dialog to catch the close attempts. If you do not call the base class for either of those, your window will not close.
|
|
|
|
|
OK, I did the same. The window closes there is no problem with that. But the problem is; I am using a process which uses soundcard inside the program, I play some voice on soundcard, and I want to stop it before user presses close button and closes application. I have the function that closes my process, I implemented an event handler to the exit event on exit menu item, and it worked. I wanted to do the same for event that works when close button is pressed, but this time my application window closes but the process does not, it still works. And when I hook up Task Manager i see that my application is also still working, which shows me that my window is destroyed but the application is still running.
|
|
|
|
|
Hi every
I'm wrtting an application, and i want to change my dialog( system button, ...) same as MAC (Aqua effect).
Any one can help me.
Thanks very much
|
|
|
|
|
this is all very nice and if u really want to then search for skinnable dialogs and skinnable apps howto's
HOWEVER i think its a very bad idea for a few reasons...
1). if i set my desktop theme and u ignore it im going to be unhappy
2). windows has a standard look and feel for a good reason - it makes it easy for people to figure out how to use new apps
just my 2cents worth
"there is no spoon" biz stuff about me
|
|
|
|
|
|
I've created a MFC app with the Appwizzard.
The main view is a child of CFormView.
In the associated dialog i've created a listbox, and created the control variable for it.
the app's name is "hilos"
In hilosView.cpp i include a class called "hilos.h" as i need to create an object of that class and use it's member functions.
In "hilos.cpp" i need to be able to write in the listbox, but as in hilosView.cpp i include the header of that file, i can't include in hilos.h the file hilosView.h to see the listbox.
the listbox's control variable name is m_list, and it's a member of the (CHilosView : public CFormView) class. I can't declare an extern in hilos.cpp to be able to use it.
what could i do?
thanks!
|
|
|
|
|
do a forward declaration...
e.g. in the header file
class CHilos;
class CHilosView : public CFormView
{
// etc
};
and then put the include in the cpp file.
Hope this helps,
Andy
|
|
|
|
|
Hey,
I am using the "Printing without the Document/View Framework" tutorial, and I was wondering if anyone knows how to print text from edit and combo boxes in a nice grid type layout.
Thanks for the help
|
|
|
|
|
hi everyone
i try to set button control to unicode text (Persian) in VC .NET,but i cant.how do it
thanx
|
|
|
|
|
I have been working with the same VC++ project, modifying as I needed.
Now when I try to used one of the dialogs, I get an unsupported operation error.
The log file tells me that the dialog I was trying to use is not registered CDdialog_put_text
I am not a programmer - just someone that has to modify existing projects occasionally.
If anyone can help, it would be greatly appreciated
|
|
|
|