I have a program that has a weird problem I can't figure out. So hey, what a deal: you get to look at it and maybe figure out what the hell is going on with it. How could you not love that?
I'm posting the executable only, not code (yet). It's a file finder that finds files either by name or by contents. Works pretty well, if I don't say so myself (I'm especially happy with the text searcher, which uses a FSA (finite state automaton, aka state machine)).
But it has an annoying problem: for long searches, I put in a "Waiting" dialog box that pops up, with an active progress-bar control, so you can see that something is actually happening. This works OK--the first couple of times (and sometimes not even that). After that, the dialog pops up and then immediately disappears.
I threw in some debugging code and tapped the message stream. When it fails, the dialog procedure gets these messages right before dying:
Message: WM_NCACTIVATE
Message: WM_ACTIVATE
Message: WM_WINDOWPOSCHANGING
???[unknown]???: 144
Message: WM_WINDOWPOSCHANGING
Message: WM_WINDOWPOSCHANGED
Message: WM_DESTROY
Message: WM_NCDESTROY
I have no idea what 144 (hex 90) is; it ain't in windows.inc.
When I first found this problem, I was creating the dialog each time a search began and then getting rid of it with EndDialog(). I changed to only creating it once, then hiding it (with ShowWindow() ) until it was needed again, whereupon I un-hide it. But that didn't solve the problem.
One reason I'm posting this here is that I'm not sure the problem isn't with my computah. I'm running Windows 7 here, and my system is basically a total piece of shit, with lots of problems. In fact, the reason I wrote this in the first place is that the search function in my Explorer is totally broken. I've had lots of blue screens (none lately, strangely), it's slower than shit, and there are lots of other glitches. So it's hard to separate my coding mistakes from the condition of my OS.
About the program: the search term acts as if it's wildcarded ("test" will find files with that string anywhere in the name). Text search can be case-sensitive or -insensitive (filename searches are case-insensitive).
I'd really like to know of others see the same problem with that dialog as I do. Apart from that it's pretty good, I think. Fast enough. Consumes a lot of memory, though. (I think that's mainly the listview eating up tons of memory for its string storage.)