Question: Alright, I'm new to scripting and I'm trying to edit a batch script file that sends an email when a file with an extension of .ecl is in a folder longer than 5 min or so. But there are other files with a .ecl.part extension that get flagged and it sends an email instead of the .ecl files. I'm curious if there is something I can add so that it will send an email when there are .ecl files in the folder for more than 5 min and ignore the .ecl.part files. I read one for someone with Linux who used [!(.extension to exclude)].extension not to exclude, I'm just wondering if this will work for my windows batch script. If it will work do I add it just like that or do I add it like this .extension not to exclude[!(.extension to exclude)]

Here is the part of the script in question:

```
     for /f "tokens=1-5 delims=:, " %%a in ('forfiles /p z: /d +0 /s /m *.ecl /c "cmd /c if @isdir==FALSE echo @file,@ftime"') do (
     set  fnam=%%a
     set   fhr=%%b
     set  fmin=%%c
     set  fsec=%%d
     set fampm=%%e

     if "!fampm!" == "PM" if "!fhr!" neq "12" (set /a "fhr=!fhr!+12")

```

There is more of the script, I didn't set this up, and the person who did isn't being very helpful which is why I came here.

Answer: 
You're only initialising `curmouse` on `WM_MOUSEMOVE`, not `WM_LBUTTONUP` - so the values in there when you actually get a button up will be random.
SetCapture() restricts the mouse messages to the window of which you passed the handle. Unless you call a ReleaseCapture() the mouse messages on the other window cannot be interpreted.Using SetCapture() and never calling ReleaseCapture() is not a good coding practice.

If your rect is in the other window the PtInrect is not going to work fine.
Also If you want to know whether the user clicked in the rect region you can use the mouse point you got during the WM\_LBUTTONDOWN message.