Hallo.
Is it possible to set an hook for
Window generation
Window move
That set an asynchronous function call when a new Window is generate or an existing Window is moving.
I know there is winwait but it is not asynchronous, is stop execution waiting for a new Window. I need no stop execution, but an automatic function call when a new Window is generated or an existing Window is moving.
I need a function like existing Input Hook for keyboard, but for Window.
Tank you very much.
Hook for window
Re: Hook for window
Hallo,
try:but when "an existing Window is moving"
could be a problem for a WinHook.
viewtopic.php?style=19&t=24473
try:
Code: Select all
DllCall("RegisterShellHookWindow", "UInt", A_ScriptHwnd)
OnMessage(DllCall("RegisterWindowMessage", "Str", "SHELLHOOK"), "act")
Return
act(wParam, lParam)
{
If (wParam = WINDOWCREATED := 1)
SoundBeep
}
could be a problem for a WinHook.
viewtopic.php?style=19&t=24473
Re: Hook for window
what are you trying to achieve? if i had to gues you want some sort of winmove that sets a window to position or size whenever it is active?
if so you could add all those windows to a group and then have a winwaitactive inside a loop for that group and then have some winmove code behind that for my fl studio setup i have something simular that sets all my windows where i want them and keeps them there no matter what. and a few are only being resized as they do not remember their size. then i have another script that waits for fl studio to close so it can close that script and then itself and that bypasses the winwait in one script that would keep it on pause until that window closes
my windows have nothing to do with your setup ofc but just to show you what i mean: in the startup section i have this:
and then my loop looks like this:
the first 2 are only being resized whenever active and the rest is fixed to a position
then in another script i have a winwaitclose that deals with closing this script and also itself
if so you could add all those windows to a group and then have a winwaitactive inside a loop for that group and then have some winmove code behind that for my fl studio setup i have something simular that sets all my windows where i want them and keeps them there no matter what. and a few are only being resized as they do not remember their size. then i have another script that waits for fl studio to close so it can close that script and then itself and that bypasses the winwait in one script that would keep it on pause until that window closes
my windows have nothing to do with your setup ofc but just to show you what i mean: in the startup section i have this:
Code: Select all
GroupAdd, MoveResizeWindows , ahk_class TPluginForm , Bloom Drum Breaks
GroupAdd, MoveResizeWindows , ahk_class TPluginForm , Bloom Bass Impulse
GroupAdd, MoveResizeWindows , ahk_class TMIDIInputForm , Remote control settings
GroupAdd, MoveResizeWindows , ahk_class TFXForm , Mixer
GroupAdd, MoveResizeWindows , ahk_class TPluginForm , Mute & Solo Panel
GroupAdd, MoveResizeWindows , ahk_class TPluginForm , Control Surface
GroupAdd, MoveResizeWindows , ahk_class TPluginForm , Correlometer
GroupAdd, MoveResizeWindows , ahk_class TPluginForm , Multimeter
GroupAdd, MoveResizeWindows , ahk_class TPluginForm , Tuner
GroupAdd, MoveResizeWindows , ahk_class TPluginForm , VPS Scope CM edition
Code: Select all
Loop{
WinWaitActive, ahk_group MoveResizeWindows
WinMove, ahk_class TPluginForm , Bloom Drum Breaks , , , 1345 , 918
WinMove, ahk_class TPluginForm , Bloom Bass Impulse , , , 1345 , 918
WinMove, ahk_class TMIDIInputForm , Remote control settings , 1921 , 129 , ,
WinMove, ahk_class TPluginForm , VPS Scope CM edition , 3106 , 574 , 1516 , 857
WinMove, ahk_class TPluginForm , Correlometer , 1921 , 505 , 737 , 535
WinMove, ahk_class TPluginForm , Mute & Solo Panel , 2304 , 0 , 322 , 448
WinMove, ahk_class TPluginForm , Control Surface, 2304 , 448 , 322 , 299
WinMove, ahk_class TFXForm , Mixer , 2136 , 0 , 1721 , 624
WinMove, ahk_class TPluginForm , Multimeter , 2967 , 748 , 720 , 502
WinMove, ahk_class TPluginForm , Tuner , 3745 , 642 , 472 , 610
}
then in another script i have a winwaitclose that deals with closing this script and also itself
Who is online
Users browsing this forum: Bing [Bot], slowwd and 110 guests