Leaderboard
Popular Content
Showing content with the highest reputation on 03/30/2018 in all areas
-
[Solved] IPC between system and user
argumentum reacted to RTFC for a topic
Regarding those structs I used in that Test3 example, the first one is just a dummy buffer to illustrate the relative offset you need to access the second struct. Note that the absolute address of the allocation in virtual memory is PID-specific, so each process obtains its own mapping of the same virtual region, and the (same) offset of a particular struct will be relative to that PID-specific base within each process. With me still? I'm also using the PID to generate a process-specifc unique name for the allocated region, so multiple processes can each allocate multiple regions (and multiple structs within those, if necessary), and each process can predict a memory-mapped region's name once it knows what process (PID) created it. The first allocation within each region of course has an offset of zero, so if you only need it for basic comms, maybe that's enough (two processes each create one write buffer, read by the other, so then you don't need to bother with mutex negotiation to ensure you're not both writing to the same allocation at the same time). Errm, not really, sorry, but thanks for asking. I only cobbled HighMem together for my E4A matrix computing environment, because I need to manipulate large datasets (>4GB, hence x64-mode required). If you think it might be of more general use in an IPC context, just write your own wrapper UDFs and include HighMem.au3 (I think only the test scripts use x64-mode anyhow, the main UDF does not require it, as we just discovered). It shouldn't take more than a rewrite of the Test3 scripts in UDF form. Maybe provide some snazzy user options such as storing strings in a 64K string struct, or some predefined codes for basic comms operations. Have a look at my Pool environment for some examples, if you wish. It's definitely doable and probably fun (basic functionality is already present), but I simply cannot spare the time for new UDFs these days, drowning in CUDA at the moment... But it's great that you find it useful!1 point -
What's it called when...2
Earthshine reacted to BrewManNH for a topic
Look in the post 3 up from yours, then click on the link in it.1 point -
Passing values from autoit to vba script
Earthshine reacted to Becca for a topic
OMG! Thank you SO much. I just ran it and it worked like a charm. I really appreciate the generosity of this forum. Is there any way to vote for solutions besides clicking the heart/trophy icon? Thank you again Subz. I really appreciate it!!1 point -
Always maintain the same Window Proportions
Earthshine reacted to Melba23 for a topic
KfirAsulin, Use the @DesktopWidth & @DesktopHeight macros to find out the actual screen resolution and then do some basic maths to determine the required GUI size for that screen. Create your GUI at a standard initial size and use the AutoItSetOption ( "GUIResizeMode", $GUI_DOCKAUTO) directive so that the controls will resize correctly. Once the GUI is created, then resize the GUI to the required size using WinMove. M231 point -
[Solved] IPC between system and user
argumentum reacted to Bilgus for a topic
Depending on how much data you are transfering you could use the eventlog functions.. I only mention it because you can get notifications with _EventLog__Notify ( $hEventLog, $hEvent )1 point -
[Solved] IPC between system and user
argumentum reacted to RTFC for a topic
Hi, interesting problem. TCP/UDP should work. NamedPipes and regular shared memory likely won't work. I would guess Mailslot and injecting Windows message queue won't work either (or only one-way at best), but haven't tested this. I did just run a successful test with my HighMem UDF (link in sig, Test 3 scripts A and B, any number of processes can share access to the same region(s) ) where one script is ADMIN and the other is USER (note that Scite output is not visible for admin when starting Scite as user and script has #RequireAdmin), but comms and beeps upon successful I/O still work, as does user output in the other Scite window); haven't ever tested HighMem with SYSTEM account, but it might be worth a shot (I'd be interested to hear how it went); it does require x64-mode (machine/OS/Au3) though. EDIT: So I couldn't resist, and hooked up wraithdu's adaptation of arcker's great services UDF to elevate script HighMem_Test3_A.au3 to SYSTEM level, and to my delight and surprise, communicating to/from user-level script works fine both ways. And because the shared mem is virtual, access is fast, and there's no size restrictions (easily >4GB).1 point -
Try this: #Include <Array.au3> Local $s = "Hello, " & Chr(27) & "[ 40;31mThis is red on black " & chr(13) & _ Chr(27) & "[ 47;32m And this is green on white" & chr(10) & _ Chr(27) & "[ 47 ; 32 m And this is also green on white (more spaces)" & _ Chr(27) & "[1234567890123456798Kvftio this matches the definition," & @TAB & "albeit probably invalid ANSI escape" & _ Chr(27) & "[ 47;32 !!!! this is not an ANSI " & Chr(27) & "sequence" & _ Chr(27) & "[ z but this one is OK and final bell!" & Chr(7) Local Const $_Not_A_Char = '*' Local $s2 = Execute("'" & StringRegExpReplace($s, "(?x)" & _ "(?(DEFINE) (?<ANSI_Escape> \[ (?:\s*\d*\s*;?)* [[:alpha:]]) )" & _ "( \x1B (?&ANSI_Escape) | [\x00-\x1F] )", _ "' & $_Not_A_Char & _Constify('$2') & $_Not_A_Char & '") & "'") Local $aRes = StringRegExp($s2, "(?x) (\" & $_Not_A_Char & ".+? \" & $_Not_A_Char & " | [^\" & $_Not_A_Char & "]+ )", 3) _ArrayDisplay($aRes, "Mixed results") ; example of "dressing" control characters and ANSI sequences Func _ConstiFy($c) Local Static $aK = [ _ 'NUL', 'SOH', 'STX', 'ETX', 'EOT', 'ENQ', 'ACK', 'BEL', _ 'BS', 'TAB', 'LF', 'VT', 'FF', 'CR', 'SO', 'SI', _ 'DLE', 'DC1', 'DC2', 'DC3', 'DC4', 'NAK', 'SYN', 'ETB', _ 'CAN', 'EM', 'SUB', 'ESC', 'FS', 'GS', 'RS', 'US' _ ] Return('@' & $aK[AscW(StringLeft($c, 1))] & StringMid($c, 2)) EndFunc1 point
-
You know you could do this all in Autoit without the macro, example below: #include <Array.au3> #include <Excel.au3> #include <File.au3> #include <MsgBoxConstants.au3> Local $sDirPath = @DesktopDir & "\MergingExcelTest2" ;~ Nav through folders in the designated directory. Local $aDirList = _FileListToArray($sDirPath, "*", 2) If @error = 1 Then MsgBox($MB_SYSTEMMODAL, "", "Path was invalid.") Exit EndIf If @error = 4 Then MsgBox($MB_SYSTEMMODAL, "", "No file(s) were found.") Exit EndIf Local $aXlsList, $oWorkBook, $oReadBook, $iWorkSheets = 1 Local $oExcel = _Excel_Open(True, False, True, True, True) For $i = 1 To $aDirList[0] $aXlsList = _FileListToArray($sDirPath & "\" & $aDirList[$i], "*.xls", 1, True) If @error = 1 Then MsgBox($MB_SYSTEMMODAL, "", "Path:" & $sDirPath & "\" & $aDirList[$i] & " is invalid.") ContinueLoop EndIf If @error = 4 Then MsgBox($MB_SYSTEMMODAL, "", "No file(s) were found.") ContinueLoop EndIf $oWorkBook = _Excel_BookNew($oExcel) For $j = 1 To $aXlsList[0] $oReadBook = _Excel_BookOpen($oExcel, $aXlsList[$j], True) For $k = 1 To $oReadBook.Sheets.Count _Excel_SheetCopyMove($oReadBook, $k, $oWorkBook, $iWorkSheets, False, True) $iWorkSheets += 1 Next _Excel_BookClose($oReadBook) Next $iWorkSheets = 1 _Excel_BookSaveAs($oWorkBook, $sDirPath & "\" & $aDirList[$i] & ".xlsx") _Excel_BookClose($oWorkBook) Next _Excel_Close($oExcel)1 point
-
How can I make the Autoit type the same text in the notepad every x seconds?
jameelo25 reacted to Abdulla060 for a topic
While 1 WinActivate("Discord") sleep(2500) MouseClick("left",500, 770) send("hai people ") send("{enter}") Sleep(1800000) WEnd is this what you need?1 point -
rootx, So you missed the $LVS_NOCOLUMNHEADER style? M231 point
-
An easier way to sort a ListView. #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <GUIListView.au3> Global $aData[4] = ["2014-03-09|456|201|3|0.45%|$2.94|$0.7654", "2014-03-08|236|231|2|0.65%|$1.25|$1.4321", _ "2014-03-07|566|341|1|0.75%|$4.62|$0.4567", "2014-03-06|786|561|3|0.95%|$6.48|$0.8765"] Global $fSortSense = False ; Set initial ascending sort $hGUI = GUICreate("Test", 500, 500) $cListView = GUICtrlCreateListView("", 10, 10, 480, 400) _GUICtrlListView_AddColumn($cListView, "Date", 80) _GUICtrlListView_AddColumn($cListView, "Requests", 80) _GUICtrlListView_AddColumn($cListView, "Impressions", 80) _GUICtrlListView_AddColumn($cListView, "Clicks") _GUICtrlListView_AddColumn($cListView, "CTR") _GUICtrlListView_AddColumn($cListView, "eCPM") _GUICtrlListView_AddColumn($cListView, "Earnings", 80) For $i = 0 To 3 GUICtrlCreateListViewItem($aData[$i], $cListView) Next GUISetState() Global $iCol While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $cListView $iCol = GUICtrlGetState($cListView) _GUICtrlListView_SimpleSort($cListView, $fSortSense, $iCol) EndSwitch WEnd1 point
-
Jacko23, You can do it like this: #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <GUIListView.au3> Global $aData[4] = ["2014-03-09|456|201|3|0.45%|$2.94|$0.7654", "2014-03-08|236|231|2|0.65%|$1.25|$1.4321", _ "2014-03-07|566|341|1|0.75%|$4.62|$0.4567", "2014-03-06|786|561|3|0.95%|$6.48|$0.8765"] Global $fSortSense = False ; Set initial ascending sort $hGUI = GUICreate("Test", 500, 500) $cListView = GUICtrlCreateListView("", 10, 10, 480, 400) _GUICtrlListView_AddColumn($cListView, "Date", 80) _GUICtrlListView_AddColumn($cListView, "Requests", 80) _GUICtrlListView_AddColumn($cListView, "Impressions", 80) _GUICtrlListView_AddColumn($cListView, "Clicks") _GUICtrlListView_AddColumn($cListView, "CTR") _GUICtrlListView_AddColumn($cListView, "eCPM") _GUICtrlListView_AddColumn($cListView, "Earnings", 80) For $i = 0 To 3 GUICtrlCreateListViewItem($aData[$i], $cListView) Next GUISetState() GUIRegisterMsg($WM_NOTIFY, "_WM_NOTIFY") While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Func _WM_NOTIFY($hWnd, $iMsg, $wParam, $lParam) #forceref $hWnd, $iMsg, $wParam $tNMHDR = DllStructCreate($tagNMHDR, $lParam) $iIDFrom = DllStructGetData($tNMHDR, "IDFrom") $iCode = DllStructGetData($tNMHDR, "Code") Switch $iIDFrom Case $cListView Switch $iCode Case $LVN_COLUMNCLICK ; A column was clicked $tInfo = DllStructCreate($tagNMLISTVIEW, $lParam) _GUICtrlListView_SimpleSort($cListView, $fSortSense, DllStructGetData($tInfo, "SubItem")) EndSwitch EndSwitch EndFunc M231 point