Leaderboard
Popular Content
Showing content with the highest reputation on 06/05/2017 in all areas
-
While running executable modules are locked in a manner that you can't edit them. Accessible for reading, but not for writing. This means that in order to modify them you must wait till they are done, start a new process to do a modifications and do what ever you want (if you have enough rights). Ability to do that without additional module (take this conditionally) improves security of an application and makes it more portable. For example, script in this post deletes itself (compiled or not) after it's done. Script from few posts down (link) adds files dropped on executable to its resource section. Another example would be to add/update configuration data of the module that is stored within it (attached or as a resource), or to add a sort of hash check with ability to update it. How to do it? The idea is this (it's actually very obvious): - make a new process that will wait for the main process to exit and then do desired modifications on the main module. AutoIt's executables are specific. When you run AutoIt, it will look for the script to interpret and if it finds is it will try to run it, and if not it will exit. Built-in feature of every AutoIt executable is /AutoIt3ExecuteScript command line switch. It tells interpreter to interpret a script of our desire. I will use that. Another key moment is creating another process. Writing to hard drive is out of the question (because of the lack of coolness and new problems that could arrive upon that). Solution is much more advanced. I already explained the procedure before (link). It's running executables from memory. I will, in script that follows, start another process (of my wish) and rewrite its memory space in order for it to act as another interpreter. Another AutoIt interpreter. That new interpreter will execute the same script as the original one, but (and here is the catch) under changed circumstances. Script is written to initially check for the count of a specific Semaphore object. In case it exists it will execute part of the script that actually does the destruction. Semaphores are used widely before, there is nothing new to say about them. Not to quibble more, here's the script: SelfDestruct.au3 edit: New intro. It was pointed out to me from the different directions that the old one was kind of shitty.1 point
-
Future of JavaApplets
anthonyjr2 reacted to mLipok for a topic
I hope there is another way. No problem. I also not challenging you. I was just hope you know this, but the problem was in my poor description.1 point -
Thank you. Fixed. What I get for doing two posts way past my bedtime.1 point
-
This example counts the number of Level 1 list paragraphs: #include <Word.au3> Local $oWord = _Word_Create() Local $sDocument = "C:\temp\test.docx" Local $oDoc = _Word_DocOpen($oWord, $sDocument, Default, Default, True) Global $iLists = $oDoc.ListParagraphs.Count Global $iLevel = 0 For $i = 1 To $iLists If $oDoc.ListParagraphs($i).Range.ListFormat.ListLevelNumber = 1 Then $iLevel = $iLevel + 1 Next MsgBox(0, "", "Number of level 1 paragraphs: " & $iLevel) _Word_Quit($oWord)1 point
-
Then also read faq 31 in frequently asked questions. That will give you indications like getcontrol from position x y. So then you are basing your action on the content of the control like menutext. Much more reliable then position clicking.1 point
-
Trigger event on mouse position in x,y
genius257 reacted to InunoTaishou for a topic
Try this #include <WinAPIGdi.au3> #include <Misc.au3> While 1 If _IsPressed("01") Then Local $pos = MouseGetPos() If ($pos[0] = 900 And $pos[1] = 800) Then ConsoleWrite("Clicked at 900, 800" & @LF) EndIf ; Better to check if in an area, not at exact point If (_WinAPI_PtInRectEx($pos[0], $pos[1], 800, 700, 1000, 900)) Then ConsoleWrite("Clicked in area 800, 700, 1000, 900" & @LF) EndIf EndIf WEnd Slightly more complicated but would be better #include <MsgBoxConstants.au3> #include <StructureConstants.au3> #include <WinAPI.au3> #include <WindowsConstants.au3> #include <WinAPIGdi.au3> OnAutoItExitRegister(Cleanup) Global $hCallBack = DllCallbackRegister(MouseProc, "long", "int;wparam;lparam") Global $hMod = _WinAPI_GetModuleHandle(0) Global $hHook = _WinAPI_SetWindowsHookEx($WH_MOUSE_LL, DllCallbackGetPtr($hCallBack), $hMod) While (True) Sleep(100) WEnd Func MouseProc($nCode, $wParam, $lParam) If ($nCode < 0) Then Return _WinAPI_CallNextHookEx($hHook, $nCode, $wParam, $lParam) Local $tMouse = DllStructCreate($tagPOINT & ";dword mouseData;dword flags;dword time;ulong_ptr dwExtraInfo", $lParam) Local $iX = DllStructGetData($tMouse, 1) Local $iY = DllStructGetData($tMouse, 2) $tMouse = Null Switch ($wParam) Case $WM_LBUTTONDOWN If ($iX = 900 And $iY = 800) Then ConsoleWrite("Clicked at 900, 800" & @LF) EndIf ; Better to check if in an area, not at exact point If (_WinAPI_PtInRectEx($iX, $iY, 800, 700, 1000, 900)) Then ConsoleWrite("Clicked in area 800, 700, 1000, 900" & @LF) EndIf Case $WM_LBUTTONUP Case $WM_MOUSEMOVE Case $WM_MOUSEWHEEL Case $WM_MOUSEHWHEEL Case $WM_RBUTTONDOWN Case $WM_RBUTTONUP Case $WM_MBUTTONDOWN Case $WM_MBUTTONUP EndSwitch Return _WinAPI_CallNextHookEx($hHook, $nCode, $wParam, $lParam) EndFunc ;==>MouseProc Func Cleanup() _WinAPI_UnhookWindowsHookEx($hHook) DllCallbackFree($hCallBack) EndFunc ;==>Cleanup1 point -
Hi Deye, Sorry for the delay in replying; too many plates to keep spinning in the air at the moment; (also deeply ashamed to admit I still haven't studied your mod in detail either ). Okay, so I gather your underlying aim is to provide the user with a graceful exit message rather than just crashing in a non-sanctioned environment. Rather than your somewhat complicated setup, I would suggest you create a simple hashing function of the CCkey(s) you're using, place it above _MCFCC_Init, and call it inside _MCFCC_Init, below the CCkey array definitions. So for example, if encrypting with $CCkey[3]=@UserName, obtain the MD5 hash of @userName and insert it in your check function. That way the contents of the key(s) is/are still secure, but you can check whether they contain what you expect, and perform a graceful exit if not.1 point
-
[NEW VERSION] - 4 Jun 17 Added: _Notify_Locate now takes an optional second parameter which, when used in a multiple monitor setup, will force the notifications to appear on a specified monitor rather than the left and right side of the entire display area. New UDF in the first post. M231 point
-
EXCEL FORMULA
232showtime reacted to Jos for a topic
That formula does not look right as there are 3 closing brackets and only 2 functions. On top of that the lookup table only has one column and you want to retrieve column 2. Is this the original you found or did you change it yourself? .. and what are you really looking for here as I am not sure what you mean with a VLOOKUP from right to left as V stands for Vertical. Jos EDIT: And a quick Google search gave the answer to the {1,0} question: http://www.excelhowto.com/functions/if-function/1 point -
Mau, Looks like you missed this one: And you might want to search the forum for discussion of the Beta Map datatype. M231 point
-
I didn't create this, I found it here: http://sourceforge.net/projects/autoitc/ i tested it with simple things like a msgbox, and it works fine, but it's very limited how many commands it supports. i though I share it, would be great if it were able to compile any script to c++ ========================================================================== AutoItC 0.1.0 (alpha) ========================================================================== WARNING: This is an Alpha Version. Several features may be missing or incomplete. Content of this file: 1. Directory Structure Overview 2. How To Start 3. AutoItC-Converter 4. License ========================================================================== 1. Directory Structure Overview ========================================================================== /include The header files for the runtime library of AutoItC /intern The source files for the runtime library of AutoItC - This folder might not exist in the binary-only version of AutoItC /AutoItC-Converter The source files of AutoItC-Converter.exe - This folder might not exist in the binary-only version of AutoItC /AutoItC-Converter.exe Command line tool which converts the AutoIt-script to C++-files /Compiler.au3 AutoIt-script which automates the compiling process /Compiler.exe Compiled version of Compiler.au3 /libAutoItC.a Runtime library ========================================================================== 2. How to start ========================================================================== AutoItC is Windows only. You need at least gcc 4.7 for compiling C++ to executables.. Before using AutoItC add the path of gcc to the environment variable PATH or modify Compiler.ini. Run Compiler.exe or Compiler.au3 and select the input and output file and do the compiling automatically. You can also do the code generation with AutoItC-Converter and then compile and link manually with the command line. See 2. AutoItC-Converter for more details about the options. ========================================================================== 3. AutoItC-Converter ========================================================================== AutoItC-Converter is a command line tool which converts the AutoIt script to C++. Options: -iPATH path to include files (e.g. -i..\include) if not set, no includes-directory exists -fFILE process FILE -fFILE must be set or the compiler will break with an error message -oFILE write the output into FILE default is out.cpp -l print a short version of the license (GPL) AutoItC.zip1 point
-
_Service_UDF v4 : Build your own service with autoit code
eaglezleegogo reacted to spudw2k for a topic
Very nice arcker! Bout time this was done.1 point