AutoHotkey Community

It is currently May 26th, 2012, 1:54 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 13 posts ] 
Author Message
 Post subject: Needed help
PostPosted: January 8th, 2009, 4:05 pm 
Hi Guyz
i created a Dummy gui for a very complex Security information event managment system.

basically , the system has rules / etc which are triggerd on certain events , in order to let pepole know about the events it emails but also - user intervention is needed in order to create a CASE / Ticket in a ticketing system.

after a case is created it will be handled by the rightful owners

so i basically created mouse / click / keyboard events and recorded it , and on certain resolution and certain settings - the program works great.

However

i was asked to do the following - which i dont know
make the GUI window - always on top
and "hide" the window tasks (Close/Minimize/Maximize) , so the only way to close the program will be right click on the program and choose close

here is the code - will anyone help me to do so ?
thanks


Code:
WinSet,AlwaysOnTop,Toggle
Gui, Add, Button, x6 y17 w80 h30, פתח קריאה
Gui, Add, Button, x96 y17 w80 h30 , סגור קריאה
Gui, Add, Button, x186 y17 w80 h30 , KB
Gui, Add, Button, x86 y67 w100 h30 , פתח מערכת
Gui, Show, x293 y293 h103 w295, SimSoc - CA Service Desk -  08'
Return

Buttonפתחקריאה:
WinWait, SimSoc Console 4.0.1.5579.3 [testsystem:testuser.ast] Production license`, issued to Test System`, expires Jan 01`, 2010.,
IfWinNotActive, SimSoc Console 4.0.1.5579.3 [testsystem:testuser.ast] Production license`, issued to Test System`, expires Jan 01`, 2010., , WinActivate, SimSoc Console 4.0.1.5579.3 [testsystem:testuser.ast] Production license`, issued to Test System`, expires Jan 01`, 2010.,
WinWaitActive, SimSoc Console 4.0.1.5579.3 [testsystem:testuser.ast] Production license`, issued to Test System`, expires Jan 01`, 2010.,
Send, {CTRLDOWN}2{CTRLUP}
; MouseClick, left,  496,  67
Sleep, 800
MouseClick, left,  400,  602
Sleep, 800
MouseClick, right,  400,  602
Sleep, 800
MouseClick, left,  445,  659
Sleep, 800
MouseClick, right,  186,  168
Sleep, 800
MouseClick, left,  292,  357
Sleep, 800
MouseClick, left,  55,  138
Sleep, 800
MouseClick, left,  596,  201
Sleep, 800
Send, {CTRLDOWN}v{CTRLUP}
MouseClick, left,  78,  116
Sleep, 800
MouseClick, left,  213,  454
Sleep, 800
MouseClick, right,  213,  454
Sleep, 800
MouseClick, left,  198,  452
Sleep, 800
MouseClick, right,  198,  452
Sleep, 800
MouseClick, left,  245,  517
Sleep, 800
MouseClick, left,  157,  114
Sleep, 800
MouseClick, left,  928,  205
Sleep, 800
Send, {END}{END}{SPACE}{CTRLDOWN}v{CTRLUP}{ENTER}
MouseClick, left,  960,  790
Sleep, 800
MouseClick, left,  488,  72
Sleep, 800
;MouseClick, left,  510,  63
Send, {CTRLDOWN}2{CTRLUP}
Sleep, 800
Send, {CTRLDOWN}3{CTRLUP}
Return
ExitApp

Buttonפתחמערכת:
Run,c:\SimSoc\Console4Sp1\Current\bin\SimSoc.bat Console
WinWait, SimSoc Console 4.0.1.5579.3
IfWinNotActive, SimSoc Console 4.0.1.5579.3,WinActivate, SimSoc Console 4.0.1.5579.3 ,
WinWaitActive, SimSoc Console 4.0.1.5579.3 ,
Sleep 500
SendInput testuser
Sleep 500
SendInput {TAB}
Sleep 500
SendInput deskhelp
Sleep 500
SendInput {ENTER}
Return
ExitApp

ButtonKB:
WinWait, SimSoc Console 4.0.1.5579.3 [testsystem:testuser.ast] Production license`, issued to Test System`, expires Jan 01`, 2010.,
IfWinNotActive, SimSoc Console 4.0.1.5579.3 [testsystem:testuser.ast] Production license`, issued to Test System`, expires Jan 01`, 2010., , WinActivate, SimSoc Console 4.0.1.5579.3 [testsystem:testuser.ast] Production license`, issued to Test System`, expires Jan 01`, 2010.,
WinWaitActive, SimSoc Console 4.0.1.5579.3 [testsystem:testuser.ast] Production license`, issued to Test System`, expires Jan 01`, 2010.,
MouseClick, left,  279,  62
Sleep, 100
Return
ExitApp


Buttonסגורקריאה:
Send, {CTRLDOWN}t{CTRLUP}
WinWait, SimSoc Console 4.0.1.5579.3 [testsystem:testuser.ast] Production license`, issued to Test System`, expires Jan 01`, 2010.,
IfWinNotActive, SimSoc Console 4.0.1.5579.3 [testsystem:testuser.ast] Production license`, issued to Test System`, expires Jan 01`, 2010., , WinActivate, SimSoc Console 4.0.1.5579.3 [testsystem:testuser.ast] Production license`, issued to Test System`, expires Jan 01`, 2010.,
WinWaitActive, SimSoc Console 4.0.1.5579.3 [testsystem:testuser.ast] Production license`, issued to Test System`, expires Jan 01`, 2010.,
;MouseClick, left,  518,  479
;Sleep, 300
Send, {CTRLDOWN}t{CTRLUP}
WinWait, Annotate Events,
IfWinNotActive, Annotate Events, , WinActivate, Annotate Events,
WinWaitActive, Annotate Events,
MouseClick, left,  227,  62
Sleep, 300
Send, {CTRLDOWN}c{CTRLUP}
MouseClick, left,  235,  190
Sleep, 300
MouseClick, left,  273,  528
Sleep, 300
Return
ExitApp


GuiClose:
ExitApp
[quote][/quote]


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: January 8th, 2009, 5:31 pm 
you can make a gui be always-on-top by specifying

Code:
gui, +alwaysontop
Gui, Show, put-your-code-here



If you want a gui that can be closed only by 1) terminating the script, or 2) clicking the x in the top-right of the window, and which does not have buttons for minimize/maximize/restore, nor does it show up on taskbar or allow resizing:

Code:
gui, +alwaysontop +toolwindow -resize
Gui, Show, put-your-code-here


I'm not sure how to remove the "x" in the top right of the window.

More info at "GUI" in the help manual's list of commands.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: January 8th, 2009, 9:52 pm 
hey , thanks for the help
ive just started using AHK and i really love it ;)

i just dont want the gui to be closed
as the NOC/SOC will be operated by computer dummies (their only there to see if an alert pops of the screen and use the macro)

and if it will be closed , im not sure they'll be able to open it
(lolmonkeys)


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: January 8th, 2009, 10:04 pm 
Offline

Joined: May 4th, 2008, 3:21 am
Posts: 168
Hmm, let me get this right..you want to make the gui NOT close when you hit the X at the top right? well...If that is what you want to do, you could specify somthing else for the GUI to do when the X it pressed ..somthing like this ( Im not exactly sure what you want , because i have a concussion o.o)
Code:





gui,add,edit, W500 H500,Hello
gui, -resize
gui,show
return

guiclose:
guiexit:
return ; putting "Sleep, 1" would also me effective i would assume



Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 9th, 2009, 11:18 am 
yes, that is true
i dont want them to be able to close the gui window
;)

thanks ill try the modifications


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: January 9th, 2009, 11:43 am 
Offline

Joined: October 9th, 2008, 6:04 am
Posts: 180
Location: Finland
use also #NoTrayIcon so people cant quit it from there.

They also could quit it from Task Manager.
This could help if u can fit it somewhere:

Code:
IfWinActive, Windows Task Manager
     WinClose, Windows Task Manager


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 9th, 2009, 4:09 pm 
Offline

Joined: July 21st, 2008, 4:16 pm
Posts: 726
Location: Calgary, AB, Canada
Name your script something that sounds important and compile it. It will show up in TaskManager under that name. Try something like "WinlogonControl.exe"... I doubt anyone would close that without knowing what it is.
Code:
#NoTrayIcon
Gui, -Caption +ToolWindow +AlwaysOnTop
Gui, Show ; Make some Coords, or it will be stuck directly in the middle of the screen.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 9th, 2009, 4:43 pm 
is there a way for AHK to detect certain text or buttons ?
(not processes)


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: January 9th, 2009, 5:01 pm 
Tseik wrote:
use also #NoTrayIcon so people cant quit it from there.

They also could quit it from Task Manager.
This could help if u can fit it somewhere:

Code:
IfWinActive, Windows Task Manager
     WinClose, Windows Task Manager


i loled ;)
their not that sophisticated
thank you though


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: January 9th, 2009, 5:32 pm 
Offline

Joined: July 21st, 2008, 4:16 pm
Posts: 726
Location: Calgary, AB, Canada
Question seems a little odd for this topic, but yes. It's the "WinText" parameter close to the "WinTitle" parameter on each command. Use "WinGetText" to retrieve the actual text.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 9th, 2009, 5:49 pm 
Offline

Joined: October 9th, 2008, 6:04 am
Posts: 180
Location: Finland
its hard to remember sometimes that other people are just normal mortals. :P


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 10th, 2009, 10:05 pm 
got it
yea i started doing this thread as a "guest" and didnt see the Subject well , guess i misfilled it and theres no way i can edit it ;)


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: January 11th, 2009, 4:19 pm 
is there a way to add a progress bar as far as the script progresses ? (the first one takes around 30 seconds to complete)

could be nice ^^


Report this post
Top
  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 13 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: BrandonHotkey, Exabot [Bot], patgenn123, poserpro and 13 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