yousefsamy Posted June 27, 2014 Share Posted June 27, 2014 here is my code : expandcollapse popup#include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> FileInstall("mpos.ico",@TempDir & "\mpos.ico") Opt("TrayMenuMode", 1) Func _MouseGetPos() $aPos = MouseGetPos() MsgBox(0 ,"", $aPos[0] & ", " & $aPos[1]) EndFunc HotKeySet("p","_MouseGetPos") $Form1 = GUICreate("Mouse Position", 117, 47, 192, 124) GUISetBkColor(0x99B4D1) $Label1 = GUICtrlCreateLabel("Mpos", 40, 8, 50, 28) GUICtrlSetFont(-1, 14, 400, 0, "Neo Tech Alt Medium") TraySetIcon(@TempDir & "\mpos.ico",-1) TraySetClick("1") $Hello = TrayCreateMenu("Hello") $GetPosition = TrayCreateItem("GetPosition[Hot-Key={p}]", $Hello) $off = TrayCreateItem("turn off", $Hello) $Start = TrayCreateItem("Start-With-Win", $Hello) $About = TrayCreateItem("About", $Hello) $Exit = TrayCreateItem("Exit", $Hello) GUISetState(@SW_HIDE) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch Switch TrayGetMsg() Case $GetPosition _MouseGetPos() Case $Start FileCreateShortcut(@WorkingDir & "\mpos.exe",@StartupCommonDir & "\mpos.exe",@WorkingDir & "\mpos.exe","","",@TempDir & "\mpos.ico") Case $About MsgBox(0,"Welcome Dear","الحمد لله[Wise-Hacker]Coder") Case $Exit ExitLoop Case $off ;Here i want to disable the effect of tool but it's working GUISetState(@SW_DISABLE) EndSwitch WEnd Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted June 27, 2014 Moderators Share Posted June 27, 2014 yousefsamy,You never display the GUI (GUISetState(@SW_HIDE)) so how do you know if it disabled or not? If I change the code to show the GUI then it is indeed disabled when the menu item is selected. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
yousefsamy Posted June 27, 2014 Author Share Posted June 27, 2014 (edited) this tool has a hotkey [P] ,, i want to disable and enable this hotkey i think i can do that with @sw_disable do you understand what i want to do ? Edited June 27, 2014 by yousefsamy Link to comment Share on other sites More sharing options...
BrewManNH Posted June 27, 2014 Share Posted June 27, 2014 No, you can't enable and disable the hotkey that way. Read the help file about hotkeys. For once, you really need to start doing the reading because it's getting obvious that either reading or programming isn't something you should be doing. If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator Link to comment Share on other sites More sharing options...
yousefsamy Posted June 27, 2014 Author Share Posted June 27, 2014 hay bro i am 15 years old and i am Arabian one it's hard to me to read all that i want simple ideas i think u can understand that right ?? !!! Link to comment Share on other sites More sharing options...
Exit Posted June 27, 2014 Share Posted June 27, 2014 So just use a translator. e.g. Google: https://translate.google.com/translate?sl=en&tl=ar&js=y&prev=_t&ie=UTF-8&u=https%3A%2F%2Fwww.autoitscript.com%2Fautoit3%2Fdocs%2Ffunctions%2FHotKeySet.htm&edit-text= App: Au3toCmd UDF: _SingleScript() Link to comment Share on other sites More sharing options...
yousefsamy Posted June 27, 2014 Author Share Posted June 27, 2014 hhhhhhh it's very bad Link to comment Share on other sites More sharing options...
yousefsamy Posted June 27, 2014 Author Share Posted June 27, 2014 still dont know the answer Link to comment Share on other sites More sharing options...
BrewManNH Posted June 28, 2014 Share Posted June 28, 2014 Don't bump your posts in less than 24 hours, this isn't a 24/7 help desk, it's a group of people that know the language and like trying to help out. You get the help when someone with the knowledge or desire to help comes along, not on your time frame but on theirs. Be patient, you posted that exactly 1 hour after your last post. If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator Link to comment Share on other sites More sharing options...
yousefsamy Posted June 28, 2014 Author Share Posted June 28, 2014 i think you know the answer Link to comment Share on other sites More sharing options...
Moderators Solution Melba23 Posted June 28, 2014 Moderators Solution Share Posted June 28, 2014 yousefsamy, a hotkey [P] ,, i want to disable and enable this hotkeyFrom the Help file page for HotKey: function : The name of the function to call when the key is pressed. Not specifying this parameter will unset a previous hotkeySo to activate a HotKey you specify a function:HotKey("P", "_MouseGetPos")and to deactivate it you do not:HotKey("P")You can see it working here:#include <GUIConstantsEx.au3> #include <MsgBoxConstants.au3> HotKeySet("p", "_Test") $hGUI = GUICreate("Test", 500, 500) $cAct = GUICtrlCreateButton("Active", 10, 10, 80, 30) GUICtrlSetState($cAct, $GUI_DISABLE) $cDeAct = GUICtrlCreateButton("Deactivate", 10, 100, 80, 30) GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $cAct HotKeySet("p", "_Test") GUICtrlSetState($cAct, $GUI_DisABLE) GUICtrlSetState($cDeAct, $GUI_ENABLE) Case $cDeAct HotKeySet("p") GUICtrlSetState($cDeAct, $GUI_DISABLE) GUICtrlSetState($cAct, $GUI_ENABLE) EndSwitch WEnd Func _Test() MsgBox($MB_SYSTEMMODAL, "Hi", "Active & Pressed") EndFuncNote I am using the lowercase character "p" to define the HotKey as this is more reliable with some keyboards - as is explained in the Help file. We all appreciate that you are young and that English is not your first language - we are also very happy to help you learn how to code in AutoIt. But you need to do some work as well - particularly when it comes to reading the Help file. You believed that SW_DISABLE disabled HotKeys - but if you search for that in the Help file you see: @SW_DISABLE : Disables the windowNo mention of HotKey there. And I have already posted above the extract from the HotKey page which explains exactly how to set and unset a HotKey. So please make sure that you read the relevant pages of the Help file carefully. We are very proud of that Help file as it is possibly the most comprehensive example out there and some of community spend (have spent) a great deal of time getting it to that state. You are beginning to alienate several of the long-term members by seemingly not making much effort to get the basics correct. So calm down and start helping yourself by trying to find some of the answers in the Help file and not just rushing to post in the forum whenever you have the smallest question. As I said before, we all understand that you are young and not a native anglophone - but you need to show that you are willing to make some effort as well. حظا سعيدا والترميز جيدةM23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
yousefsamy Posted June 28, 2014 Author Share Posted June 28, 2014 Thnx حظا سعيدا والترميز جيدة this phrase from google i am sure ,, you have no grammar in Arabic Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted June 30, 2014 Moderators Share Posted June 30, 2014 You post on his grammar, did you bother to take to heart what he is trying to tell you? yousefsamy 1 "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
yousefsamy Posted June 30, 2014 Author Share Posted June 30, 2014 really i cant understand this word الترميز Link to comment Share on other sites More sharing options...
somdcomputerguy Posted June 30, 2014 Share Posted June 30, 2014 (edited) The English translation of that word is coding. That word, as used in that phrase, means to write code. Edited June 30, 2014 by somdcomputerguy yousefsamy 1 - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change. Link to comment Share on other sites More sharing options...
yousefsamy Posted June 30, 2014 Author Share Posted June 30, 2014 yea i understand it now coding in my language called البرمجة Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now