You answered before I had edited my answer. It doesn't work for me.

Are we talking about the same thing? My .elseif uMsg==WM_LBUTTONUP is in the CCHookProc PROC.
Posted on 2003-06-27 00:51:51 by minor28
What version of windows ? I'm on 2K sp3
Posted on 2003-06-27 00:57:02 by donkey
My version is 2k, sp2
Posted on 2003-06-27 01:02:11 by minor28
Just tried it on my 98SE box and it works perfectly there as well. I think that maybe our vesions have deviated, send me your version via email and I'll take a look at why. I never incorporated the auto color change on capture as it doesn't display well on my LCD.
Posted on 2003-06-27 01:06:06 by donkey
Here is my code and dll. The ChildWindowFromPoint returns NULL for me. As I said before I suppose it is due to GetCursorPos gives values in screen coordinates and ChildWindowFromPoint requires client coordinates values.
Posted on 2003-06-27 01:23:51 by minor28
Use this:
.elseif uMsg==WM_LBUTTONUP

invoke GetCursorPos,ADDR lpPoint
invoke ScreenToClient,hCCDlg,ADDR lpPoint
invoke ChildWindowFromPoint,hCCDlg,lpPoint.x,lpPoint.y
push eax
invoke GetDlgItem,hCCDlg,710
pop ecx
.IF eax==ecx
invoke SetDlgItemInt,hCCDlg,705,120,FALSE
.ENDIF


Your version has several problems, the pointerforthe luminosity is no longerupdating and the capture doesn't work any longer on my 98SEbox. Use thisone as a base-line
Posted on 2003-06-27 01:32:37 by donkey
Adding the line "invoke ScreenToClient,hCCDlg,ADDR lpPoint" makes the luminosity work but the capture doesn't. With my complicated code all works perfectly. Are there any other differences in your sent back code?
Posted on 2003-06-27 02:09:58 by minor28
As I said, I did not include the code to update the position in the color dither box real time during a capture. It is essentially the same code as I removed earlier, I don't believe I changed anything but the lum = 120. I think you may be over-complicating a small addin. The complexity of the program must not exceed it's function, just my opinion but making it too complex just introduces bugs.

You do realize that you commented out the WM_MOUSEHOOK message, that's why your capture is not working. Also if you're not going to use the colored dialog you have to comment out the whole message or the dialog will not be updated as the messages will be assumed to have been processed. you cannot do as you have done here:
	.IF uMsg == WM_CTLCOLORDLG

; mov eax,wParam
; mov hDC,eax
; invoke SetTextColor,hDC,0
; invoke SetBkColor,hDC,00FF8080h
; mov eax,hBrush
ret

.ELSEIF uMsg == WM_CTLCOLORSTATIC
; mov eax,wParam
; mov hDC,eax
; invoke SetTextColor,hDC,0
; invoke SetBkColor,hDC,00FF8080h
; mov eax,hBrush
ret
Comment everything or leave everything in, there is no half way with a hook proc.
Posted on 2003-06-27 02:32:58 by donkey
Here it is all fixed up, all features are working perfectly with the simple version of the lum=120.
Posted on 2003-06-27 02:56:43 by donkey
It wasn't my intention to persuade you that my code is best. All of this is because I am curious and in the learning phase of programming. I really appreciate that you took your time to penetrate my notions. I understand that I unintentional happen to comment the WM_MOUSEHOOK message. Now it works fine with your "less complicated" code and the capture too.

Best regards
Posted on 2003-06-27 03:21:10 by minor28

It wasn't my intention to persuade you that my code is best. All of this is because I am curious and in the learning phase of programming. I really appreciate that you took your time to penetrate my notions. I understand that I unintentional happen to comment the WM_MOUSEHOOK message. Now it works fine with your "less complicated" code and the capture too.

Best regards

I wasn't being derogatory, I was just trying to say that most times the simplest solution is the best as there is less to check when you debug the code. I still like your version of the addin, but the overly complex bit was asking to be simplified, that's all.

At any rate, glad that I could help. Still haven't gotten my air-conditioning fixed (we're in a heat wave here and it's tough to get a freon guy) so I'm not sleeping much at night. Nothing much better to do than code and be bitchy :)
Posted on 2003-06-27 03:40:40 by donkey