Leaderboard
Popular Content
Showing content with the highest reputation on 04/12/2017 in all areas
-
_IsPressed('20') dont work well (SPACEBAR)
232showtime reacted to Melba23 for a topic
Verssuss, Pressing the Spacebar actions the default control - this is a Windows default, nothing to do with AutoIt. I suggest creating a dummy control to which you can give focus so that the main button does not get actioned: #include <Misc.au3> #include <MsgBoxConstants.au3> #include <GUIConstantsEx.au3> $GUI = GUICreate("set hotkeys") GUISetState() $button_hotkey = (GUICtrlCreateButton("", 80, 30, 150, 25)) $cDummy = GUICtrlCreateButton("Dummy", 80, 100, 150, 25) ; Here is your dummy control <<<<<<<<<<<<< Local $hDLL = DllOpen("user32.dll") $start = False While 1 $Msg = GUIGetMsg() Switch $Msg Case $GUI_EVENT_CLOSE DllClose($hDLL) ; If you open it then you must close it <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< Exit Case $button_hotkey $start = True GUICtrlSetData($button_hotkey, "Press Hot Key") GUICtrlSetState($cDummy, $GUI_FOCUS) ; Give focus to the dummy <<<<<<<<<<<<<<<<<<<<<<<<< EndSwitch If $start = True And _IsPressed('20', $hDLL) Then $start = False $klawisz1 = "SPACEBAR" GUICtrlSetData($button_hotkey, $klawisz1) $start = False ;~ Beep(500) EndIf If $start = True And _IsPressed('31', $hDLL) Then $klawisz1 = "1" GUICtrlSetData($button_hotkey, $klawisz1) $start = False EndIf If $start = True And _IsPressed('41', $hDLL) Then $klawisz1 = "a" GUICtrlSetData($button_hotkey, $klawisz1) $start = False EndIf If $start = True And _IsPressed('70', $hDLL) Then $klawisz1 = "F1" GUICtrlSetData($button_hotkey, $klawisz1) $start = False EndIf WEnd M231 point -
GuiExtender problem
antonioj84 reacted to Melba23 for a topic
antonioj84, This looks pretty good: #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include "GUIExtender.au3" ; Create parent GUI $hGUI = GUICreate("Test", 1000, 300) GUISetState(@SW_HIDE, $hGUI) ; Create sections in main GUI _GUIExtender_Init($hGUI, 1) $iSection_1 = _GUIExtender_Section_Create($hGUI, 0, 500) ; Add some controls so we can see which section is which GUICtrlCreateLabel("", 0, 0, 500, 300) GUICtrlSetBkColor(-1, 0xCCCCFF) GUICtrlSetState(-1, $GUI_DISABLE) GUICtrlCreateLabel("I am the BLUE section that is static", 0, 100, 300, 20) ; Create the button which automatically activates next section of the same GUI _GUIExtender_Section_Activate($hGUI, $iSection_1 + 1, "", "", 470, 10, 20, 20) ; Create a button to action programatically a section of another GUI $cSect_4 = GUICtrlCreateButton("Section 4", 10, 270, 80, 30) $iSection_2 = _GUIExtender_Section_Create($hGUI, 500, 500) GUICtrlCreateLabel("", 500, 0, 500, 300) GUICtrlSetBkColor(-1, 0xFFCCCC) GUICtrlSetState(-1, $GUI_DISABLE) GUICtrlCreateLabel("I am the PINK section that opens and closes", 500, 100, 300, 20) ; Close section creation structure _GUIExtender_Section_Create($hGUI, -99) ; Create and position child GUI $aGUI_Pos = WinGetPos($hGUI) $hGUI_Child = GUICreate("Follower", 500, 200, 0, 0, BitOR($WS_POPUP, $WS_BORDER), 0, $hGUI) WinMove($hGUI_Child, "", $aGUI_Pos[0], $aGUI_Pos[1] + $aGUI_Pos[3]) GUISetState(@SW_HIDE, $hGUI_Child) ; Create section sin child GUI _GUIExtender_Init($hGUI_Child) $iSection_3 = _GUIExtender_Section_Create($hGUI_Child, 0, 1) ; I am the RED section that is static GUICtrlCreateLabel("", 0, 0, 500, 1) GUICtrlSetBkColor(-1, 0xFF0000) GUICtrlSetState(-1, $GUI_DISABLE) $iSection_4 = _GUIExtender_Section_Create($hGUI_Child, 1) GUICtrlCreateLabel("", 0, 1, 500, 200) GUICtrlSetBkColor(-1, 0xCCFFCC) GUICtrlSetState(-1, $GUI_DISABLE) GUICtrlCreateLabel("I am the Green section that opens and closes", 0, 100, 300, 20) ; Activate this section with no visible button _GUIExtender_Section_Activate($hGUI_Child, $iSection_4) ; Close section creation structure _GUIExtender_Section_Create($hGUI_Child, -99) ; Close extendable sections _GUIExtender_Section_Action($hGUI, $iSection_2, False) _GUIExtender_Section_Action($hGUI_Child, $iSection_4, False) ; And display the GUI(s) GUISetState(@SW_SHOW, $hGUI) GUISetState(@SW_SHOW, $hGUI_Child) ; Look for the main GUI moving GUIRegisterMsg($WM_MOVE, "_WM_MOVE") While 1 $iMsg = GUIGetMsg() Switch $iMsg Case $GUI_EVENT_CLOSE Exit Case $cSect_4 ; Toggle the section in the child GUI programatically _GUIExtender_Section_Action($hGUI_Child, $iSection_4, 9) EndSwitch ; Pass main GUI handle and event message to the UDF so it can action its extendable section automatically _GUIExtender_EventMonitor($hGUI, $iMsg) WEnd Func _WM_MOVE($hWnd, $iMsg, $wParam, $lParam) ; If the main GUI moves If $hWnd = $hGUI Then ; Move the child to follow Local $aGUI_Pos = WinGetPos($hWnd) WinMove($hGUI_Child, "", $aGUI_Pos[0], $aGUI_Pos[1] + $aGUI_Pos[3]) EndIf EndFunc ;==>_WM_MOVE Happy with that? M231 point -
GuiExtender problem
antonioj84 reacted to Melba23 for a topic
antonioj84, The UDF will only work in one sense within the same GUI - either horizontally or vertically. I did try once to make it bi-directional, but the logistics got too complex - especially if the sizes of the sections in the 2 directions were not compatible and there was not a fixed anchor section. But in your case it looks possible that using a child GUI to do the other direction might work - I will see if I can come up with something this morning. M231 point -
_FileReadToArray Encoding Problem
Floops reacted to 232showtime for a topic
looks fun, what game is this?1 point -
Hi Melba, I do my very best to - sometimes - be one step ahead of you1 point
-
stefionesco, When I test I get: Row |Col 0 |Col 1 [1] |https://www.google.ro/#safe active&q=test = link_value which is what I would expect. If you create the ini files as part of your script, why not reverse the key/value pairs so as to avoid the problem? M23 Edit: Hi water - great minds, eh?1 point
-
How to retrieve filtered rows is describd in the wiki.1 point
-
Thanks for sharing! Why? What is there to say really? It either works or it doesn't, and people either like it or they don't. To me, it is a thought provoking niche project. I can see where it can come in handy due to speed and permissions issues over sharing a Registry entry or something like an INI file, but I'm not sure how many exactly have an immediate need for this, or are just like me, storing it away for that day? To make further comment now, you really need to be using it here and now. And further to all that, I guess it is only useful where you are the author of all the programs that will be sharing the variable(s) ... or have access to the source codes of all ... so that limits things even further. Don't get me wrong though, I'm glad for your hard work and that you shared this. P.S. In all reality, you are lucky to get a Like, as many offerings here don't even get that or a 'Thank You' despite large numbers of downloads, etc ... and comments are even rarer unless a bug is found or understanding is difficult.1 point
-
Forum Rules
edenwheeler reacted to Jon for a topic
We want the forum to be a pleasant place for everyone to discuss AutoIt scripting, and we also want to protect the reputation of AutoIt. So we ask you to respect these simple rules while you are here: Forum Posting 1. Do not ask for help with AutoIt scripts, post links to, or start discussion topics on the following subjects: Malware of any form - trojan, virus, keylogger, spam tool, "joke/spoof" script, etc. Bypassing of security measures - log-in and security dialogs, CAPTCHAs, anti-bot agents, software activation, etc. Automation of software/sites contrary to their EULA (see Reporting bullet below). Launching, automation or script interaction with games or game servers, regardless of the game. Running or injecting any code (in any form) intended to alter the original functionality of another process. Decompilation of AutoIt scripts or details of decompiler software. This list is non-exhaustive - the Moderating team reserve the right to close any thread that they feel is contrary to the ethos of the forum. 2. Do not post material that could be considered pornographic, violent or explicit - or express personal opinions that would not be acceptable in a civilized society. Do not post any copyrighted material unless the copyright is owned by you or by this site. 3. To protect this community, any files posted by you are subject to checks to ensure that they do not contain malware. This includes, but is not limited to, decompilation and reverse engineering. 4. Do not flame or insult other members - and just report the thread to a Moderator (see below) if you are so attacked. 5. Do not PM other users asking for support - that is why the forum exists, so post there instead. 6. Do not create multiple accounts - if you inadvertently created multiple accounts then contact a Moderator to close the unwanted ones. 7. Do not repost the same question if the previous thread has been locked - particularly if you merely reword the question to get around one of the prohibitions listed above. 8. Do not delete your posts, nor completely remove their content, if doing so will interrupt the flow of the thread. 9. Do not post in a thread while the Moderating team are actively trying to determine whether it is legal. The Moderation team will do their best to act in fair and reasonable manner. Sanctions will only be applied as a last resort and any action taken will be explained in the relevant thread. If moderation action is taken, you will need to acknowledge this through a dialog or you will be unable to post further in the forum. Please note that this dialog is not an agreement that the warning was justified - it is only there so that members are aware that moderation action has been taken and that they may have certain restrictions applied to their account. If you feel that you have been unfairly moderated then contact the Moderator concerned - using a PM or the "Report" button is preferable to opening a new thread (although new members may have to do this). But do be aware that the Moderation team has the final word - the rules are set out by the site owner and you are only welcome here if you respect his wishes. Signatures and Avatars There is no formal policy for the use of signatures but if a moderator thinks it is too big and/or distracting then you may be asked to tone it down. No-one likes wading through signatures that are a page high. Similarly for avatars, expect distracting flashing and animated gifs to be removed. Reporting If you feel a post needs Moderator attention, please use the "Report" button next to the post date at the top. You can then enter details of why you have reported the post - but there is no need to include the content of the post as that is done automatically. The Moderating team will be alerted to the post and will deal with it as soon as they can. If you suspect a EULA violation, do not expect the Moderating team to do all the work - please provide some evidence in the report such as a copy of (or link to) the EULA in question, as well as the section you believe has been violated. Finally, please do not enter into an argument with the original poster - that is why we have Moderators. Spam Please do not react to spam in any way other than reporting it. Multiple reports are combined by the forum software, so there is no need to announce that you have reported the spam - in fact doing so only increases the work for the Moderator who deals with it. Interacting with this website Anyone found abusing the website is subject to harsh punishment without warning. A non-exhaustive list of potential abuses include: Automated forum registration or login. Automated posting or sending messages on the forum. Automated manipulation of polls, user reputation or other forum features. Automated creation or comments on issue tracker tickets. Automated creation or editing of wiki pages. Other abuses which are either examples of excessive bandwidth usage or automation of the site. Use common sense. If you do not have common sense, don't do anything. Do not automate the forum, wiki or issue tracker in any way at all. Scripts which automatically update AutoIt such as AutoUpdateIt are acceptable as long as they are not abused and do not generate excessive bandwidth usage.1 point -
I haven't carefully read everything in this thread but I notice you keep referring to a transparent child. Transparent child windows are not so easy but you can do it in AutoIt if you have a child with the style $WS_EX_MDICHILD. Here is a simple example #include <windowsconstants.au3> #include <winapi.au3> $G1 = GUICreate("Parent") GUICtrlCreateButton("quite a long button across the middle of the parent gui",20,200) GUISetState() $C1 = GUICreate("child",200,300,0,0,-1,bitor($WS_EX_MDICHILD, $WS_EX_LAYERED),$G1) GUISetBkColor(0xacbdef);set the child background to some colour which we can set as the transparent colour $btn1 = GUICtrlCreateButton("a button",20,50) GUISetState() _WINAPI_SetLayeredWindowAttributes($C1, 0xacbdef, 255) sleep(9000)1 point