Jump to content

A simple fast IPC based on Windows Messaging


Recommended Posts

... I suppose by placing a #RequireAdmin on one of the scripts (?)

Edited by Chimp

 

image.jpeg.9f1a974c98e9f77d824b358729b089b0.jpeg Chimp

small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt....

Link to post
Share on other sites
  • 1 month later...

Added to the wiki :)

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (2019-12-03 - Version 1.5.1.0) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to post
Share on other sites
  • 1 year later...

I was hoping to use this UDF, but the example server and client don't communicate for me. I added some ConsoleWrites to the client and found it does one of 3 things:

* it will wait in the '_WCD_IsServerAvailable' loop forever waiting for the server to be available
* it will find the server repeatedly but receive no response
* the client will crash AutoIt with "AutoIt3.exe ended.rc:-1073740771" (it continues even after adding a global COM error handler)

I'm running on Windows 10 Enterprise 21H2 and both scripts are run without admin permissions. Do you know if it's possible that this feature could be blocked?

All my code provided is Public Domain... but it may not work. ;) Use it, change it, break it, whatever you want.

Spoiler

My Humble Contributions:
Personal Function Documentation - A personal HelpFile for your functions
Acro.au3 UDF - Automating Acrobat Pro
ToDo Finder - Find #ToDo: lines in your scripts
UI-SimpleWrappers UDF - Use UI Automation more Simply-er
KeePass UDF - Automate KeePass, a password manager

Link to post
Share on other sites

@seadoggie01  I am unable to reproduce your error.  Tested on Win10 home edition 21H1 with the example I provided.  I tested all scenarios with and without #RequireAdmin, no issue.  Could you describe exactly what you are doing ?

22 minutes ago, seadoggie01 said:

Do you know if it's possible that this feature could be blocked?

I don't understand your question.

Link to post
Share on other sites

I slightly modified the WaitForResponse function to add some ConsoleWrite statements and added a global error handler at the top of the script

Global $oErrFunc = ObjEvent("AutoIt.Error", "ErrFunc")

; [...]

Func WaitForResponse ()
  Local $sResp
  ConsoleWrite("Waiting for server" & @CRLF)
  While _WCD_IsServerAvailable ()
    ConsoleWrite("Server is available!" & @CRLF)
    $sResp = _WCD_Client_GetResponse ()
    If $sResp <> "" Then Return $sResp
    Sleep (100)
  WEnd
EndFunc

Func ErrFunc($oError)
    MsgBox($MB_OK, "We intercepted a COM Error !", _
            "Number: 0x" & Hex($oError.number, 8) & @CRLF & _
            "Description: " & $oError.windescription & _
            "At line: " & $oError.scriptline)
EndFunc   ;==>ErrFunc

Then I run the server file from the command line and started the client from SciTE.

By "Do you know if this feature could be blocked?" I mean, I'm in a heavily locked down work environment and was wondering if it's possible that this form of communication could be blocked by some program/policy/etc by IT for security concerns.

All my code provided is Public Domain... but it may not work. ;) Use it, change it, break it, whatever you want.

Spoiler

My Humble Contributions:
Personal Function Documentation - A personal HelpFile for your functions
Acro.au3 UDF - Automating Acrobat Pro
ToDo Finder - Find #ToDo: lines in your scripts
UI-SimpleWrappers UDF - Use UI Automation more Simply-er
KeePass UDF - Automate KeePass, a password manager

Link to post
Share on other sites

The COM handler is useless since the UDF is solely based on Windows Messaging System.  I do not use any COM object in my code.  Nothing is mentioned in MSDN about blocking this message, but I am not an expert about security, so in other words, I don't know.  However, I am sure that your security guys can answer this question.  One thing you could try is to put both client and server in verbose mode :

$_WCD_Verbose = True

Log is in WCD_Logfile.log.  Before starting delete this file if it already exists.

Link to post
Share on other sites

Sorry for the delay, another project came up at work. With that added line, both scripts ran and I got the same results. I'll try testing this at home to see if I can reproduce or if it's related to my work environment. Hopefully I'll update this soon! :) Thanks for the help either way!

Edit: Finally tested at home and it works fine. It seems it's related to my work environment, darn, another great script I can't use 😐

Edited by seadoggie01

All my code provided is Public Domain... but it may not work. ;) Use it, change it, break it, whatever you want.

Spoiler

My Humble Contributions:
Personal Function Documentation - A personal HelpFile for your functions
Acro.au3 UDF - Automating Acrobat Pro
ToDo Finder - Find #ToDo: lines in your scripts
UI-SimpleWrappers UDF - Use UI Automation more Simply-er
KeePass UDF - Automate KeePass, a password manager

Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...