| View previous topic :: View next topic |
| Author |
Message |
Username is taken Guest
|
Posted: Tue Jul 28, 2009 10:08 pm Post subject: |
|
|
| Nice |
|
| Back to top |
|
 |
TLM
Joined: 21 Aug 2006 Posts: 2926 Location: The Shell
|
|
| Back to top |
|
 |
howardb1 Guest
|
Posted: Sat Aug 22, 2009 6:40 am Post subject: How do you hWnd out of the shellhook structure? |
|
|
I don't know if you're still working on this AutoHotKey trick or not, but if you are ...
You say "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." In the code I'm writing based on your techique I just need the hWnd member, but it isn't clear how you access it?
My script hides the taskbar before opening a program, but I want to restore the taskbar when the program exits, or when it is minimized or looses focus. In the last two cases I'll then hide the taskbar when the program becomes active again.
I've written the exit part, and am now working on the minimize part, but I don't see an event message that tells me when the window is loosing focus, only when it gets it back.
Thank you. |
|
| Back to top |
|
 |
SKAN
Joined: 26 Dec 2005 Posts: 8688
|
Posted: Wed Aug 26, 2009 6:27 am Post subject: Re: How do you hWnd out of the shellhook structure? |
|
|
| howardb1 wrote: | | You say "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." |
I was using Window 98 while I was experimenting.. and then I shifted My OS to 2k and currently using XP.
I can safely say HSHELL_GETMINRECT is very unpredictable in different OSes.
( If it works at all and ) If you are to use it only on your system, you are lucky. Otherwise, I do not recommend SHELLHOOK to monitor Maximize/Minimize events. |
|
| Back to top |
|
 |
majkinetor
Joined: 24 May 2006 Posts: 4511 Location: Belgrade
|
Posted: Mon Sep 07, 2009 9:04 am Post subject: |
|
|
Does anybody have problems with Shell hook and activation ?
I don't receive notifications on Vista. For instance, here is the output of SKANs utuility where different windows were activated:
| Code: | UNKNOWN [32772]
hWnd : 0x0
Title :
Class :
UNKNOWN [32772]
hWnd : 0x3f0184
Title : EditPlus [_Taskbar] - [D:\Utils\_Scripts\autohotkey\Shell\1.ahk]
Class : Afx:400000:8:10003:0:58044f
HSHELL_REDRAW [6]
hWnd : 0x0
Title :
Class :
HSHELL_REDRAW [6]
hWnd : 0x0
Title :
Class :
HSHELL_REDRAW [6]
hWnd : 0x0
Title :
Class :
UNKNOWN [32772]
hWnd : 0x1e0118
Title : Total Commander 7.04a
Class : TTOTAL_CMD
HSHELL_REDRAW [6]
hWnd : 0x0
Title :
Class :
HSHELL_REDRAW [6]
hWnd : 0x0
Title :
Class :
UNKNOWN [32772]
hWnd : 0x3f0184
Title : EditPlus [_Taskbar] - [D:\Utils\_Scripts\autohotkey\Shell\1.ahk]
Class : Afx:400000:8:10003:0:58044f
HSHELL_REDRAW [6]
hWnd : 0x0
Title :
Class :
UNKNOWN [32772]
hWnd : 0x0
Title :
Class :
HSHELL_REDRAW [6]
hWnd : 0x0
Title :
Class :
HSHELL_REDRAW [6]
hWnd : 0x0
Title :
Class :
UNKNOWN [32772]
hWnd : 0x3f0184
Title : EditPlus [_Taskbar] - [D:\Utils\_Scripts\autohotkey\Shell\1.ahk]
Class : Afx:400000:8:10003:0:58044f
HSHELL_REDRAW [6]
hWnd : 0x0
Title :
Class :
UNKNOWN [32772]
hWnd : 0x1e0118
Title : Total Commander 7.04a
Class : TTOTAL_CMD
UNKNOWN [32772]
hWnd : 0x2a8051e
Title : Tips N Tricks - Opera
Class : OpWindow
UNKNOWN [32772]
hWnd : 0x0
Title :
Class :
HSHELL_REDRAW [6]
hWnd : 0x0
Title :
Class :
HSHELL_REDRAW [6]
hWnd : 0x0
Title :
Class :
HSHELL_REDRAW [6]
hWnd : 0x0
Title :
Class :
UNKNOWN [32772]
hWnd : 0x2a8051e
Title : Tips N Tricks - Opera
Class : OpWindow
HSHELL_REDRAW [6]
hWnd : 0x0
Title :
Class :
UNKNOWN [32772]
hWnd : 0x1e0118
Title : Total Commander 7.04a
Class : TTOTAL_CMD
HSHELL_SYSMENU [9]
HSHELL_REDRAW [6]
hWnd : 0x0
Title :
Class :
HSHELL_WINDOWDESTROYED [2]
hWnd : 0x0
Title :
Class :
HSHELL_REDRAW [6]
hWnd : 0x0
Title :
Class :
UNKNOWN [32772]
hWnd : 0x0
Title :
Class : |
_________________
 |
|
| Back to top |
|
 |
majkinetor
Joined: 24 May 2006 Posts: 4511 Location: Belgrade
|
Posted: Tue Sep 08, 2009 8:34 am Post subject: |
|
|
Activation definitely doesn't work correctly. The same code works on XP and doesn't work on VISTA, and sometimes it even stops working in XP. _________________
 |
|
| Back to top |
|
 |
jjjames
Joined: 09 Aug 2009 Posts: 35
|
Posted: Thu Sep 24, 2009 6:18 am Post subject: |
|
|
Can't get "Always At Bottom" working. To me it seems just like any regular GUI window and isn't "stuck" below everything else. I downloaded your clock sample and it's not always at bottom.
Does the script need an update?
thanks anyhow...lot's of VERY useful scripts! |
|
| Back to top |
|
 |
Randallfanon Guest
|
Posted: Thu Nov 12, 2009 7:28 pm Post subject: |
|
|
[quote="SKAN"] | Quote: | | How to manipulate Binary data with Pointers ? |
I didn't even know AHK had pointers... this thread is epic in an extreme way.
THANK YOU |
|
| Back to top |
|
 |
randallf
Joined: 06 Jul 2009 Posts: 678
|
Posted: Thu Nov 12, 2009 7:31 pm Post subject: |
|
|
On a related note C is very powerful in pointers but the data type requirements are annoying... I'm not sure how AHK handles those inherent restrictions but it's pretty epic to just be able to define an actual string and then run pointers through it!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Do these techniques potentially allow AHK to read from crazy data structures like MP3 or what have you? |
|
| Back to top |
|
 |
Michael@Oz
Joined: 08 Nov 2009 Posts: 233 Location: Canberra Oz
|
Posted: Tue Mar 09, 2010 4:12 am Post subject: |
|
|
See TrayIcon_Cleanup() for nicer way. (Tested on XP, prob not OK on Win7) |
|
| Back to top |
|
 |
zhuluobin
Joined: 11 May 2009 Posts: 28
|
Posted: Thu Apr 29, 2010 1:36 pm Post subject: |
|
|
| i used shellhook code but while i right clicked 'my computer' on start menu to open 'system properties' i received nothing. |
|
| Back to top |
|
 |
TLM
Joined: 21 Aug 2006 Posts: 2926 Location: The Shell
|
Posted: Thu Apr 29, 2010 2:40 pm Post subject: |
|
|
| majkinetor wrote: | | Does anybody have problems with Shell hook and activation ? | Yes here!
I'm glad its not just me thats having shell notification problems.
I thought I wasnt feeding the proper hWnd or something.
In some cases even normal Windows Messages are not detected with OnMessage.
I think there has to be a more robust method for using a given handle ..
| majkinetor wrote: | | here is the output of SKANs utuility | Where to find it plz?
Oh, its Shell Spy.. Got it
Ok so it looks like the hook method only works on toplevel windows.
There must be a way to hook all window and even control handles! _________________
paradigm.shift:=(•_•)┌П┐RTFM||^.*∞ |
|
| Back to top |
|
 |
SKAN
Joined: 26 Dec 2005 Posts: 8688
|
Posted: Thu Apr 29, 2010 4:19 pm Post subject: |
|
|
| zhuluobin wrote: | | i used shellhook code but while i right clicked 'my computer' on start menu to open 'system properties' i received nothing. |
| TLM wrote: | | it looks like the hook method only works on toplevel windows. |
SHELLHOOK works only on toplevel windows. The OS messages the Shell whenever a window is created/destroyed so that taskbar can update its buttons.
For windows which do not have a taskbar button, the messages will not be sent, which makes sense.
With SHELLHOOK method, we merely intercept the messages without much load on the system resources.
| TLM wrote: | | There must be a way to hook all window and even control handles! |
Try WinEventHook Messages by Serenity
Last edited by SKAN on Sat May 01, 2010 3:08 am; edited 2 times in total |
|
| Back to top |
|
 |
TLM
Joined: 21 Aug 2006 Posts: 2926 Location: The Shell
|
Posted: Thu Apr 29, 2010 4:46 pm Post subject: |
|
|
| SKAN wrote: | | For windows which do not have a taskbar button, the messages will not be sent, which makes sense. | Explained that way, it absolutly does make sense!
thnx for the WinEventHook link  _________________
paradigm.shift:=(•_•)┌П┐RTFM||^.*∞ |
|
| Back to top |
|
 |
jaco0646
Joined: 07 Oct 2006 Posts: 3113 Location: MN, USA
|
Posted: Wed May 19, 2010 9:15 pm Post subject: |
|
|
| SKAN wrote: | How to Disable ( Grey-out ) the Close Button?
...
Feedback please! | I'd like to use this tip to stop myself from accidentally closing the Task Manager. I like to keep it running in the tray for the real-time CPU usage graph. This works: | Code: | Run, taskmgr.exe,,,PID
WinWait, ahk_pid %PID%
DisableCloseButton(WinExist())
WinMinimize
DisableCloseButton(hWnd) {
hSysMenu:=DllCall("GetSystemMenu","Int",hWnd,"Int",FALSE)
nCnt:=DllCall("GetMenuItemCount","Int",hSysMenu)
DllCall("RemoveMenu","Int",hSysMenu,"UInt",nCnt-1,"Uint","0x400")
DllCall("RemoveMenu","Int",hSysMenu,"UInt",nCnt-2,"Uint","0x400")
DllCall("DrawMenuBar","Int",hWnd)
} | ...however, I'd like to not have to flash the window open just to get its handle. Any thoughts? |
|
| Back to top |
|
 |
|