AutoHotkey Community

It is currently May 27th, 2012, 11:05 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 30 posts ]  Go to page Previous  1, 2
Author Message
 Post subject:
PostPosted: May 23rd, 2007, 12:00 pm 
Offline

Joined: April 25th, 2007, 10:13 pm
Posts: 29
I added Monitor Info (with support for more than one monitor)

Put the following after Cpu and Memory and Before Network Info.

Code:
   ; Monitor Info.
   Gui %SMGuiID%:Font
   Gui %SMGuiID%:Add, GroupBox, xm yp+16 Section w210 h70
   Gui %SMGuiID%:Font, s8 c%InfoColour%, Tahoma
   Gui %SMGuiID%:Add, Text, xs+10 ys+15 c%LabelColour% guiMove,Screen Size (Primary):
   Gui %SMGuiID%:Add, Text, x+2 w50, %A_ScreenWidth%x%A_ScreenHeight%
   SysGet, MonitorCount, MonitorCount
   SysGet, MonitorPrimary, MonitorPrimary
   Loop, %MonitorCount%
   {
      if MonitorPrimary<>%A_Index%
      {
          SysGet, MonitorName, MonitorName, %A_Index%
          SysGet, Monitor, Monitor, %A_Index%
          SysGet, MonitorWorkArea, MonitorWorkArea, %A_Index%
         MonitorW := MonitorWorkAreaRight - MonitorWorkAreaLeft
         MonitorH := MonitorWorkAreaBottom - MonitorWorkAreaTop
          ;MsgBox, Monitor:`t#%A_Index%`nName:`t%MonitorName%`nLeft:`t%MonitorLeft% (%MonitorWorkAreaLeft% work)`nTop:`t%MonitorTop% (%MonitorWorkAreaTop% work)`nRight:`t%MonitorRight% (%MonitorWorkAreaRight% work)`nBottom:`t%MonitorBottom% (%MonitorWorkAreaBottom% work)
         Gui %SMGuiID%:Add, Text, xs+10 yp+15 c%LabelColour% guiMove,Screen Size (%MonitorName%):
         Gui %SMGuiID%:Add, Text, x+2 w50, %MonitorW%x%MonitorH%
      }
   }


Cheers,
Mosaic


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 23rd, 2007, 4:36 pm 
Hi Rajat

I haven't any plans to update this script any time soon as it does pretty much everything that I want it to do as it is. As you noticed, I have updated it a few times since the version that you modifies and have used Skan's idea of using a tray icon to show the up/down network activity, also, I have set up the icon to un/pin the gui with one click which I would miss if I changed the script as per your request.

BTW: I found out that there is a bug in task manager. Its icon doesn't show if you use the "classic" theme in XP...which works to my advantage!

Quote:
Nice script. Is there any way to get the real ip address, instead, it's giving me: 192.168.0.1?
Thanks. The script uses "a_ipaddress1" to get the IP address, maybe changing the no. to another will work??
From the manual:
Quote:
A_IPAddress1 through 4 - The IP addresses of the first 4 network adapters in the computer.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: May 23rd, 2007, 5:08 pm 
Online
User avatar

Joined: December 26th, 2005, 4:40 pm
Posts: 8776
Quote:
A_IPAddress1 through 4 - The IP addresses of the first 4 network adapters in the computer.


I think mosaic is referring to an external IP address.
See: Global IP

:)


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 23rd, 2007, 10:48 pm 
Offline

Joined: May 24th, 2006, 2:49 pm
Posts: 4511
Location: Belgrade
Rajat wrote:
It'd be nice if you could use this format for your future updates to this script. i really like least no. of individual tasks running.

I agree. This is very nice screept and I would like to have it mergable with my main script.

_________________
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 24th, 2007, 5:55 pm 
Offline

Joined: March 28th, 2004, 3:53 pm
Posts: 1870
maj,
after modding it i've realised how easy it can be for users if the utility scripts are made from ground-up for instantly plugging into another script.
i'll keep this in mind while working on scripts in future.

as i see it, the things to keep in mind are:
- separation of autoexec and the rest of script
- least possible use of global vars
- global var names to be prefixed with something

any insights from you?

_________________
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 27th, 2008, 5:30 pm 
Offline

Joined: December 14th, 2005, 3:08 pm
Posts: 219
The trouble with this script is that it screws up if you've got more than 2 drives to monitor. The 3rd drive line writes over the bottom outer wrapping line.

Also some of us use ProcessExp instead of the Taskmanager.

Can some one say why it needs to use the taskmanager?

_________________
Stuart Halliday


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 30th, 2008, 5:01 pm 
Offline
User avatar

Joined: July 17th, 2008, 12:58 am
Posts: 270
Rajat wrote:
Image


i like your modification
but is it possible displaying the external ip instead?

_________________
QuickSubs | Popcorn Movie Db
All my scripts are just in AutoHotkey v1.0.48.05


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 31st, 2008, 2:56 am 
Offline
User avatar

Joined: December 21st, 2007, 3:14 pm
Posts: 3826
Location: Louisville KY USA
Code:
COM_Init()
pwb := COM_CreateObject("InternetExplorer.Application")
COM_Invoke(pwb , "Visible=", 0)
COM_Invoke(pwb, "Navigate", "http://whatismyip.com/")
loop
      If (rdy:=COM_Invoke(pwb,"readyState") = 4)
         break
innerHTML:=COM_Invoke(item37:=COM_Invoke(all:=COM_Invoke(document:=COM_Invoke(pwb,"Document"),"All"),"Item",37),"innerHTML")
;~ Visible text= Your IP Address Is 74.133.<SPAN>1</SPAN>6<SPAN>4</SPAN>.<SPAN>1</SPAN>8<SPAN>4</SPAN>
StringReplace,innerHTML,innerHTML,Your IP Address Is ,,all
StringReplace,innerHTML,innerHTML,<SPAN>,,all
StringReplace,innerHTML,innerHTML,</SPAN>,,all

COM_Invoke(pwb,"Quit")

COM_Term()

msgbox % innerHTML
ExitApp

your ip
Not that it does you any good at all
and i dont really have an interest in figureing out where to put this in the script but since it was asked for here it is
certainly there are better ways but this one only requires com and not com and the httpquery by DerRaphael

_________________
No matter what your oppinion Please join this discussion
Formal request to Polyethene
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 31st, 2008, 3:18 pm 
Offline

Joined: November 23rd, 2007, 10:23 am
Posts: 841
Location: ~/.
slightly shorter:
Code:
l := httpQuery(IP,"http://getip.110mb.com/mini/")
VarSetCapacity(IP,-1)
MsgBox My External IP is: %IP%
#include httpQuery.ahk
; get it from here: http://www.autohotkey.com/forum/viewtopic.php?t=33506


greets
dR

_________________
Image
    All scripts, unless otherwise noted, are hereby released under CC-BY


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 31st, 2008, 6:17 pm 
Offline
User avatar

Joined: July 17th, 2008, 12:58 am
Posts: 270
DerRaphael wrote:
slightly shorter:
Code:
l := httpQuery(IP,"http://getip.110mb.com/mini/")
VarSetCapacity(IP,-1)
MsgBox My External IP is: %IP%
#include httpQuery.ahk
; get it from here: http://www.autohotkey.com/forum/viewtopic.php?t=33506


greets
dR


nice :D
works very good.thank you

_________________
QuickSubs | Popcorn Movie Db
All my scripts are just in AutoHotkey v1.0.48.05


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 31st, 2008, 6:54 pm 
Offline
User avatar

Joined: December 21st, 2007, 3:14 pm
Posts: 3826
Location: Louisville KY USA
its probably faster also

_________________
No matter what your oppinion Please join this discussion
Formal request to Polyethene
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 1st, 2008, 2:37 pm 
Offline
User avatar

Joined: July 17th, 2008, 12:58 am
Posts: 270
i have made some small changes in Rajat's version to fit my liking and now for some reason i get this error :
Image

here is the whole thing if anyone wants to check it out and help me:
http://www.autohotkey.net/~Delusion/SysMon.rar

seems to happen since i added the part to check for external ip.if i remove those parts in the code it works normally again

_________________
QuickSubs | Popcorn Movie Db
All my scripts are just in AutoHotkey v1.0.48.05


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 1st, 2008, 2:45 pm 
put VarSetCapacity(IdleTicks, 8)
before line 084


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: September 1st, 2008, 2:53 pm 
Offline
User avatar

Joined: July 17th, 2008, 12:58 am
Posts: 270
Anonymous wrote:
put VarSetCapacity(IdleTicks, 8)
before line 084


great it works.thank you very much
but what was the problem causing the error? i dont get it

_________________
QuickSubs | Popcorn Movie Db
All my scripts are just in AutoHotkey v1.0.48.05


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 1st, 2008, 3:04 pm 
Delusion wrote:
but what was the problem causing the error? i dont get it


Code:
DllCall("kerner32.dll\GetSystemTimes", "uint",&IdleTicks, "uint",0, "uint",0)

This line pointed(&) to IdleTicks variable but there was no IdleTicks variable.
that's what debugger noticed. (This DllCall Requires a prior VarSetCapacity)

Code:
VarSetCapacity(IdleTicks, 8)

so we've prepared a variable for that DllCall. that's it.
probably you've been cut that line off by accident or something.


Report this post
Top
  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 30 posts ]  Go to page Previous  1, 2

All times are UTC [ DST ]


Who is online

Users browsing this forum: iDrug and 59 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