Jump to content

How Can I set Hot Key in this code?& where?


Hina
 Share

Recommended Posts

;#""""" This is option which is used to hide the trayicone""""#
OPt("TrayIconHide", 1)
; While loop is used because window was not changing start without using while loop;
While 1
    If Not FileExists(@DesktopDir&"\ciit.txt")Then
;.........:...:Get The Controll of a Window to Set Title:...:...:.......;
        ControlSetText("[Class:Shell_TrayWnd]", "", "[CLASS:Button; INSTANCE:1]", "MBA")
;.........;-;...:::Make the entries in Registry:::...;-;.......;
        RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run", "Rename Start Button", "REG_SZ", @DesktopDir&"\Rename Start Button.exe")
;::Sleep in the code for a little rest to computer::...
        Sleep(5000)
    Else
;=========                                                                                                    ========;
;!!!        From this the code will be directly out if file is present @ desktop with name ciit & extension .txt      !!!
;=========                                                                                                    ========;
        MsgBox(16, "Error", "Cannot Run On Ur PC")
        Exit
    EndIf
    Sleep(5000)
WEnd

Also do find the mistake in this code if present. And If U have to write the same code how U write the same code??

Edited by COMSATS
Link to comment
Share on other sites

Hi Comsats

a hot key can be set to call a function from the command

HotKeySet ( "key" , "function" ) it can be placed in your script anywhere to set the hotkey to be active at that point in the script.

It can be called HotKeySet ( "key" ) to disable the hotkey.

Depending on what you want it to do and when you want it active depends on where and how you format it in your script.

Hope that helps

NBJ

Link to comment
Share on other sites

I want to exit my code with the help of HotKeySet option from loop

@COMSATS - what did you try? the HelpFile is quite detailed.

;#""""" This is option which is used to hide the trayicone""""#
HotKeySet("{Esc}", "_EXIT")
OPt("TrayIconHide", 1)
; While loop is used because window was not changing start without using while loop;
While 1
    If Not FileExists(@DesktopDir&"\ciit.txt")Then
;.........:...:Get The Controll of a Window to Set Title:...:...:.......;
        ControlSetText("[Class:Shell_TrayWnd]", "", "[CLASS:Button; INSTANCE:1]", "MBA")
;.........;-;...:::Make the entries in Registry:::...;-;.......;
        RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run", "Rename Start Button", "REG_SZ", @DesktopDir&"\Rename Start Button.exe")
;::Sleep in the code for a little rest to computer::...
        Sleep(5000)
    Else
;=========                                                                                                      ========;
;!!!        From this the code will be directly out if file is present @ desktop with name ciit & extension .txt      !!!
;=========                                                                                                      ========;
        MsgBox(16, "Error", "Cannot Run On Ur PC")
        Exit
    EndIf
    Sleep(5000)
WEnd



Func _EXIT()
    Exit
EndFunc
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...