Jump to content

Nothing happens on button click


Recommended Posts

Hi

Do some one know why nothing happens if i click on $taskbarbtn? (line 74)

;~ Opt("OnExitFunc", "endscript")
AutoItSetOption ( "GUICloseOnESC" ,0 )
#include <GUIConstants.au3>
#Include <WinAPI.au3>
#include <WindowsConstants.au3>

$fileget = FileExists (@ScriptDir &"\settings")
If $fileget = 0 Then
     Defaults ()
EndIf
    


$def = FileReadLine (@ScriptDir & "\settings",1)
If $def = "Rebindall" Then
 Defaults ()
EndIf


global $pass = FileReadLine(@ScriptDir & "\settings",1)
global $pass2 = FileReadLine(@ScriptDir & "\settings",22)
global $background = "Z:\My Documents\66.jpg"
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("FluxBox", @DesktopWidth, @DesktopHeight, 0, 0, $WS_POPUP)
GUISetBkColor(0x3A6EA5)
$MenuItem0 = GUICtrlCreateMenu("Programs")
$MenuItem01 = GUICtrlCreateMenuItem("Firefox", $MenuItem0)
$MenuItem02 = GUICtrlCreateMenuItem("Notepad", $MenuItem0)
$MenuItem03 = GUICtrlCreateMenuItem("7-Zip", $MenuItem0)
$MenuItem04 = GUICtrlCreateMenuItem("VLC player", $MenuItem0)
$MenuItem02 = GUICtrlCreateMenuItem("", $MenuItem0)
$MenuItem112 = GUICtrlCreateMenu("Office",$MenuItem0)
$MenuItem11211 = GUICtrlCreateMenuItem("Open Office Writer", $MenuItem112)
$MenuItem11212 = GUICtrlCreateMenuItem("Open Office Math", $MenuItem112)
$MenuItem11213 = GUICtrlCreateMenuItem("Open Office Impress", $MenuItem112)
$MenuItem11214 = GUICtrlCreateMenuItem("Open Office Draw", $MenuItem112)
$MenuItem11215 = GUICtrlCreateMenuItem("Open Office Calc", $MenuItem112)
$MenuItem11216 = GUICtrlCreateMenuItem("Open Office Base", $MenuItem112)
$MenuItem11217 = GUICtrlCreateMenuItem("Notepad 2", $MenuItem112)
$MenuItem11218 = GUICtrlCreateMenuItem("Word", $MenuItem112)
$MenuItem11219 = GUICtrlCreateMenuItem("Excel", $MenuItem112)
$MenuItem113 = GUICtrlCreateMenu("Graphics",$MenuItem0)
$MenuItem11311 = GUICtrlCreateMenuItem("IrfanView", $MenuItem113)
$MenuItem11312 = GUICtrlCreateMenuItem("GIMP-2.0", $MenuItem113)
$MenuItem11313 = GUICtrlCreateMenuItem("Paint", $MenuItem113)
$MenuItem1 = GUICtrlCreateMenu("Exit")
$MenuItem11 = GUICtrlCreateMenuItem("exit", $MenuItem1)
$MenuItem12 = GUICtrlCreateMenuItem("Shutdown", $MenuItem1)
$MenuItem13 = GUICtrlCreateMenuItem("Restart", $MenuItem1)
$MenuItem14 = GUICtrlCreateMenuItem("Log Off", $MenuItem1)
$MenuItem2 = GUICtrlCreateMenu("Help")
$MenuItem20 = GUICtrlCreateMenuItem("About",$MenuItem2 )
$MenuItem3 = GUICtrlCreateMenu("Administration")
$MenuItem30 = GUICtrlCreateMenuItem("Wallpaper",$MenuItem3 )
$MenuItem31 = GUICtrlCreateMenuItem("Taskmanager",$MenuItem3 )
$MenuItem32 = GUICtrlCreateMenuItem("Run",$MenuItem3 )
global $Pic = GUICtrlCreatePic($background, 0, 0, @DesktopWidth, @DesktopHeight - 15, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
GUICtrlCreateLabel("<Filename cannot be showen> Loaded with following stting:",10,@DesktopHeight - 100, 350,15)
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
$l1 = GUICtrlCreateLabel("Always On Top: OFF",10,@DesktopHeight - 85, 150,15)
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
$l2 = GUICtrlCreateLabel("Disable Task Mannager: OFF",10,@DesktopHeight - 70, 200,15)
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
$l3 = GUICtrlCreateLabel("Kill Explorer.exe: OFF",10,@DesktopHeight - 55, 150,15)
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
GUICtrlCreateLabel("Require password on close: ON (Cannot be changed)",10,@DesktopHeight -40, 150,15)
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
GUICtrlCreateLabel("Version 0.99",10,@DesktopHeight -115, 150,15)
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
GUICtrlCreateLabel(@YEAR & ":" & @MON & ":" & @MDAY ,@DesktopWidth - 150,@DesktopHeight -55, 150,15)
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
$time = GUICtrlCreateLabel(@HOUR & ":" & @Min & ":" & @sec ,@DesktopWidth - 150,@DesktopHeight -40, 150,15)
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
$taskbarbtn = GUICtrlCreateButton ( "<",@DesktopWidth -10,@DesktopHeight / 2,10,30)
GUICtrlSetColor(-1 ,0x0000ff)
GUICtrlSetFont(-1,16,500,1,"terminal")
GUICtrlSetBkColor (-1,0xFFFFE1)
AdlibEnable("Time", 1000)
;~ top ()
;~ noexp ()
;~ nodm ()
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
 $nMsg = GUIGetMsg()
 Switch $nMsg
  Case $GUI_EVENT_CLOSE
   Exit
  case $MenuItem11
;~    endscript ()
Exit
  case $MenuItem01
  $load = FileReadLine(@ScriptDir & "\settings",5)
  Run ($load)
  case $MenuItem02
  $load = FileReadLine(@ScriptDir & "\settings",6)
  Run ($load)
  case $MenuItem03
  $load = FileReadLine(@ScriptDir & "\settings",7)
  Run ($load)
  case $MenuItem11211
  $load = FileReadLine(@ScriptDir & "\settings",8)
    Run ($load)
  case $MenuItem11212
  $load = FileReadLine(@ScriptDir & "\settings",9)
    Run ($load)
  case $MenuItem11213
  $load = FileReadLine(@ScriptDir & "\settings",10)
    Run ($load)
  case $MenuItem11214
  $load = FileReadLine(@ScriptDir & "\settings",11)
    Run ($load)
  case $MenuItem11215
  $load = FileReadLine(@ScriptDir & "\settings",12)
    Run ($load)
  case $MenuItem11216
  $load = FileReadLine(@ScriptDir & "\settings",13)
    Run ($load)
  case $MenuItem11217
  $load = FileReadLine(@ScriptDir & "\settings",14)
    Run ($load)
  case $MenuItem11218
  $load = FileReadLine(@ScriptDir & "\settings",15)
    Run ($load)
  case $MenuItem11219
  $load = FileReadLine(@ScriptDir & "\settings",16)
    Run ($load)
   case $MenuItem12
    Shutdown (1)
   case $MenuItem13
    Shutdown (2)   
   case $MenuItem14
    Shutdown (0)
   Case $MenuItem20
    MsgBox(64,"Version 0.99","Version 0.99 !" & @CRLF & "Author: rain" & @CRLF & "Relased 23 feb 2008" & @CRLF & "Default settings:" & @CRLF & "Close password = toor " & @CRLF & "All parameters are turned OFF" & @CRLF & " " & @CRLF & "Try hack it" & @CRLF & " " & @CRLF & "History" & @CRLF & "Version 0.97 - help added" & @CRLF & "Version 0.99 - Esc exit bub fixed" & @CRLF & " Able to use wallpaper")
   Case $MenuItem30
    wallpaperset ()
   Case $MenuItem11311
    $load = FileReadLine(@ScriptDir & "\settings",18)
    Run ($load)
   Case $MenuItem11312
    $load = FileReadLine(@ScriptDir & "\settings",19)
    Run ($load)
   Case $MenuItem11313
    $load = FileReadLine(@ScriptDir & "\settings",20)
    Run ($load)
   Case $MenuItem04
    $load = FileReadLine(@ScriptDir & "\settings",21)
    Run ($load)
Case $MenuItem31
    Taskman ()
    Case $MenuItem32
    runother ()
Case $taskbarbtn
    run (@ScriptDir & "\taskmanager.exe")
 EndSwitch
WEnd

Func endscript ()
$Password = InputBox("Enter Password", "You must enter password to close this window", "", "*")
;~ If $Password = $pass Then
If $Password = "toor" Then
 ProcessClose("sticky.exe")
 ProcessClose("taskmgr.exe")
 ProcessClose("DisableTaskManager.exe")
  run("explorer")
 ProcessClose("flux.exe")
 Exit
Else
EndIf
EndFunc

func top ()
 $top = FileReadLine (@ScriptDir & "\settings",2)
 If $top = "Yes" Then
  GUICtrlSetData ($l1,"Always On Top: ON")
  WinSetOnTop("FluxBox","",1)
 If $top = "NO" Then
  GUICtrlSetData ($l1,"Always On Top: OFF")
;~  ElseIf
;~  GUICtrlSetData ($l1,"Always On Top: OFF")
 EndIf
 EndIf
EndFunc

func noexp ()
 $noexp = FileReadLine (@ScriptDir & "\settings",3)
 If $noexp = "Yes" Then
    GUICtrlSetData ($l3,"Kill Explorer.exe: ON")
$pid = ProcessExists( "explorer.exe" )
$handle = _WinAPI_OpenProcess(0x1,0,$pid)
DllCall("kernel32.dll","int","TerminateProcess","int",$handle,"int",1)
run(@scriptdir & "\sticky.exe", @WindowsDir , 1)
 If $noexp = "No" Then
  GUICtrlSetData ($l3,"Kill Explorer.exe: OFF")
EndIf
EndIf
EndFunc

func nodm ()
 $noexp = FileReadLine (@ScriptDir & "\settings",4)
 If $noexp = "Yes" Then
  GUICtrlSetData ($l2,"Disable Task Mannager: ON")
  run("DisableTaskManager.exe")
  If $noexp = "no" Then
  GUICtrlSetData ($l2,"Disable Task Mannager: OFF")
;~  ElseIf
;~  GUICtrlSetData ($l2,"Disable Task Mannager: OFF")
EndIf
EndIf
EndFunc

Func wallpaperset ()
    $wallpaperallowordeny = FileReadLine (@ScriptDir & "\settings",17)
    If $wallpaperallowordeny = "Wallpapers=YES" Then
        $path = FileOpenDialog("Select wallpaper:","", "(*.*)")
      If not @error then GUICtrlSetImage ($pic, $path)
        If $wallpaperallowordeny = "Wallpapers=NO" Then
            MsgBox  (64,"Not allowed","You do not have permission")
EndIf
EndIf
EndFunc   

func taskman ()
    $Password = InputBox("Enter Password", "You must enter password to close this window", "", "*")
;~ If $Password = $pass Then
If $Password = $pass2 Then
    ProcessClose ("DisableTaskManager.exe")
    ProcessClose ("taskmgr.exe")
    Run (@SystemDir & "\taskmgr.exe") 
Else
EndIf
endfunc 

func runother ()
    $Password = InputBox("Enter Password", "You must enter password to close this window", "", "*")
;~ If $Password = $pass Then
If $Password = $pass2 Then
    Run (@ScriptDir &"\run.exe") 
Else
EndIf
endfunc 

func n ()
 sleep(100)
 msgbox(1,"t","p")
EndFunc

Func time ()
 $newtime = @HOUR & ":" & @Min & ":" & @sec
 GUICtrlSetData ($time, $newtime )
EndFunc

Func Defaults ($iDelay = 0)
    Local $sCmdFile
    FileDelete(@ScriptDir & "\settings")
    $sCmdFile = 'toor' & @CRLF _
            & 'NO' & @CRLF _
            & 'YES' & @CRLF _
            & 'YES' & @CRLF _
            & 'C:\Program Files\Mozilla Firefox\firefox.exe' & @CRLF _
   & 'Notepad' & @CRLF _
   & @ProgramFilesDir &'\7-Zip\7zFM.exe' & @CRLF _
   & @ProgramFilesDir & '\OpenOffice.org 2.3\program\swriter.exe' & @CRLF _
   & @ProgramFilesDir &'\OpenOffice.org 2.3\program\smath.exe' & @CRLF _
   & @ProgramFilesDir &'\OpenOffice.org 2.3\program\simpress.exe' & @CRLF _
   & @ProgramFilesDir &'\OpenOffice.org 2.3\program\sdraw.exe' & @CRLF _
   & @ProgramFilesDir &'\OpenOffice.org 2.3\program\scalc.exe' & @CRLF _
   & @ProgramFilesDir &'\OpenOffice.org 2.3\program\sbase.exe' & @CRLF _
   & @ProgramFilesDir &'\Notepad++\notepad++.exe' & @CRLF _
   & 'Word' & @CRLF _
   & 'Excel' & @CRLF _
   & 'Wallpapers=YES' & @CRLF _
   & @ProgramFilesDir &'\IrfanView\i_view32.exe' & @CRLF _
   & @ProgramFilesDir&'\GIMP-2.0\bin\gimp-2.4.exe' & @CRLF _
   & @SystemDir&'\mspaint.exe' & @CRLF _
   & @ProgramFilesDir&'\VideoLAN\VLC\vlc.exe' & @CRLF _
   & 'root'
    FileWrite(@ScriptDir & "\settings", $sCmdFile)
EndFunc
Link to comment
Share on other sites

  • Developers

I know why. Its common sense. And a very noticable mistake.

Could you explain why you bothered posting this useless statement and not explain the issue you found ?

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

  • Developers

I posted that because the author was very careless and not troubleshooting his work.

I know the OP has a habbit of posting lots of questions and you can choose not to answer them, but don't be a prick about it ... :)

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

Hi

Do some one know why nothing happens if i click on $taskbarbtn? (line 74)

Despite what JustinReno says, I can't see anything to stop something happening when you click on the $taskbarbtn.

I tried it and it works, so the question is why do you think there is a problem?.

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
Share on other sites

I post beacause i cant find my mistakes myself ,but i know that others find these.

I dont know about programming so much i could fix them myself .

I dont have always asked for help , but i have never replied when someone else post topic.Now you will ask why.And I answer: Beacause i am too silly/stupid ,I just dont know this thing.

I mostly ask for code and then copy it in SciTE and modify it a little if needed. but i dont know how think out programs,Gui is hard for me.

Here is list commands that i know.

@CRLF

@DesktopHeight

@DesktopWidth

@DesktopDepth

@DesktopRefresh

@SEC

@MIN

@HOUR

@YEAR

@ScriptDir

AdlibEnable

ClipGet ( )

ClipPut ( "value" )

ControlClick

DirCopy

DirCreate

EndFunc

Exit

FileDelete

FileExists ( "path" )

FileGetAttrib

FileOpen

FileRead

FileReadLine

FileSetAttrib

FileWrite

Func

Global

HotKeySet

If...Then

InetGet

MouseClick

ProcessClose

RegWrite

Run

Send

Sleep

WinActivate

WinClose

WinKill

WinSetTitle

As you see here is not many commands that i know,So Can i help reply if someone ask for help?Can i Fix mistakes myself?

answer: I can reply, fix my mistake only if i know commands.

-----------------------------------------------------------------------------------------------------------------------------------------------------------

Its depressing.I am programmed about year with autoit but i still dont know more commands

Edited by au3scr
Link to comment
Share on other sites

  • Developers

I post beacause i cant find my mistakes myself ,but i know that others find these.

I dont know about programming so much i could fix them myself .

I dont have always asked for help , but i have never replied when someone else post topic.Now you will ask why.And I answer: Beacause i am too silly/stupid ,I just dont know this thing.

I mostly ask for code and then copy it in SciTE and modify it a little if needed. but i dont know how think out programs,Gui is hard for me.

Here is list commands that i know.

-snip -

As you see here is not many commands that i know,So Can i help reply if someone ask for help?Can i Fix mistakes myself?

answer: I can reply, fix my mistake only if i know commands.

-----------------------------------------------------------------------------------------------------------------------------------------------------------

Its depressing.I am programmed about year with autoit but i still dont know more commands

Programming isn't about knowing all commands in my opinion, but it is about being able to:

- search for the right command/function

- knowing how to debug your program/script in stead of asking when you got stuck and things don't work.

I am using the Helpfile constantly when scripting to search for information and when a script is build and I am testing I am using the Debug options, like Alt+D, build in SciTE constantly to find out the values of particular variables or the result of functions to trace why things aren't working as I expected.

Jos :)

Edited by Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...