... does not return $NM_CLICK (-2), but a lot of $NM_CUSTOMDRAW (-12). It doesn't matter, if I click or just hover over this button. It's always -12.

Any idea, what this means or how I can detect the normal click?

Andi

PS:

I'll try to write a short example script, but I'm not sure if it will reproduce the problem.

Until then, I'll give you the real script, but it's quite long though.

Attention: This script probably will not run on your machine, as this program reads in some specific folder and expects a specific folder structure.

The interesting part:

At the beginning of the script, the main gui is built. There, a button $btnSync is linked to the function sync(). This functions creates the child gui and does some file operations. The child gui has the button $btnStopClose, which won't be linked to a function until file operations are completed. The problem does not occur because of the file operations, as they are taken care of a second script. So, the gui stays responsive.

In WM_NOTIFY() at the end of the script I try to capture a click on the button $btnStopClose. This doesn't work right. The line commented as "debug" prints "-12" 6 times, when I click that button once.

Edit: Glancing at your code you have a number of custom includes, you're not afriad of indexing (as many are), you have calls to GDI+ and WinAPI. So, I'm sure you know exactly what you're doing, and there's nothing wrong with what appears to me to be an odd version of WM_NOTIFY. I've never bothered to use eventmode and would guess that must affect the parameters of the WM_NOTIFY message?

Share this post

Link to post

Share on other sites

Spiff59 51

Ah... ListViews must report as being their own window, and that's where I'm used to using WM_NOTIFY. You're, of course, correct, after commenting out some of your code and inserting a "ToolTip($wParam & " " & Binary($iCode))" after "Case $treelocal" and "$Case $treeremote" I see your WM_NOTIFY is working exactly as you described. Sorry for the distraction.

Share this post

Link to post

Share on other sites

Der_Andi 0

[...] you're not afriad of indexing (as many are), you have calls to GDI+ and WinAPI. So, I'm sure you know exactly what you're doing, and there's nothing wrong with what appears to me to be an odd version of WM_NOTIFY. I've never bothered to use eventmode and would guess that must affect the parameters of the WM_NOTIFY message?

Well, to be honest, I just copied some GDI code found here in the forum and modified it a little bit. It also was my first encounter with GDI, so I just hoped it would work. Same story for those WinAPI calls. ;-)