Jump to content

Search the Community

Showing results for tags 'struct'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • General
    • Announcements and Site News
    • Administration
  • AutoIt v3
    • AutoIt Help and Support
    • AutoIt Technical Discussion
    • AutoIt Example Scripts
  • Scripting and Development
    • Developer General Discussion
    • Language Specific Discussion
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Categories

  • AutoIt Team
    • Beta
    • MVP
  • AutoIt
    • Automation
    • Databases and web connections
    • Data compression
    • Encryption and hash
    • Games
    • GUI Additions
    • Hardware
    • Information gathering
    • Internet protocol suite
    • Maths
    • Media
    • PDF
    • Security
    • Social Media and other Website API
    • Windows
  • Scripting and Development
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Member Title


Location


WWW


Interests

Found 6 results

  1. ..where to start. I've posted: now I wanna pull the data from WTSSessionInfo and WTSSessionInfoEx as described in https://docs.microsoft.com/en-us/windows/win32/api/wtsapi32/ns-wtsapi32-wtsinfoa typedef struct _WTSINFOA { WTS_CONNECTSTATE_CLASS State; <--- that is an enumeration from https://docs.microsoft.com/en-us/windows/win32/api/wtsapi32/ne-wtsapi32-wts_connectstate_class DWORD SessionId; DWORD IncomingBytes; DWORD OutgoingBytes; DWORD IncomingFrames; DWORD OutgoingFrames; DWORD IncomingCompressedBytes; DWORD OutgoingCompressedBy; CHAR WinStationName[WINSTATIONNAME_LENGTH]; CHAR Domain[DOMAIN_LENGTH]; CHAR UserName[USERNAME_LENGTH + 1]; LARGE_INTEGER ConnectTime; LARGE_INTEGER DisconnectTime; LARGE_INTEGER LastInputTime; LARGE_INTEGER LogonTime; LARGE_INTEGER CurrentTime; } WTSINFOA, *PWTSINFOA; from the example in ListUserSessions() I get, say: 24 WTSSessionInfo _________ 0x00000000070000000D930F00229CDD00000000000000000000000000000000005244502D5463702331313700000000000000000000000000000000000000000050433032370000000000000000000000006C756973790000000000000000000000000000000000002174A0FB1B0AD70100000000000000000625AF0A200AD701AF99E5FB1B0AD701A56FBA0A200AD701 25 WTSSessionInfoEx _______ 0x01000000000000000700000000000000010000005244502D54637023313137000000000000000000000000000000000000000000006C756973790000000000000000000000000000000050433032370000000000000000000000000000000000AF99E5FB1B0AD7012174A0FB1B0AD70100000000000000000625AF0A200AD701BBBDBA0A200AD7010D930F00229CDD0000000000000000000000000000000000 My question is: how do I get the binary example above ( WTSSessionInfo ) into a struct to DllStructGetData(). Thanks Solution at https://www.autoitscript.com/forum/topic/205232-struct-_wtsinfo/?do=findComment&comment=1475912
  2. Struggling a bit to get this GDI+ function converted to AutoIt. #include <GDIPlus.au3> _GDIPlus_Startup() Global $hImage = _GDIPlus_ImageLoadFromFile("F:\DCIM\Camera\20170515_111804.jpg") Global $tBufferSize = DllStructCreate("uint") Global $tProperties = DllStructCreate("uint") _GDIPlus_GetPropertySize($hImage, $tBufferSize, $tProperties) Global $tAllItems = DllStructCreate("struct;char[" & DllStructGetData($tBufferSize, 1) & "];endstruct") _GDIPlus_GetAllPropertyItems($hImage, $tBufferSize, $tProperties, $tPropertyItem) _GDIPlus_ImageDispose($hImage) _GDIPlus_Shutdown() Func _GDIPlus_GetAllPropertyItems(ByRef $hImage, Const $tTotalBufferSize, Const $tNumProperties, ByRef $tAllItems) If (Not IsDllStruct($tPropertyItem)) Then Return SetError(-1, 0, "") Local $aResult = DllCall($__g_hGDIPDll, "int", "GdipGetAllPropertyItems", "hwnd", $hImage, "unit", DllStructGetData($tTotalBufferSize, 1), "uint", DllStructGetData($tNumProperties, 1), "ptr", DllStructGetPtr($tAllItems)) If (@error) Then Return SetError(@error, @extended, ConsoleWrite("@Error = " & @error & @LF)) If ($aResult[0]) Then Return SetError($aResult[0], @extended, "") Return $aResult[0] EndFunc ;==>_GDIPlus_GetAllPropertyItems Func _GDIPlus_GetPropertySize(Const ByRef $hImage, ByRef $tTotalBufferSize, ByRef $tNumProperties) If (Not IsDllStruct($tTotalBufferSize)) Then Return SetError(-1, 0, "") If (Not IsDllStruct($tNumProperties)) Then Return SetError(-2, 0, "") Local $aResult = DllCall($__g_hGDIPDll, "uint", "GdipGetPropertySize", "hwnd", $hImage, "uint_ptr", DllStructGetPtr($tTotalBufferSize), "uint_ptr", DllStructGetPtr($tNumProperties)) If (@error) Then Return SetError(@error, @extended, "") If ($aResult[0]) Then Return SetError($aResult[0], 0, "") Return $aResult[0] EndFunc ;==>_GDIPlus_GetPropertySize Got the GetPropertySize function to work, gives me the correct buffer size and the property count, but I cannot figure out how to get the struct for the all items. Function on MSDN: https://msdn.microsoft.com/en-us/library/windows/desktop/ms535372(v=vs.85).aspx Struct needed: PropertyItem class: https://msdn.microsoft.com/en-us/library/windows/desktop/ms534493(v=vs.85).aspx Found other topics about this function in other languages where they used a blank string as the buffer, so I tried using a char array, which doesn't work. Just cannot figure out how to create the struct buffer to hold the data.
  3. I can not program. What I am trying to do is make a little AutoIt Desktop SMS sender that uses BulkSMS upstream. BulkSMS provides services in the UK, USA, Europe and South Africa. BulkSMS provides several options (a) create string and plug it into browser and send via HTTP, ugly but it works; (b) a DLL called smstxt32.dll which supports a few functions to do this in a typical Windows Desktop application. They provide examples in C, PHP, Python etc. I do not understand any of those. I attach several files. The BulkSMS home page is located here: www.BulkSMS.com You can create a free account which allows five free credits to experiment with. So you can try to send the SMSes for free initially. The file "BulkSMS Win32 API ver 1006a.zip" contains a .doc help file and the smstxt32.dll file. BulkSMS Win32 API ver 1006a.zip The file BulkSMS.au3 is my attempt. BulkSMS.au3 My BulkSMS.au3 attempts to create the required structs for use with the DLL. I think I do manage, but do not understand anything about pointers. Then I attempt to actually send the SMS using the following DLLCALL Local $res = DllCall($__g_hDll_BulkSMS, _ ; name of DLL "BOOL", _ ; return type "SMSAPI_sendsms", _ ; function "LONG", _ ; type1 $gSMSAPI_NETWORKCONFIGURATION, _ ; param1 "LONG", _ ; type2 $gSMSAPI_ACCOUNTINFO, _ ; param2 "LONG", _ ; type3 $gSMSAPI_MESSAGEINFO, _ ; param3 "LONG", _ ; type4 $gSMSAPI_RESPONSEINFO _ ; param4 )This is based on the following example from the included help file, bool SMSAPI_sendsms( const LPSMSAPI_NETWORKCONFIGURATION lpNetConfig, const LPSMSAPI_ACCOUNTINFO lpAccInfo, const LPSMSAPI_MESSAGEINFO lpMsgInfo, LPSMSAPI_RESPONSEINFO lpResponseInfo);According to the AutoIt Helpfile, there are conversions to comparable data types. However, I do not see a "const" so I do not know what do with that. Also, the C example shows the use of "long pointers." What would this be in AutoIt? Thank you Skysnake BulkSMS Win32 API ver 1006a.zip BulkSMS.au3
  4. bool SMSAPI_sendsms( const LPSMSAPI_NETWORKCONFIGURATION lpNetConfig, const LPSMSAPI_ACCOUNTINFO lpAccInfo, const LPSMSAPI_MESSAGEINFO lpMsgInfo, LPSMSAPI_RESPONSEINFO lpResponseInfo); How does one call this in an AutoIt DllCall() - I do not see "const" conversions and how does one insert the pointers?
  5. Hello, I am trying to write very basic script to use COM object. It is a specific object allowed to communication with software on the industrial controller. I can create reference to a COM object by function ObjCreate. Thanks to ObjectName function I can read all information about object. Problem is that, I can trigger (only) one method of this object, named Disconnect(). When I want to use the other method instead of Disconnect(), for example, ReadValueN I have problem with arguments for this method. I tryed many variants, combinations, without positive result. My error monitoring function (for COM errors) reports: "Bad variable types" or "Type mismath". I studied many examples, many documentations but I have no idea how it should be. Below is description for method, data etc based on OLE/ COM Object Viewer. long ReadValueN( [in] long TARGET_id, [in] PARAM_DEF* pParamDef, [out] BUFFER* pResBuffer);typedef struct tagPARAM_DEF{ unsigned char Param1; unsigned char Param2; unsigned char Param3; unsigned char ParamT[8]; short Number; unsigned char ValueF; unsigned char ValueD; } PARAM_DEF; typedef struct tagBUFFER{ unsigned char BuffA1; unsigned char BuffA2; unsigned char BuffA3; unsigned char BuffTable[256]; } BUFFER;$structParamDef = DllStructCreate("byte; byte; byte; byte[8]; short; byte; byte") $structBuffer = DllStructCreate("byte; byte; byte; byte[256]") $response = $myObject.ReadValueN(0, DllStructGetPtr($structParamDef), DllStructGetPtr($structBuffer)) ;$response = $myObject.Disconnect() ; is workingCould someone write me what is wrong and how it should be? And especially - why? thanks in advanced
  6. I'm trying to understand following code which I want to convert to Autoit: RedEyeCorrection VOID Example_RedEyeSetParameters(HDC hdc) { Graphics graphics(hdc); Image myImage(L"RedEyePhoto.jpg"); REAL srcWidth = (REAL)myImage.GetWidth(); REAL srcHeight = (REAL)myImage.GetHeight(); RectF srcRect(0.0f, 0.0f, srcWidth, srcHeight); Matrix myMatrix(1.0f, 0.0f, 0.0f, 1.0f, 300.0f, 20.0f); RECT redAreas[2] = {40, 10, 55, 30, 110, 20, 125, 40}; RedEyeCorrectionParams myRedEyeCorParams; myRedEyeCorParams.numberOfAreas = 2; myRedEyeCorParams.areas = redAreas; RedEyeCorrection myRedEyeCor; myRedEyeCor.SetParameters(&myRedEyeCorParams); // Draw the image with no change. graphics.DrawImage(&myImage, 20.0, 20.0, srcWidth, srcHeight); // Draw the image with the red eye correction. graphics.DrawImage(&myImage, &srcRect, &myMatrix, &myRedEyeCor, NULL, UnitPixel); } I made something like this here Global $tRECT1 = DllStructCreate("long left;long top;long right;long buttom") DllStructSetData($tRECT1, "left", 55) DllStructSetData($tRECT1, "top", 69) DllStructSetData($tRECT1, "right", 68) DllStructSetData($tRECT1, "buttom", 81) Global $pRECT1 = DllStructGetPtr($tRECT1) Global $tRECT2 = DllStructCreate("long left;long top;long right;long buttom") DllStructSetData($tRECT2, "left", 159) DllStructSetData($tRECT2, "top", 68) DllStructSetData($tRECT2, "right", 172) DllStructSetData($tRECT2, "buttom", 81) Global $pRECT2 = DllStructGetPtr($tRECT2) Global Const $tagREDEYECORRECTIONPARAMS = "uint numberOfAreas;int areas[2]" Global $tRedEye = DllStructCreate($tagREDEYECORRECTIONPARAMS) Global Const $pRedEye = DllStructGetPtr($tRedEye) DllStructSetData($tRedEye, "numberOfAreas", 2) DllStructSetData($tRedEye, "areas", $tRECT1, 1) DllStructSetData($tRedEye, "areas", $tRECT2, 2) $hEffect = _GDIPlus_EffectCreate($GDIP_REDEYECORRECTIONEFFECT) ConsoleWrite(_GDIPlus_EffectsSetParameters($hEffect, $pRedEye) & " / " & @error & @LF) but it is not working - return code 8, error code 2. I'm an absolute C++ noob and I hope somebody can help here. Br, UEZ
×
×
  • Create New...