No WM_MOUSEMOVE Message sent in Win 10 Gui w/ Transcolor set Topic is solved

Get help with using AutoHotkey and its commands and hotkeys
dmatch
Posts: 43
Joined: 02 Oct 2013, 09:56

No WM_MOUSEMOVE Message sent in Win 10 Gui w/ Transcolor set

29 Jun 2017, 14:39

On Win 7 the following code received WM_MOUSEMOVE messages when the mouse entered the Gui when a TransColor was set. On Win 10 I see no messages UNLESS the mouse is over some text that is in the Gui. This was not the case in Win 7.

Any ideas why this would be? Any ideas for a workaround or other solution would be appreciated.

Code: Select all

CoordMode, Mouse, Screen
WM_MOUSEMOVE=0x200
OnMessage(WM_MOUSEMOVE, "MOUSEMOVE")
...
...
CustomColor = EEAA99  ; Can be any RGB color (it will be made transparent below).
Gui +LastFound +AlwaysOnTop -Caption +border +ToolWindow  ; +ToolWindow avoids a taskbar button and an alt-tab menu item.
;Gui +LastFound +AlwaysOnTop +ToolWindow
Gui, Color, %CustomColor%
...
...
WinSet, TransColor, %CustomColor% 220
...
...
MOUSEMOVE()
{
   ; Get window out of the way when mouse is over it.
   MouseGetPos, X, Y
   if(X > 100) ; Window must be on right side so move to left side
         WinMove, NetMonitor,, 5
   else ;window must be on left side so move to right side
         WinMove, NetMonitor,, A_ScreenWidth-45
   return
}
dmatch
Last edited by dmatch on 29 Jun 2017, 15:16, edited 1 time in total.
Riki81
Posts: 7
Joined: 27 Jun 2017, 11:58

Re: No WM_MOUSEMOVE Message sent in Win 10 Gui w/ Transcolor set

29 Jun 2017, 14:56

try this example

Code: Select all

CoordMode, Mouse, Screen
WM_MOUSEMOVE=0x200
OnMessage(WM_MOUSEMOVE, "MOUSEMOVE")


CustomColor := 000000  ; Can be any RGB color (it will be made transparent below).
Gui +LastFound +AlwaysOnTop -Caption +border +ToolWindow  ; +ToolWindow avoids a taskbar button and an alt-tab menu item.
Gui, Color, %CustomColor%
Gui, Show, w200 h200 Center


MOUSEMOVE()
{
	MouseGetPos, xpos, ypos 
	ToolTip, %xpos%x%ypos%
	return
}
dmatch
Posts: 43
Joined: 02 Oct 2013, 09:56

Re: No WM_MOUSEMOVE Message sent in Win 10 Gui w/ Transcolor set

29 Jun 2017, 15:10

That test does not use a TransColor (transparent window color). I didn't include that in my snippets, sorry.
Edit: Added Transcolor snippet to original post.

dmatch
dmatch
Posts: 43
Joined: 02 Oct 2013, 09:56

Re: No WM_MOUSEMOVE Message sent in Win 10 Gui w/ Transcolor set

29 Jun 2017, 15:36

Here is a reduced version of the script (functional) that demonstrates the behavior in Win 10:

Code: Select all

#NoEnv
Hidden:=0
DetectHiddenWindows on
CoordMode, Mouse, Screen
WM_MOUSEMOVE=0x200
OnMessage(WM_MOUSEMOVE, "MOUSEMOVE")

x:=5
y:=A_ScreenHeight-420
yi:=0
x2:=A_ScreenWidth-40
width:=30
height:=220

CustomColor = EEAA99  ; Can be any RGB color (it will be made transparent below).
Gui +LastFound +AlwaysOnTop -Caption +border +ToolWindow  ; +ToolWindow avoids a taskbar button and an alt-tab menu item.
;Gui +LastFound +AlwaysOnTop +ToolWindow
Gui, Color, %CustomColor%
Gui, Margin, 0, 0
Gui, Font, S10 C0xff0000, Tahoma
Gui, Add, Text, x2 y%yi%, XXX

;Make all pixels of this color transparent and make the text itself barely translucent (220):
WinSet, TransColor, %CustomColor% 220
Gui, Show, x%x% y%y% w%Width% h%Height%, NetMonitor
return

GuiClose:
 ExitApp

MOUSEMOVE()
{
	SoundBeep
   ; Get window out of the way when mouse is over it.
   MouseGetPos, X, Y
   if(X > 100) ; Window must be on right side so move to left side
         WinMove, NetMonitor,, 5
   else ;window must be on left side so move to right side
         WinMove, NetMonitor,, A_ScreenWidth-45
   return
}
A skinny tall transparent window with very small width border will appear at left of screen with red XXX in the Gui.

dmatch
Peared
Posts: 12
Joined: 02 Dec 2015, 12:32

Re: No WM_MOUSEMOVE Message sent in Win 10 Gui w/ Transcolor set

29 Jun 2017, 16:25

Code: Select all

#NoEnv
Hidden:=0
DetectHiddenWindows on
CoordMode, Mouse, Screen
WM_MOUSEMOVE=0x200
OnMessage(WM_MOUSEMOVE, "MOUSEMOVE")
x:=5
y:=A_ScreenHeight-420
yi:=0
x2:=A_ScreenWidth-40
width:=30
height:=220
WinSet, Transparent,220 ; <-----------
Gui +LastFound +AlwaysOnTop -Caption 
Gui, Color, %CustomColor%, %CustomColor%
Gui, Margin, 0, 0
Gui, Font, S10 C0xff0000, Tahoma
Gui, Add, Text, x2 y%yi%, XXX
CustomColor = EEAA99  ; Can be any RGB color (it will be made transparent below).
Gui, Show, x%x% y%y% w%Width% h%Height%, NetMonitor
WinSet, TransColor, %CustomColor% 100, 
winset, redraw
return
dmatch
Posts: 43
Joined: 02 Oct 2013, 09:56

Re: No WM_MOUSEMOVE Message sent in Win 10 Gui w/ Transcolor set

29 Jun 2017, 17:36

Thanks for feedback, but that does the same thing. Only get WM_MOUSEMOVE when mouse is over text.

dmatch
User avatar
noname
Posts: 509
Joined: 19 Nov 2013, 09:15

Re: No WM_MOUSEMOVE Message sent in Win 10 Gui w/ Transcolor set  Topic is solved

30 Jun 2017, 01:23

It does not work in winXP either and it seems logical that it does not work because the window is transparent.I do not have win7 so cannot test it there but you have a workaround with a settimer.
Running a timer at 20ms has no real impact on cpu loading ( even on my 12 year old Celeron PC :) )

Here is a "very crude" adaption ( I changed some values ) :

Code: Select all

#NoEnv
Hidden:=0
DetectHiddenWindows on
CoordMode, Mouse, Screen


x:=5
y:=A_ScreenHeight-420
yi:=0
x2:=A_ScreenWidth-40
width:=30
height:=220

CustomColor = EEAA99  ; Can be any RGB color (it will be made transparent below).
Gui +LastFound +AlwaysOnTop -Caption +border +ToolWindow  ; +ToolWindow avoids a taskbar button and an alt-tab menu item.
;Gui +LastFound +AlwaysOnTop +ToolWindow
Gui, Color, %CustomColor%
Gui, Margin, 0, 0
Gui, Font, S10 C0xff0000, Tahoma
Gui, Add, Text, x2 y%yi%, XXX
;Make all pixels of this color transparent and make the text itself barely translucent (220):
WinSet, TransColor, %CustomColor% 220
Gui, Show, w%width% h%height%, NetMonitor

SetTimer, alert,20
return

alert:
WinGetPos, xw,yw,ww,hw,NetMonitor
MouseGetPos, xm,ym
if (xm>xw and xm<xw+ww) and (ym>yw and ym<yw+hw)
  {
  SoundBeep
  WinMove, NetMonitor,,% xw+50
  }
return

esc::
 ExitApp
soundcloud.com/user-32706894
dmatch
Posts: 43
Joined: 02 Oct 2013, 09:56

Re: No WM_MOUSEMOVE Message sent in Win 10 Gui w/ Transcolor set

30 Jun 2017, 09:49

Good workaround. Thanks noname that works.

I already had a 1 second timer in the FULL script so I put your idea into effect in that timer. So, if anything, it is more efficient that way. Interesting that Win 7 would send WM_MOUSEMOVE messages when using a transcolor in a Gui but XP and Win 10 don't. ??

dmatch

Return to “Ask For Help”

Who is online

Users browsing this forum: Aza13, Bing [Bot], Google [Bot], MSN [Bot], tasonface and 166 guests