| View previous topic :: View next topic |
| Author |
Message |
ahklerner
Joined: 26 Jun 2006 Posts: 1205 Location: USA
|
Posted: Fri Sep 07, 2007 12:08 am Post subject: |
|
|
| Skan wrote: | | BoBoĻ wrote: | | I owe you a लस्सी |
 |
yogurt drink?????????
(googled it) |
|
| Back to top |
|
 |
SKAN
Joined: 26 Dec 2005 Posts: 5884
|
Posted: Fri Sep 07, 2007 8:59 am Post subject: |
|
|
Lassi is a Curd-shake ( like milk-shake ) with added flavour.  |
|
| Back to top |
|
 |
shader
Joined: 29 Oct 2004 Posts: 41
|
Posted: Sat Oct 13, 2007 6:47 pm Post subject: |
|
|
Hi Skan, I've found that you wrote:
| Quote: | | The shell receives HSHELL_GETMINRECT ( with a shellhook structure ) whenever a window is being Minimised/Maximised. A script may monitor it to Minimize a window to the tray. |
How is supposed to detect when a window is being minimized or resized?? I cannot receive any HSHELL_GETMINRECT when minimizing/maximizing a window, only a HSHELL_WINDOWACTIVATED appears to the shell listener. What do you mean with "with a shellhook structure "? Any idea?. Thank you. |
|
| Back to top |
|
 |
SKAN
Joined: 26 Dec 2005 Posts: 5884
|
Posted: Sat Oct 13, 2007 11:05 pm Post subject: |
|
|
| Quote: | Experiment 5:
The shell receives HSHELL_GETMINRECT ( with a shellhook structure ) whenever a window is being Minimised/Maximised. A script may monitor it to Minimize a window to the tray. Here is a working example:
| Code: | Gui +LastFound
hWnd := WinExist()
DllCall( "RegisterShellHookWindow", UInt,hWnd )
MsgNum := DllCall( "RegisterWindowMessage", Str,"SHELLHOOK" )
OnMessage( MsgNum, "ShellMessage" )
Return ; // End of Auto-Execute Section //
ShellMessage( wParam,lParam ) {
If ( wParam = 5 ) { ; HSHELL_GETMINRECT
wID := NumGet( lParam+0 ) ; first member ( DWord ) of SHELLHOOKINFO structure is hWnd
WinGet, mState, MinMax, ahk_id %wID%
If ( mState = -1 ) { ; Window is being minimized
WinGetTitle, Title, ahk_id %wID%
TrayTip, Window was minimized!, %Title%
}
}
} |
|
@shader: The above example code works for me. Let me know the status so I will update the original post.
Thanks.
Edit:
Tested in:
Win XP SP2
Vista Home Premium
Last edited by SKAN on Mon Oct 15, 2007 2:52 pm; edited 1 time in total |
|
| Back to top |
|
 |
shader
Joined: 29 Oct 2004 Posts: 41
|
Posted: Sun Oct 14, 2007 12:09 pm Post subject: |
|
|
| Hi Skan, it doesnt work for me. OnMessage never return a 5 wParam message when minimized. I dont know why it doesnt return that message. Thanks. |
|
| Back to top |
|
 |
SKAN
Joined: 26 Dec 2005 Posts: 5884
|
Posted: Sun Oct 14, 2007 5:16 pm Post subject: |
|
|
What is your OS ?  |
|
| Back to top |
|
 |
shader
Joined: 29 Oct 2004 Posts: 41
|
Posted: Sun Oct 14, 2007 6:25 pm Post subject: |
|
|
| XP Pro SP2 spanish |
|
| Back to top |
|
 |
SKAN
Joined: 26 Dec 2005 Posts: 5884
|
Posted: Sun Oct 14, 2007 9:22 pm Post subject: |
|
|
I am unsure about this, but try replacing
DllCall( "RegisterWindowMessage", Str,"SHELLHOOK" )
with
DllCall( "RegisterWindowMessageW", Str,"SHELLHOOK" )
 |
|
| Back to top |
|
 |
shader
Joined: 29 Oct 2004 Posts: 41
|
Posted: Sun Oct 14, 2007 11:40 pm Post subject: |
|
|
| No, it doesnt work. I hope someone can tell if he's having same behaviour or is a fault of my system. Thanks. |
|
| Back to top |
|
 |
Thalon
Joined: 12 Jul 2005 Posts: 640
|
|
| Back to top |
|
 |
SKAN
Joined: 26 Dec 2005 Posts: 5884
|
Posted: Mon Oct 15, 2007 2:13 pm Post subject: |
|
|
@Thalon : Thanks for the confirmation  |
|
| Back to top |
|
 |
Superfraggle
Joined: 02 Nov 2004 Posts: 848 Location: London, UK
|
Posted: Mon Oct 15, 2007 2:19 pm Post subject: |
|
|
Works on my XP SP2 UK English, Although I did have a strange occurance of having 32772 instead of 17 for hshell_rudeactivated or whatever it is. _________________ Steve F AKA Superfraggle
http://r.yuwie.com/superfraggle |
|
| Back to top |
|
 |
0inprogram
Joined: 06 Dec 2007 Posts: 21 Location: chennai
|
Posted: Fri Dec 21, 2007 5:17 pm Post subject: |
|
|
using code of experiment 1, how can i check whether a site is accessed thru the browser and run a set of commands based on it....
like filling the id and password ,etc....
i tried putting the name of the website in the "title" field, but it didnt work,... |
|
| Back to top |
|
 |
0inprogram
Joined: 06 Dec 2007 Posts: 21 Location: chennai
|
Posted: Fri Dec 21, 2007 5:20 pm Post subject: |
|
|
this is the code i was talking abt ,
| Code: | #Persistent
SetBatchLines, -1
Process, Priority,, High
Gui +LastFound
hWnd := WinExist()
DllCall( "RegisterShellHookWindow", UInt,hWnd )
MsgNum := DllCall( "RegisterWindowMessage", Str,"SHELLHOOK" )
OnMessage( MsgNum, "ShellMessage" )
Return
ShellMessage( wParam,lParam ) {
If ( wParam = 1 ) ; HSHELL_WINDOWCREATED := 1
{
WinGetTitle, Title, ahk_id %lParam%
If ( Title = "Windows Task Manager" )
{
WinClose, ahk_id %lParam%
; Run, Calc.exe ; instead
}
}
} |
|
|
| Back to top |
|
 |
SKAN
Joined: 26 Dec 2005 Posts: 5884
|
Posted: Fri Dec 21, 2007 5:39 pm Post subject: |
|
|
| 0inprogram wrote: | | i tried putting the name of the website in the "title" field, but it didnt work,... |
This SHELLHOOK method will at most can alert you when a IEFrame ( or mozilla or opera ) becomes active.
You have to check the titlebar / address bar if want to conditionally execute code.
 |
|
| Back to top |
|
 |
|