AutoHotkey Community

It is currently May 26th, 2012, 5:45 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 139 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6, 7, 8 ... 10  Next
Author Message
 Post subject:
PostPosted: July 16th, 2008, 8:43 am 
Offline

Joined: February 12th, 2007, 7:54 am
Posts: 2462
Sean wrote:
Code:
NumGet(btn,12)
If it's zero, then can assume the OS is 64bit, otherwise 32bit.

I uploaded new one in the same link, combining both 32bit and 64bit into the single TrayIcons() on the basis that the above hypothesis is true. I don't really know if they're really padded with zero in 64bit Windows, however, judging from the result ACoder posted earlier it's likely. Anyway, it won't affect anything in 32bit Windows.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 16th, 2008, 4:11 pm 
Hey, I have a angle for you I will test... why don't you show me mods for abnormally expanding padding, to assume a 9216 bit OS (64 x 144). That is rad., but would prove if my 64 bit XP & Vista accepts it, then no future issue :D .... !


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: July 16th, 2008, 4:12 pm 
I was going to say, just for good countermesaure, maybe illustrate a 128bit and 256bit (normal), or even 512bit and maybe that hyper model :)


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: July 27th, 2008, 4:04 am 
Sean, was my large bit request to test too out of the ordinary? :cool:


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: July 27th, 2008, 4:38 am 
Offline

Joined: February 12th, 2007, 7:54 am
Posts: 2462
ACoder-not logged in wrote:
Sean, was my large bit request to test too out of the ordinary? :cool:

So, the script actually worked in 64bit Windows? Great, that's all I needed to know.

PS. If you get 128bit etc systems, come again. I'll tell you how then.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 25th, 2009, 8:20 pm 
Hey I was just wondering if anyone can help me and explain how to move systray icons with this script.

Any help would be much appreciated.


Report this post
Top
  
Reply with quote  
PostPosted: June 4th, 2009, 4:31 pm 
Offline

Joined: June 2nd, 2009, 6:05 pm
Posts: 2
I want to read out the "Status" of a certain TrayIcon (for instance for avgtn.exe - AntivirGuard). So I filled in the Script of Sean:
TrayIcons(sExeName = "avgnt.exe") as recommended.

Also Ilooked for the nfo's in which there are changes when Changing the try-Icon by clicking with the mouse. ( "inaktiv" and "aktiv")...

My questions are:

Is it neccessary to get all of the tray icons with the function"GetTrayBar(0)" or is there a possibility to reduce the script?

Are all of the dllCalls necessary or can I kick out some of them? Or: What do the different dll-Calls do?

Is the loop still neccessary, when only one exe-file is the aked one?

I've experimented with the script and found out, that only a few volumes are changing when I change the status of the relevant Icon (by Right Mousclick...)

Here is my Reduced code of your TrayIcon.ahk (within the demand if you could reduce it a little bit more..):

---------------------------------------------------------------------
MsgBox % TrayIcons()
Return


TrayIcons(sExeName = "avgnt.exe")
{
WinGet, pidTaskbar, PID, ahk_class Shell_TrayWnd
hProc:= DllCall("OpenProcess", "Uint", 0x38, "int", 0, "Uint", pidTaskbar)
pProc:= DllCall("VirtualAllocEx", "Uint", hProc, "Uint", 0, "Uint", 32, "Uint", 0x1000, "Uint", 0x4)
idxTB:= GetTrayBar()
SendMessage, 0x418, 0, 0, ToolbarWindow32%idxTB%, ahk_class Shell_TrayWnd ; TB_BUTTONCOUNT
Loop, %ErrorLevel%
{
SendMessage, 0x417, A_Index-1, pProc, ToolbarWindow32%idxTB%, ahk_class Shell_TrayWnd ; TB_GETBUTTON
VarSetCapacity(btn,32,0), VarSetCapacity(nfo,32,0)
DllCall("ReadProcessMemory", "Uint", hProc, "Uint", pProc, "Uint", &btn, "Uint", 32, "Uint", 0)
idn := NumGet(btn, 4)
If dwData := NumGet(btn,12)
iString := NumGet(btn,16)
Else dwData := NumGet(btn,16,"int64"), iString:=NumGet(btn,24,"int64")
DllCall("ReadProcessMemory", "Uint", hProc, "Uint", dwData, "Uint", &nfo, "Uint", 32, "Uint", 0)
If NumGet(btn,12)
hWnd := NumGet(nfo, 0)
, Var1 := NumGet(nfo,21)
, Var2 := NumGet(nfo,22)
, hIcon := NumGet(nfo,20)
Else hWnd := NumGet(nfo, 0,"int64"), uID:=NumGet(nfo, Cool, nMsg:=NumGet(nfo,12)
WinGet, pid, PID, ahk_id %hWnd%
WinGet, sProcess, ProcessName, ahk_id %hWnd%

If !sExeName || (sExeName = sProcess) || (sExeName = pid)
VarSetCapacity(sTooltip,128), VarSetCapacity(wTooltip,128*2)
, DllCall("ReadProcessMemory", "Uint", hProc, "Uint", iString, "Uint", &wTooltip, "Uint", 128*2, "Uint", 0)
, DllCall("WideCharToMultiByte", "Uint", 0, "Uint", 0, "str", wTooltip, "int", -1, "str", sTooltip, "int", 128, "Uint", 0, "Uint", 0)
, sTrayIcons .= "hIcon: " . hIcon . " | Var1: " . Var1 . " | Var2: " . Var2 . " | Process: " . sProcess . "`n" . " | Tooltip: " . sTooltip . "`n"
}

Return sTrayIcons
}


GetTrayBar()
{
ControlGet, hParent, hWnd,, TrayNotifyWnd1 , ahk_class Shell_TrayWnd
ControlGet, hChild , hWnd,, ToolbarWindow321, ahk_id %hParent%
Loop
{
ControlGet, hWnd, hWnd,, ToolbarWindow32%A_Index%, ahk_class Shell_TrayWnd
If Not hWnd
Break
Else If hWnd = %hChild%
{
idxTB := A_Index
Break
}
}
Return idxTB
}

__________________________________

thanks


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 5th, 2009, 3:39 am 
Offline

Joined: February 12th, 2007, 7:54 am
Posts: 2462
woschaible wrote:
Is the loop still neccessary, when only one exe-file is the aked one?
I'd like to ask why you bother about that. Anyway, all are necessary. One thing you may alter is that currently the loop isn't stopped when an instance is found. It's for multiple instances of the same app and/or an app with multiple trayicons. If your app is running with only single instance and single trayicon, you may break out the loop as soon as found.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 7th, 2009, 4:03 pm 
Offline

Joined: June 2nd, 2009, 6:05 pm
Posts: 2
Sean wrote:
woschaible wrote:
Is the loop still neccessary, when only one exe-file is the aked one?
I'd like to ask why you bother about that. Anyway, all are necessary. One thing you may alter is that currently the loop isn't stopped when an instance is found. It's for multiple instances of the same app and/or an app with multiple trayicons. If your app is running with only single instance and single trayicon, you may break out the loop as soon as found.


OK, thanks for your answer. I don't understand all of the file as I'm a beginner in programming with scripts which are getting information from dll's windows and so on. The hope was to reduce a little more and then I would understand a little more.... But you are right: I've founded a solution and its uneccessary to waste time.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 15th, 2009, 1:15 am 
Offline

Joined: March 26th, 2009, 4:41 am
Posts: 15
Hi, I'm a newbie trying to write a script that, at a certain point, will click on an icon in the notification tray of the taskbar.

Someone said I could use TrayIcon.ahk to do that but I'm lost.

When I run TrayIcon.ahk, I get a window that pops up that I think is telling me a bunch of information about the icons currently loaded in the tray.

My problem is, I have no idea how to use that info to put some command in my script that will click on the particular icon.

Any help is greatly appreciated. :-)


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 15th, 2009, 1:37 am 
Offline

Joined: March 26th, 2009, 4:41 am
Posts: 15
I think I figured it out. I didn't want to waste anybody's time. I will write back if I run into any problems. Thanks! :D


Report this post
Top
 Profile  
Reply with quote  
PostPosted: June 30th, 2009, 10:51 pm 
Offline

Joined: February 6th, 2007, 1:20 am
Posts: 12
Location: Zip: 80916
I have written a little extension to Windows Instant Messenger to record the conversation on window close (save to file). It's not well written, but it works. I would like to add menu items to the Windows IM tray icon menu rather than add a whole new tray icon. These menu items could possibly be a "suspend script" action, or close script, or "save conversation", etc.

Is it possible to manipulate the tray icon menus of external programs?

An extension to this question would be, is it possible to save the window data to a file in rich text format? I tried GetClipboardData with no luck.

Thanks in advance for any help . . .

-Mike

_________________
-MRW


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 30th, 2009, 11:51 pm 
Offline

Joined: February 12th, 2007, 7:54 am
Posts: 2462
wintersm wrote:
Is it possible to manipulate the tray icon menus of external programs?
Basically, no.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 30th, 2009, 11:59 pm 
Offline

Joined: February 6th, 2007, 1:20 am
Posts: 12
Location: Zip: 80916
Sean,

Can you elaborate on this? I have absolutely no idea how to write a dll.

How would the logic work? If I right click on the specific tray icon, show the following menu?

_________________
-MRW


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 1st, 2009, 12:33 am 
Offline

Joined: February 12th, 2007, 7:54 am
Posts: 2462
wintersm wrote:
Can you elaborate on this? I have absolutely no idea how to write a dll.
Well, I removed the line immediately, however, you seemed to read it. My comment was about the context menus which does not apply to tray menus. Anyway, there exist at least two possible ways to do it. Subclassing which doesn't necessarily require a dll, or Hooking which does require a dll. That's all I'd like to say.


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 139 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6, 7, 8 ... 10  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: Bing [Bot], XX0, Yahoo [Bot] and 12 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group