Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 03/20/2017 in all areas

  1. Sorry for hitting the wrong key, previous post completed now. Think of a bank account with $1000 credit and no authorization to go in debt. At some time the owner wants to get money from an ATM. He selects $800. At the same time a $500 check is processed by the bank. If the ATM checks the account, verifies that it allows a $800 withdrawal, updates the account to become $200 while it delivers the banknotes, AND if the bank proceeds to the payment of the $500 check after the ATM read the account and before it updates it to $200, the account will become -$300, which is forbidden. The only way to guard against such inconsistency it to wrap both operations in a transaction, making each payment an atomic operation which either takes place completely as one uninterruptible process or fails (here due to insufficient credit in one of the cases). You must do: 0 - Begin immediate ; starts a transaction where writes will likely occur 1 - select ... 2 - process ... 3 - update ... 4 - if all OK then COMMIT (perform changes) else ROLLBACK (quit transaction without any change) and process confilcting situation. Both the ATM and the check processing need to use a transaction, so only the first one to COMMIT will go to completion, the other will encounter an error when trying to open its own transaction, or rather will wait until timeout to have a chance to let the transaction already started to complete. If you set a large enough timeout value and no dramatic event occurs (app crash), then everything will take place serially, leaving the DB in a consistent state at every time. SQLite implements IMMEDIATE and EXCLUSIVE transactions by using file locks. Network file locking is know to have been a big problem with all known OSes up to a relatively recent time. The problem is due to bugs and holes in the process of "simultaneously" broadcasting locking information over a network. Nothing is simultaneous with computing, especially in a networked environment. Situation seems to have improved by fixing myriad of bugs in protocols and discarding unreliable ones.
    2 points
  2. There are three ways you can posts scripts, these are: Inline code Attachments Download system Each has different advantages and disadvantages. In general you should use: Inline code - for short code snippets Attachments - for more complicated code larger than a page. Downloads system - for projects or complex libraries Inline Code Best for entering short snippets of code Easiest for other users to see May be accidentally modified by forum upgrades or when re-editing your post - it's happened before... Inline code is entered using the "Add Code" button in the toolbar and after posting appears with syntax highlighting like this: ; This is some AutoIt code MsgBox(4096, "Message", "Hello there!") Code over around 50 lines will appear in a scrollable box. At this point it becomes more difficult for other users to work with and you should consider an attachment instead. Attachments Best for long pieces of code, entire programs, or multiple files Unlikely to be accidentally lost or modified by forum upgrades or when re-editing your post Counts against your global attachment allocation Can be seen in the "username / My Attachments" part of your profile, along with the number of downloads Multiple attachments can be added to a post. As attachments are stored as complete files in the filesystem, they are more robust than inline code snippets. Downloads System Best for very long and complicated projects or libraries that are of significant use to the community Uses a different part of the forum that is optimised for file downloads and features screenshots, change logs, download counts, etc. Does not count against your global attachment allocation This can be accessed here: Downloads System.
    1 point
  3. jaberwacky

    Themes for SciTE

    Note: This has been deprecated by >SciTE Customization GUI. I highly recommend SCG for all of your theme needs. Thank you. and your SciTE customization knowledge too. Here is a dark theme for SciTE for all you dark theme fans. I got this theme from Notepad++ which got the theme from the Dejavu font project (http://dejavu.sourceforge.net/wiki/index.php/Main_Page). Customized by hand because the original themese aren't perfect. They had black text on dark background. The line number margin, fold margin, editor, and console is themed! I encourage you to post your theme too. Also, if you have any knowledge that would enhance this and any other theme then I encourage you to post that too. Please post a fairly high quality screenshot too please. Instructions: (this works for me anyway. If you know a better method lemme know) 1) create the file named 'Twilight.SciTEConfig' in the 'SciTEConfig' folder found in the SciTE folder of your AutoIt installation 2) fire up SciTE and press 'Ctrl+1' 3) select the 'Color Settings' tab 4) click 'New Scheme' 5) select 'Twilight' from the drop down list 6) finally, click 'Update' Screenshot: Twilight.SciTEConfig -- Updated: November 26, 2010 #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# # START: DO NOT CHANGE ANYTHING AFTER THIS LINE #-#-#-#-# # Twilight -- 06/21/2011 #------------------------------------------------------------ find.close.on.find=1 proper.case=1 check.updates.scite4autoit3=1 indent.size.au3=4 highlight.current.word=1 highlight.current.word.colour=#CF6A4C highlight.current.word.by.style =1 autocomplete.*.ignorecase=1 autocomplete.*.start.characters=2 calltip.*.ignorecase=1 save.position=1 default.file.ext=au3 strip.trailing.spaces=1 ensure.final.line.end=1 ensure.consistent.line.ends=1 # Background style.au3.32=back:#141414 # Brace highlight style.au3.34=fore:#FCE94F,bold # Brace incomplete highlight style.au3.35=fore:#EF2929,bold #CaretLine Fore caret.fore=#DADADA #CaretLine Back caret.line.back=#F8F8F8 caret.line.back.alpha=0 #Selection selection.fore=#CF6A4C selection.back=#DADADA selection.alpha=25 #White Space style.au3.0=fore:#F8F8F8 #Comment line style.au3.1=fore:#5F5A60 #Comment block style.au3.2=fore:#5F5A60 #Number style.au3.3=fore:#CF6A4C #Function style.au3.4=fore:#DAD085 #Keyword style.au3.5=fore:#F9EE98 #Macro style.au3.6=fore:#DADADA #String style.au3.7=fore:#8F9D6A #Operator style.au3.8=fore:#CDA869 #Variable style.au3.9=fore:#7587A6 #Sent keys style.au3.10=fore:#DADADA #Pre-Processor style.au3.11=fore:#8996A8 #Special style.au3.12=fore:#DADADA #Abbrev-Expand style.au3.13=fore:#DADADA #Com Objects style.au3.14=fore:#DADADA #Standard UDFs style.au3.15=fore:#0080FF # Line Number Margin style.au3.33=$(font.monospaced),fore:#F8F8F8,back:#2E3436 # Fold Margin fold.margin.colour=#555753 fold.margin.highlight.colour=#2E3436 error.marker.fore=#DADADA error.marker.back=#2E3436 # Error Output style.errorlist.0=fore:#DADADA # Program Output style.errorlist.1=fore:#DADADA # Error Line style.errorlist.3=fore:#DADADA # command or return status style.errorlist.4=fore:#8F9D6A # diff changed ! style.errorlist.10=fore:#CF6A4C # # Diff addition + style.errorlist.11=fore:#7587A6 # diff deletion - style.errorlist.12=fore:#F9EE98 # Console Background style.errorlist.32=$(font.monospace),back:#141414 # END => DO NOT CHANGE ANYTHING BEFORE THIS LINE #-#-#-#-#-# #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
    1 point
  4. For now, after successful run, AU3Check only reset/clear warning/error notifications in in main script. But those notifications still remain in #include scripts. The only way to clear them - is to restart SciTE. So - may / should it be changed to "reset all previous notification" mode?
    1 point
  5. #include <array.au3> Local $aArray = [[1, 2, 3], ['', '', ''], [4, 5, 6], [7, 8, 9, 0], ['', '', 'a', 'b'], [''], ['last row first cell']] msgbox(0 , '' , stringstripWS(StringRegExpReplace(_ArrayToString($aArray) , "\|\|+" , " ") , 4)) yall don't #@$$$%# around nearly enough
    1 point
  6. #include <GUIConstants.au3> #include <WindowsConstants.au3> #include <WinAPI.au3> Global $hMain = GUICreate("Test", 400, 400) Global $iActiveTimer = TimerInit() GUIRegisterMsg($WM_MOUSEMOVE, WM_MOUSEMOVE) GUIRegisterMsg($WM_KEYDOWN, Active) GUIRegisterMsg($WM_KEYUP, Active) GUIRegisterMsg($WM_LBUTTONDOWN, Active) GUIRegisterMsg($WM_LBUTTONUP, Active) GUIRegisterMsg($WM_RBUTTONDOWN, Active) GUIRegisterMsg($WM_RBUTTONUP, Active) GUIRegisterMsg($WM_MBUTTONDOWN, Active) GUIRegisterMsg($WM_MBUTTONUP, Active) GUISetState(@SW_SHOW, $hMain) While (True) Switch (GUIGetMsg()) Case $GUI_EVENT_CLOSE Exit 0 Case Else ToolTip("Inactive for " & Round(TimerDiff($iActiveTimer) / 1000, 0) & "s") If (Round(TimerDiff($iActiveTimer) / 1000, 0) >= 5) Then FunctionA() EndSwitch WEnd Func FunctionA() While (Round(TimerDiff($iActiveTimer) / 1000, 0) >= 5) ToolTip("FunctionA()") Sleep(100) WEnd ToolTip("") EndFunc Func Active($hWnd, $iMsg, $wParam, $lParam) $iActiveTimer = TimerInit() EndFunc Func WM_MOUSEMOVE($hWnd, $iMsg, $wParam, $lParam) Local Static $aLastPos[2] Local $iX = _WinAPI_LoWord($lParam) Local $iY = _WinAPI_HiWord($lParam) If ($iX <> $aLastPos[0] or $iY <> $aLastPos[1]) Then $iActiveTimer = TimerInit() $aLastPos[0] = $iX $aLastPos[1] = $iY EndIf EndFunc Give that a go.
    1 point
  7. @iamthekey try with this values: Local $aVersionsAndReleases[4][2] = [["0.2.8.9", "Release #1"], ["0.2.9.1", "Release #3"], ["0.2.9.11", "Release #4"], ["0.2.8.10", "Release #2"]]
    1 point
  8. Luigi

    [Solved] Timer problem

    Try this... Opt("TrayMenuMode", 3) Opt("TrayOnEventMode", 1) Local $trQuit = TrayCreateItem("Quitter") TraySetIcon("WorkOnScreen_white.ico") TrayItemSetOnEvent($trQuit, "Quit") ;~ AdlibRegister("Alert", 7200000) ; 2 hours AdlibRegister("Alert", 15000) ; 1000 miliseconds * 15 = 15 seconds While Sleep(15) ; delay 15 miliseconds to prevent high cpu use WEnd Func Alert() MsgBox(262192,"WorkOnScreen","Attention vous avez passé 2 heures sur l'ordinateur !" & @CRLF & "Pensez à faire une pause.", 5) EndFunc Func OnExit() AdlibUnRegister("Alert") EndFunc Func Quit() Exit EndFunc
    1 point
  9. Thanks you ! It works nice, have a nice day !
    1 point
  10. The problem isn't multiple instances of AutoIt, not even multiple concurent connections to the same SQLite DB. The possible cause of issues is with the network file locking protocols which may fail in some more or less bscure situations. SQLite isn't a client/server engine and isn't the best choice where remote concurency occurs at significant rate. That said, modern OSes (typically Win >= 7) seem to work flawlessly from this point of view AFAIK. Yet if you plan many users and significant concurency, your best choice will be a client/server engine (PostgeSQL for instance) and use of ODBC/ADO (lookup the ADO UDF by Mlipok). Nonetheless if you can afford some network delay and don't plan high concurency, you still can use SQLite. There is an UDF here within the Examples section which uses file semaphores to avoid issues. Of course it's even slower than bare SQLite. In low-concurency contexts and provided your application isn't mission- or life-critical, you can still use bare SQLite if you follow these guidelines (the same apply to multiple processes accessing a local SQLite DB, as well as using any client/server SQL engine with some changes to adapt to a given SQL dialect): Once for all, connect to the DB and issue "pragma journal_mode = WAL" to set the DB in WAL mode, which allows one writer and multiple readers concurently. Do this once as the setting will be permanent until changed (don't change it!). Right after creating any connection to the shared DB, issue _SQLite_SetTimeout with the maximum time that the longest possible transaction sequence might take. I could expand on why this pedantic phrasing, but let's say you set a 30 minutes timeout, or anything very long. Genuine client/server engines use more sophisticated locking and caching techniques, so this is merely a SQLite-specific thing. Use "BEGIN IMMEDIATE" transactions around any sequence of SQL statements which need to be atomic (e.g. RMW = read, modify, write). Also use transaction around sequences of statements within _SQLite_Exec when the whole operation needs to be atomic. If your application needs to read data, show it to a user, process the decision taken and then only update the DB, realize that when wrapped in an immediate transaction, the DB will get locked to other writers. If the user takes longer than the timeout value, other writers will receive SQLITE_BUSY error. The worst case is when data is read, awaiting user action and that the app crashes or PC is powered down or the user returns home or whatever situation where the transaction isn't terminated with either a COMMIT or a ROLLBACK. In this case, the best move is to have a dedicated column in shared tables which holds the user ID "owning" the row(s) and awaiting possible change. Only when a row holds NULL is it available for use in a RMW transaction. Test the error value after all SQL function invokation and act accordingly.
    1 point
  11. New Version: Download it here:
    1 point
  12. Not 100% sure if I read it correctly but maybe something like this: #include <GUIConstantsEx.au3> #include <GuiEdit.au3> #include <MsgBoxConstants.au3> Global $sFilePath, $sFileName = "app.ini" Example() Func Example() Local $sAppPath Local $hGUI = GUICreate("Example", 365, 30) Local $idFilePath = GUICtrlCreateInput("", 5, 5, 250, 21) _GUICtrlEdit_SetCueBanner($idFilePath, "<FilePath>\App.exe") Local $idSelect = GUICtrlCreateButton("Browse", 260, 5, 100, 21) GUICtrlSetState($idSelect, $GUI_FOCUS) GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop Case $idSelect GUICtrlSetData($idFilePath,_FolderSelect()) EndSwitch WEnd GUIDelete($hGUI) EndFunc Func _FolderSelect() Local Const $sMessage = "Select a folder" Local $sSelectPath = FileSelectFolder($sMessage, IniRead($sFileName, "App", "App", "")) If @error Then MsgBox($MB_SYSTEMMODAL, "", "No folder was selected.") Return "" Else $sFilePath = $sSelectPath & "\App.exe" If FileExists($sFilePath) then IniWrite($sFileName, "App", "App", $sSelectPath) Return $sFilePath Else MsgBox($MB_SYSTEMMODAL, "", $sFilePath & " could not be found") Return "" EndIf EndIf EndFunc
    1 point
  13. Creating an application that could read any autoit code and convert it into efficient C code would be a mammoth undertaking. Whilst it is relatively easy to convert simple statements that use AutoIts built in functions, handling more complex statements and the UDF libraries would be a nightmare. The effort required is just not going to be worth anyone's time. I use AutoIt daily in an enterprise environment and have hundreds of scripts ranging from small 10 liners that I use once to do something like update a 1.5TB xml file to 80,000 line scripts that orchestrates a full testing and validation flow line. As others have said the speed of AutoIt in most day to day use cases is not an issue. If speed is an issue then I would write the application directly in C so that I can make full use of the direct control that C give you rather than some inevitably less than optimal automatically generated code. The main reason I use AutoIt is the speed that I can create an application that does the job require. Usually this is much quicker than I could even just write a detailed requirements document require by our IS department before they will event give a rough quote.
    1 point
  14. Try: #include <MsgBoxConstants.au3> $sFirstFolder = Example() $sSecondFolder = Example($sFirstFolder) Func Example($sFolder = "") ; Create a constant variable in Local scope of the message to display in FileSelectFolder. Local Const $sMessage = "Select a folder" ; Display an open dialog to select a file. Local $sFileSelectFolder = FileSelectFolder($sMessage, $sFolder) If @error Then ; Display the error message. MsgBox($MB_SYSTEMMODAL, "", "No folder was selected.") Else ; Display the selected folder. MsgBox($MB_SYSTEMMODAL, "", "You chose the following folder:" & @CRLF & $sFileSelectFolder) Return $sFileSelectFolder EndIf EndFunc ;==>Example
    1 point
  15. You must check in this way: $iNewState = DllStructGetData($tInfo, "NewState") $iOldState = DllStructGetData($tInfo, "OldState") ;ConsoleWrite($iNewState &' (L: '&@ScriptLineNumber&')'&@CRLF) $iTem = DllStructGetData($tInfo, "Item") If Not BitAND($iOldState,$LVIS_SELECTED) And BitAND($iNewState,$LVIS_SELECTED) Then ToolTip('Item: '&$iTem&' selected') ; <----- Item X selected ConsoleWrite( 'Item: '&$iTem&' selected'&' (L: '&@ScriptLineNumber&')'&@CRLF) ElseIf BitAND($iOldState,$LVIS_SELECTED) And Not BitAND($iNewState,$LVIS_SELECTED) Then ToolTip('Item: '&$iTem&' unselected') ; <----- Item X unselected ConsoleWrite('Item: '&$iTem&' unselected' &' (L: '&@ScriptLineNumber&')'&@CRLF) EndIf
    1 point
  16. @Skysnake For checking You could use UDF like this: #include-once #AutoIt3Wrapper_Run_AU3Check=Y #AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w- 4 -w 5 -w 6 -w 7 ; #AutoIt3Wrapper_Run_Debug_Mode=Y ; #Tidy_Parameters=/sort_funcs /reel Global $__g_sUDFLOG_PREFIX = '--> ' Global $__g_sUDFLOG_ERROR_PREFIX = '! ' _Log_Example() Func _Log_Example() ; set function to where log report is passed _Log_SetOutputFunction(ConsoleWrite) ; Sending description to log output _Log('We are trying to read file.') ; fire @error FileRead('FILE PATH WHICH NOT EXIST') ; report @error but do not change it - store it and back it again _Log_Errors('File Reading Problem.') ; check again for @error If @error Then Return SetError(@error, @extended, MsgBox(0, 'Error Occured', 'File Reading Problem.')) EndIf EndFunc ;==>_Log_Example ; #FUNCTION# ==================================================================================================================== ; Name ..........: _Log_Errors ; Description ...: Log description to the output but only if @error or @extended occurs ; Syntax ........: _Log_Errors($sText[, $iError = @error[, $iExtended = @extended]]) ; Parameters ....: $sText - a string value. ; $iError - [optional] an integer value. Default is @error. Used to store @error ; $iExtended - [optional] an integer value. Default is @extended. Used to store @extended ; Return values .: Restored @error and @extended ; Author ........: mLipok ; Modified ......: ; Remarks .......: ; Related .......: _Log ; Link ..........: ; Example .......: No ; =============================================================================================================================== Func _Log_Errors($sText, $iError = @error, $iExtended = @extended) Local $fnFunction = _Log_SetOutputFunction() If ($iError Or $iExtended) And IsFunc($fnFunction) Then _ $fnFunction($__g_sUDFLOG_ERROR_PREFIX & '@error=' & $iError & ' @extended=' & $iExtended & ' : ' & $sText & @CRLF) Return SetError($iError, $iExtended) EndFunc ;==>_Log_Errors ; #FUNCTION# ==================================================================================================================== ; Name ..........: _Log ; Description ...: Log description to the output ; Syntax ........: _Log($sText[, $iError = @error[, $iExtended = @extended]]) ; Parameters ....: $sText - a string value. ; $iError - [optional] an integer value. Default is @error. Used to store @error ; $iExtended - [optional] an integer value. Default is @extended. Used to store @extended ; Return values .: Restored @error and @extended ; Author ........: mLipok ; Modified ......: ; Remarks .......: ; Related .......: _Log_Errors ; Link ..........: ; Example .......: No ; =============================================================================================================================== Func _Log($sText, $iError = @error, $iExtended = @extended) Local $fnFunction = _Log_SetOutputFunction() Local $sDescription = _ (($iError Or $iExtended) ? ($__g_sUDFLOG_ERROR_PREFIX & '[ ' & $iError & ' / ' & $iExtended & ' ] : ') : ($__g_sUDFLOG_PREFIX)) _ & $sText & @CRLF If IsFunc($fnFunction) Then $fnFunction($sDescription) Return SetError($iError, $iExtended) EndFunc ;==>_Log ; #FUNCTION# ==================================================================================================================== ; Name ..........: _Log_SetOutputFunction ; Description ...: Set the function to which Log description should be passed ; Syntax ........: _Log_SetOutputFunction([$fnFunction = Default]) ; Parameters ....: $fnFunction - [optional] a floating point value. Default is Default. ; Return values .: None ; Author ........: mLipok ; Modified ......: ; Remarks .......: ; Related .......: ; Link ..........: ; Example .......: No ; =============================================================================================================================== Func _Log_SetOutputFunction($fnFunction = Default) Local Static $fnFunction_static = Null If $fnFunction = Default Then Return $fnFunction_static If Not IsFunc($fnFunction) Then Return SetError(1) $fnFunction_static = $fnFunction Return $fnFunction_static EndFunc ;==>_Log_SetOutputFunction
    1 point
  17. @Mehomic I added two little fx - more is not possible without decreasing earth display quality and FPS rate. Btw, this is the last update.
    1 point
  18. For starters in COM https://www.codeproject.com/Articles/13601/COM-in-plain-C https://www.codeproject.com/Articles/13862/COM-in-plain-C-Part https://www.codeproject.com/Articles/14037/COM-in-plain-C-Part https://www.codeproject.com/Articles/14117/COM-in-plain-C-Part https://www.codeproject.com/Articles/14183/COM-in-plain-C-Part https://www.codeproject.com/Articles/14905/COM-in-plain-C-Part https://www.codeproject.com/Articles/15037/COM-in-plain-C-Part https://www.codeproject.com/Articles/17038/COM-in-plain-C-part Studying this udf gives more understanding for defining and getting the interfaces and reflection / metadata from AutoIt https://www.autoitscript.com/forum/topic/114498-typelibinspector-oleview-was-yesterday/?page=2#comment-1048903 https://www.autoitscript.com/forum/topic/112992-tliau3-type-information-on-com-objects-tlbinf-emulation/#comment-791089 AutoIt Object udf (AIO) Excellent resource for studying on how to do more complex thing that AutoIt did not offer out of the box for creating objects. When learning a lot in this thread this AIO udf was also excellent area to see how Variant/COM stuff is implemented in AutoIt by using oleaut32.dll https://www.autoitscript.com/forum/topic/110379-autoitobject-udf/#comment-775262 https://msdn.microsoft.com/en-us/library/windows/desktop/ms221673(v=vs.85).aspx For me its a little unclear how AIO relates nowadays to objCreateInterface ; Declare the CLSID, IID and interface description for ITaskbarList. ; It is not necessary to describe the members of IUnknown. Local Const $sCLSID_TaskbarList = "{56FDF344-FD6D-11D0-958A-006097C9A090}" Local Const $sIID_ITaskbarList = "{56FDF342-FD6D-11D0-958A-006097C9A090}" Local Const $sTagITaskbarList = "HrInit hresult(); AddTab hresult(hwnd); DeleteTab hresult(hwnd); ActivateTab hresult(hwnd); SetActiveAlt hresult(hwnd);" ; Create the object. Local $oTaskbarList = ObjCreateInterface($sCLSID_TaskbarList, $sIID_ITaskbarList, $sTagITaskbarList) ; Initialize the iTaskbarList object. $oTaskbarList.HrInit() SafeArray udf https://www.autoitscript.com/forum/topic/185883-accessing-autoit-variables/#comment-1335030
    1 point
  19. Maybe this topic would be some help for you: .NET compiled dll assembly in AutoIt, the simple approach!
    1 point
  20. 23-april-2017 initial au3 library posted in examples section over here https://www.autoitscript.com/forum/topic/188158-net-common-language-runtime-clr-framework/ Introduction In this whole tread posts 1-180 a lot of learning material which I try to summarize in this post 4. Around post 180 we had a working version ready for examples section to ask more help from others to enhance the UDF a. Make use / enhance for more examples (the enduser of the udf --> see examples section in forum) b. Host the CLR runtime in a better more documented way (the technical side of the udf in this thread) Reflection and related concepts Important area in integrating interfaces, types, dynamic and related concepts all relate to reflection http://www.codeproject.com/Articles/55710/Reflection-in-NET For this we need System.Reflection.Assembly and related methods like gettype_2 and createinstanceXXX TODO Find out: System.Activator and important methods to createInstanceXXX For starters Advice to first understand high level COM concepts before you step to .NET https://www.autoitscript.com/forum/topic/187334-using-net-libary-with-autoit-possible/?do=findComment&comment=1345621 Summary post 1-180 Hosting the CLR in CPP / Microsoft references https://code.msdn.microsoft.com/CppHostCLR-e6581ee0 https://technet.microsoft.com/nl-nl/library/ms164408 Summarized start of udf in post 68 https://www.autoitscript.com/forum/topic/187334-using-net-libary-with-autoit-possible/?page=4#comment-1348019 First working example of hosting .NET in post #25 #28 #29 of this thread https://www.autoitscript.com/forum/topic/187334-using-net-libary-with-autoit-possible/?page=2#comment-1346495 Some tips on the interface definitions post #33 https://www.autoitscript.com/forum/topic/187334-using-net-libary-with-autoit-possible/?page=2#comment-1346569 Some example in C++ and VBA to be transformed to AutoIt in post #39 https://www.autoitscript.com/forum/topic/187334-using-net-libary-with-autoit-possible/?page=2#comment-1346697 An approach by compiling in .NET https://www.autoitscript.com/forum/topic/166704-net-compiled-dll-assembly-in-autoit-the-simple-approach/ Lots of reading references in post #47,#48, #49 The common language interface CLI standard ECMA 335 https://www.ecma-international.org/publications/standards/Ecma-335.htm some nice code project references https://www.codeproject.com/Articles/607352/Injecting-Net-Assemblies-Into-Unmanaged-Processes Some references on how other scripting languages deal with .NET Hp uft vbscript http://www.learnqtp.com/dotnetfactory-qtp-part7-arraylist/ PHP http://php.net/manual/en/class.dotnet.php Visual foxpro https://west-wind.com/wwdotnetbridge.aspx and http://foxcentral.net/microsoft/netforvfpdevelopers.htm powerbasic https://forum.powerbasic.com/forum/user-to-user-discussions/programming-with-objects/47869-passing-interface-to-function-to-be-created?p=567769#post567769 Summary in post #116 https://www.autoitscript.com/forum/topic/187334-using-net-libary-with-autoit-possible/?page=6#comment-1349309 Technical background Some other relevant articles related to AutoIt and this CLR stuff MSCorEE.DLL and MSCORLIB.DLL by googling the internet Books to read http://www.charlespetzold.com/dotnet/ A must read free pdf for understanding .net .NET CLR via C# https://www.amazon.com/CLR-via-4th-Developer-Reference/dp/0735667454 free chapters 21,22,23 can be found on the internet Lengthy list of references used in the thread (clean / sort later in a logical order) http:// https://autohotkey.com/boards/viewtopic.php?t=4633 https://code.msdn.microsoft.com/windowsdesktop/CppHostCLR-e6581ee0 http://www.ownedcore.com/forums/world-of-warcraft/world-of-warcraft-bots-programs/wow-memory-editing/320083-guide-loading-net-4-0-clr.html https://blogs.msdn.microsoft.com/carlos/2013/08/23/loading-multiple-clr-runtimes-inproc-sxs-sample-code/ Small dll's so you can use it without registering .NET classed as com https://soraco.co/quick-license-manager/vba-dotnet/ Call .NET methods from VBA http://stackoverflow.com/questions/37074533/how-to-call-net-methods-from-excel-vba Register the .NET classes with regasm https://msdn.microsoft.com/en-us/library/zsfww439(v=vs.100).aspx
    1 point
  21. Nahuel

    Detect MouseUp ?!

    Did you see the second code? #include <GUIConstants.au3> #include <Misc.au3> $GUI = GUICreate("My GUI") $ic = GUICtrlCreatePic("1.jpg",0,0,100,23) GUICtrlSetState(-1, $GUI_DISABLE) $b = GUICtrlCreatePic("2.jpg",0,0,100,23) GUICtrlSetState(-1,$GUI_HIDE) $2 = GUICtrlCreatePic("3.jpg",0,0,100,23) GUICtrlSetState(-1,$GUI_HIDE) GUISetState() While 1 $m = GUIGetMsg() If $m = -3 then Exit $c = GUIGetCursorInfo($GUI) If $c[4] = $ic Then GUICtrlSetState( $b, $GUI_SHOW) GUICtrlSetState( $ic, $GUI_HIDE) ;Sleep(100) $c = GUIGetCursorInfo($GUI) While $c[4] = $b If GUIGetMsg() = $b Then Do_Function() $c = GUIGetCursorInfo($GUI) WEnd GUICtrlSetState( $2, $GUI_HIDE) GUICtrlSetState( $b, $GUI_HIDE) GUICtrlSetState( $ic, $GUI_SHOW) EndIf WEnd Func Do_Function() GUIGetCursorInfo($GUI) GUICtrlSetState( $2, $GUI_SHOW) _MouseUp() MsgBox(0x0, "tset", "OK..... ", 3) EndFunc ;Detect if mouse primary button was released: Func _MouseUp() While 1 If _IsPressed(01) Then Do Sleep(25) Until Not _IsPressed(01) Return EndIf WEnd EndFunc You fix it so it works only for your script.
    1 point
×
×
  • Create New...