Leaderboard
Popular Content
Showing content with the highest reputation on 01/28/2019 in all areas
-
Trying to using 10Tec iGrid OCX
mLipok reacted to supersonic for a topic
Hi - I need faster listviews. I googled a bit and found 10Tec's iGrid OCX on the web: https://10tec.com/activex-grid/ . It's a commercial prodcut and more intended for VB rather than working togehter with AutoIt. Loading the OCX works fine: #include <GUIConstantsEx.au3> Local $oTmp = ObjCreate("iGrid700_10Tec.iGrid") If (Not @error) Then Local Const $hWnd = GUICreate("TEST", 500, 500) If (Not @error) Then Local $iObj = GUICtrlCreateObj($oTmp, 10, 10, 480, 400) With $oTmp .BeginUpdate ; .DefaultRowHeight = 40 ; .ColCount = 50 .AddCol(0, "Column1", 50) .AddCol(1, "Column2", 100) .AddCol(2, "Column3", 150) .RowCount = 100 For $iRow = 1 To .RowCount .CellValue($iRow, 1) = "Test1" .CellValue($iRow, 2) = "Test2" .CellValue($iRow, 3) = "Test3" Next .SetCurCell(1, 1) .EndUpdate EndWith GUISetState(@SW_SHOW, $hWnd) Local $aMsg = 0 While 1 $aMsg = GUIGetMsg(1) Switch $aMsg[1] Case $hWnd Switch $aMsg[0] Case $GUI_EVENT_CLOSE ExitLoop (1) EndSwitch EndSwitch WEnd GUIDelete($hWnd) EndIf $oTmp = 0 EndIf I am not very familiar with the propper syntax this OCX is needing. E. g. I don't get ".AddCol" to work. I am sure I missed something. From the iGrid help file: Sub AddRow( _ Optional ByVal sKey As String, _ Optional ByVal vRowBefore As Variant, _ Optional ByVal bVisible As Boolean = True, _ Optional ByVal lHeight As Long = -1, _ Optional ByVal lNormalCellHeight As Long = -1, _ Optional ByVal bGroupRow As Boolean = False, _ Optional ByVal vRowParent As Variant, _ Optional ByVal bExpanded As Boolean = True, _ Optional ByVal btLevel As Byte = 0, _ Optional ByVal eTreeButton As ERowTreeButton = igRowTreeButtonAbsent, _ Optional ByVal bVisibleAsChild As Boolean = True, _ Optional ByVal vTag As Variant, _ Optional ByVal lCount As Long = 1 _ ) The installation package https://10tec.com/FS/Demos/iGrid/iGrid.ActiveX.7.0.Demo.Setup.exe provides several demo scripts, here's an abstract regarding .AddCol and .CellValue: With iGrid1 .BeginUpdate .Editable = False .DynamicContentEvents = igDCEventCellDynamicText Or _ igDCEventCellDynamicFormatting Or igDCEventRowDynamicFormatting ' Set grid font and special fonts to highlight cells .Font.Name = "Verdana" Set m_fntBold = .FontClone(sName:="Arial", bBold:=True, cSize:=9) Set m_fntItalic = .FontClone(bItalic:=True) ' Set the optimal row height taking into account all grid settings ' (font, focus rectnagle, etc) and the OS DPI scale factor lNormalRowsHeight = .GetOptimalCellHeight() lBoldRowsHeight = .GetOptimalCellHeight(oFont:=m_fntBold) .DefaultRowHeight = gflMaxLong(lNormalRowsHeight, lBoldRowsHeight) .AddCol sKey:="comp", sHeader:="Company Name", lWidth:=130 .AddCol sKey:="cntryID", sHeader:="Country", lWidth:=100 .AddCol(sKey:="sales", sHeader:="Total Sales", lWidth:=100).eAlignH = igAlignHRight .RowCount = 10000 Randomize 11 For iRow = 1 To .RowCount .CellValue(iRow, 1) = "Company #" & Format$(iRow, "00000") .CellValue(iRow, 2) = Int(Rnd * 5) + 1 ' we store the IDs .CellValue(iRow, 3) = CLng(Rnd * 1000) * 1000 Next .EndUpdate End With Is there anyone how can help me out to get this OCX working?1 point -
play a resource song while installing, takes a lot of place and will guaranty client satisfaction and calm !1 point
-
Had an almost similar issue, but in my case it was packaging. I used the mini-CD to distribute my program, and for precisely that reason had to switch back to standard size CD even thought I used about 1% of it.1 point
-
then follow the example of the big boys (Symantec has always been my role-model for this kind of bureaucracy stuff): - add a huge high quality logo to your GUI - throw in a 30-page license agreement - add 10 more confirmation steps to your setup program - use an elaborate yet meaningless version numbers (like 27.4.63.1183), so you can validate it with your clients when they seek support - oh, and my all-time favorite: add a progress bar when installing your files, with artificial delays in it (after all your files have been copied within a tenth of a second, of course) yes, some of it was sarcasm. no, not all of it... b.t.w i assume that this: means that the topic is legitimate1 point
-
Skeletor, Then go ahead and stuff the executable with resources! Make sure the forum gets a cut if you do sell it! M231 point
-
fileinstall comments variables1 point
-
Toy RSA Encryption Example - Simple concepts for learning Public Key Encryption
argumentum reacted to Beege for a topic
I found this article and enjoyed it so much I had play with some code since the numbers are small enough. https://thatsmaths.com/2016/08/11/a-toy-example-of-rsa-encryption/ Standard Encryption's vs RSA Encryption (Public Key Encryption) Fundamental Differences If you read that and couldn't immediately clarify the difference then let me blow your mind because its simple: STANDARD ENCRYPTION'S: ORIGINAL_DATA + Password(or KEY) = Encrypted DATA Then to decrypt -> Encrypted DATA + (SAME Password(or SAME KEY)) = ORIGINAL_DATA RSA: ORIGINAL_DATA + Password(or PUBLIC_KEY) = Encrypted DATA Then to decrypt -> Encrypted DATA + (DIFFERENT Password(or PRIVATE_KEY)) = ORIGINAL_DATA Are we all caught up? Did the colors help? I think they did That's crazy right? Don't answer. It is. And crazier its used EVERY TIME we make a secure connection to a server over the internet. But here's the craziest part to me that I recently got clarity on from the toy example and that is the simplicity of this very very very very important algorithm that has yet to be cracked (fingers crossed): Mod($vData ^ $key, $n) So ya. That's it. That's the magic algorithm. 3 values. Oh and $n is also a shared known value that will be in the certificate with the public key that your browser reads when it makes a connection: That's just mind blowing to me so couldn't resist getting something going in AUT. After playing with this code, I got a much better understanding of how its not just that algorithm that makes this whole thing possible. The numbers that we pick to form the public key and n are just as important and also how important it is to be random! Let me know if you have any problems. Enjoy! #include <array.au3> _Toy_RSA_Example() ;https://thatsmaths.com/2016/08/11/a-toy-example-of-rsa-encryption/ Func _Toy_RSA_Example() Local $p, $q, $n, $nT, $e, $d Local $aPublicKeys, $aCrypt, $sDecrypt, $sMsg ;Pick two random primes (they will be between 1000-10000) $p = _GetRandomPrime() $q = _GetRandomPrime() $sMsg = 'p= %i \t\t| Prime 1 - [NOT SHARED!]\nq= %i \t\t| Prime 2 - [NOT SHARED!]\n' ;Calculate lowest common multiple $nT = _LCM($p - 1, $q - 1) $sMsg &= 'nT= %i \t| _LCM(p - 1,q - 1) - [NOT SHARED!]\n' ;Calculate n. This is a shared number $n = $p * $q $sMsg &= 'n= %i \t| p * q - [Shared]\n' ;Get a small random list of possible public keys to pick from. Only searching for 100ms $aPublicKeys = _GetPublicKeys($nT) _ArrayDisplay($aPublicKeys, "Possible Public Keys Found") ;Pick a random public (encryption) key from array $e = $aPublicKeys[Random(1, $aPublicKeys[0], 1)] $sMsg &= 'e= %i \t| Public (Encryption) Key - [Shared]\n' ;Generate our private (decryption) key $d = _GetPrivateKey($e, $nT) $sMsg &= 'd= %i \t| Private (Decryption) Key - [NOT SHARED!]\n' ;format our msg (rsa details) to encrypt $sMsg = StringFormat($sMsg, $p, $q, $nT, $n, $e, $d) ;encrypt message $aCrypt = _RSA($sMsg, $e, $n) _ArrayDisplay($aCrypt, 'Encrypted RSA messsage') ;Decrypt array back $sDecrypt = _RSA($aCrypt, $d, $n) MsgBox(0, 'Decrypted RSA messsage', $sDecrypt) EndFunc ;==>_Toy_RSA_Example ;Function will perfrom Mod($v ^ $key, $n) on each char/element. ;Excepts Arrays or Strings. If input is array a string is returned and vice versa. Func _RSA($vDat, $key, $n) Local $bIsStr = IsString($vDat) If $bIsStr Then $vDat = StringToASCIIArray($vDat) For $i = 0 To UBound($vDat) - 1 $vDat[$i] = _Modular($vDat[$i], $key, $n) Next Return $bIsStr ? $vDat : StringFromASCIIArray($vDat) EndFunc ;==>_RSA ;algorithm is from the book "Discrete Mathematics and Its Applications 5th Edition" by Kenneth H. Rosen. Func _Modular($iBase, $iExp, $iMod) ; Mod($v ^ $key, $n) Local $iPower = Mod($iBase, $iMod) Local $x = 1 For $i = 0 To (4 * 8) - 1 If BitAND(0x00000001, BitShift($iExp, $i)) Then $x = Mod(($x * $iPower), $iMod) EndIf $iPower = Mod(($iPower * $iPower), $iMod) Next Return $x EndFunc ;==>_Modular ;Generate a "random" list of possible valid public keys to choose from based on $nT Func _GetPublicKeys($nT, $iMs = 100) Do Local $aKeys[10000] = [0], $iTime = TimerInit() Local $i = (Mod(@SEC, 2) ? Int($nT / 2) : Int($nT / 4)) ; randomize where we start Do If _IsPrime($i) And _IsCoPrime($i, $nT) Then $aKeys[0] += 1 $aKeys[$aKeys[0]] = $i EndIf $i += (Mod(@MSEC, 2) ? 1 : 100) ; randomize step size Until ($i >= ($nT - 1)) Or (TimerDiff($iTime) > $iMs) ReDim $aKeys[$aKeys[0] + 1] Until $aKeys[0] > 5 ; Ive seen 200+ returned sometimes and 0 on others. Make sure we have at least a few choices Return $aKeys EndFunc ;==>_GetPublicKeys ;https://www.geeksforgeeks.org/multiplicative-inverse-under-modulo-m/ - _ModInverse(a,m) Func _GetPrivateKey($a, $m) If ($m = 1) Then Return 0 ; Local $t, $q, $y = 0, $x = 1, $m0 = $m While ($a > 1) $q = Int($a / $m) ;q is quotient $t = $m ; $m = Mod($a, $m) ;m is remainder now, process same as Euclid's algo $a = $t ; $t = $y ; $y = $x - $q * $y ;Update y and x $x = $t ; WEnd Return $x < 0 ? $x + $m0 : $x EndFunc ;==>_GetPrivateKey ;Pick the next nearest prime from a random number (or number you cho0se) Func _GetRandomPrime($iStart = Default) Local $iPrime = ($iStart = Default ? Random(1000, 10000, 1) : $iStart) Do $iPrime += 1 Until _IsPrime($iPrime) Return $iPrime EndFunc ;==>_GetRandomPrime #Region Math Functions Func _IsPrime($n) For $i = 2 To (Int($n ^ 0.5) + 1) If Mod($n, $i) = 0 Then Return False Next Return True EndFunc ;==>_IsPrime Func _IsCoPrime($a, $b) Return _GCD($a, $b) = 1 EndFunc ;==>_IsCoPrime Func _GCD($iX, $iY) Local $iM While 1 $iM = Mod($iX, $iY) If $iM = 0 Then Return $iY $iX = $iY $iY = $iM WEnd EndFunc ;==>_GCD Func _LCM($iX, $iY) Return ($iX * $iY) / _GCD($iX, $iY) EndFunc ;==>_LCM #EndRegion Math Functions You should get a message box displaying the decrypted message with details of the values used: rsa.au31 point -
[Solved] Custom context menus for edit controls
Subz reacted to pixelsearch for a topic
Hi qwert, The solution we talked about : #include <GUIConstantsEx.au3> $hGUI = GUICreate("GUI Context Menu Test", 300, 200) $edit = GUICtrlCreateEdit("Test", 20, 20, 260, 120) $button = GUICtrlCreateButton("OK", 120, 170, 70, 20) $buttoncontext = GUICtrlCreateContextMenu($button) GUICtrlCreateMenuItem("About button", $buttoncontext) $label = GUICtrlCreateLabel("", 1, 1, 1, 1) $contextmenu = GUICtrlCreateContextMenu($label) $case_0 = GUICtrlCreateMenuItem("Case 0", $contextmenu) $case_1 = GUICtrlCreateMenuItem("Case 1", $contextmenu) $hcontextmenu = GUICtrlGetHandle($contextmenu) GUISetState() While 1 $aInfo = GUIGetCursorInfo() If not @error And $aInfo[3] = 1 And $aInfo[4] = $edit Then $mPos = MouseGetPos() DllCall("user32.dll", "int", "TrackPopupMenuEx", "hwnd", $hcontextmenu, _ "int", 0, "int", $mPos[0], "int", $mPos[1], "hwnd", $hGUI, "ptr", 0) EndIf $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $button MsgBox(0, "Button", "The button was clicked.") Case $case_0 MsgBox(0, "Case 0", "This is Case 0") Case $case_1 MsgBox(0, "Case 1", "This is Case 1") EndSwitch WEnd Good luck1 point -
Here a simple way that will work ALL the time, but you wont like it tho. : #include <Constants.au3> #include <Array.au3> Opt ("MustDeclareVars", 1) Global Const $FF = '7.1,00000776KN,320639,US,1/5/2019,XXXXXXXXXX,E,,,USD,26694.26,12/20/2018,,XXXXXXXXXXXXX,,4410628,82576404,F/C,1,0,XXXXXXXXXXXXXXXXXX,XXXXXXXX,XXXXXXXXX,,,,0.9,L,1,L,PKG,,,4,SHP,FC,,,,,,,,FRT,3,XXXXXXXX XXXXXX XXXXX,1,,0,,USD,1.29,7.3,,0,0,,0,0,0,0,0,1/16/2019,,,,XXXXXX XXXXXXXXX,"Hu-Frie Mfg. Co., LLC",7 E TOUCHY AVE,,Des Plaines,IL,60018,US,.,"SAPPS,DAVID T., DDS, PC",SAPPS ORTHODONTICS,189 STEWART LANE,JONESBORO,TN,28199,US,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,0,,,,0,,,,,0,,0,0,,,0,,,,,,,,,,,,0,,,,,,,0,0,0,0,0,0,,,0,0,0,,,,,,2,,,,,,0,0,0,0,0,0,0,,,,,0,,,0,,0,,,,,,,,,,,,,,,,,,,,,0,,,,,,,,,,,,,,,,,,,,,,,,,,,XXXXXXXXXXXXXXX' Global Const $rep = " | " Global $arr = StringSplit ($FF,""), $Start = False, $Final = "" For $i = 1 to $arr[0] if $arr[$i] = '"' Then $Start = not $Start if $arr[$i] = ',' and $Start then $arr[$i] = $rep $Final &= $arr[$i] Next Local $test = _ArrayToString ($arr, "", 1) MsgBox ($MB_SYSTEMMODAL,"",$test = $Final) Edit :1 point
-
AutoIt 3.3.10.0 without default icon, and pragma features
FrancescoDiMuro reacted to Jos for a topic
#PRAGMA directives are processed by AUT2EXE and AutoItWrapper directives are processed by ...mmm... AutoIt3Wrapper. The overlap is anything the deals with the PE header and othe AUT2EXE options and AutpIt3Wrapper also has a bunch of other Directive for Tidy;Au3Stripper; Au3Check; SVN etc. Jos1 point -
Forum Rules
edenwheeler reacted to Jon for a topic
We want the forum to be a pleasant place for everyone to discuss AutoIt scripting, and we also want to protect the reputation of AutoIt. So we ask you to respect these simple rules while you are here: Forum Posting 1. Do not ask for help with AutoIt scripts, post links to, or start discussion topics on the following subjects: Malware of any form - trojan, virus, keylogger, spam tool, "joke/spoof" script, etc. Bypassing of security measures - log-in and security dialogs, CAPTCHAs, anti-bot agents, software activation, etc. Automation of software/sites contrary to their EULA (see Reporting bullet below). Launching, automation or script interaction with games or game servers, regardless of the game. Running or injecting any code (in any form) intended to alter the original functionality of another process. Decompilation of AutoIt scripts or details of decompiler software. This list is non-exhaustive - the Moderating team reserve the right to close any thread that they feel is contrary to the ethos of the forum. 2. Do not post material that could be considered pornographic, violent or explicit - or express personal opinions that would not be acceptable in a civilized society. Do not post any copyrighted material unless the copyright is owned by you or by this site. 3. To protect this community, any files posted by you are subject to checks to ensure that they do not contain malware. This includes, but is not limited to, decompilation and reverse engineering. 4. Do not flame or insult other members - and just report the thread to a Moderator (see below) if you are so attacked. 5. Do not PM other users asking for support - that is why the forum exists, so post there instead. 6. Do not create multiple accounts - if you inadvertently created multiple accounts then contact a Moderator to close the unwanted ones. 7. Do not repost the same question if the previous thread has been locked - particularly if you merely reword the question to get around one of the prohibitions listed above. 8. Do not delete your posts, nor completely remove their content, if doing so will interrupt the flow of the thread. 9. Do not post in a thread while the Moderating team are actively trying to determine whether it is legal. The Moderation team will do their best to act in fair and reasonable manner. Sanctions will only be applied as a last resort and any action taken will be explained in the relevant thread. If moderation action is taken, you will need to acknowledge this through a dialog or you will be unable to post further in the forum. Please note that this dialog is not an agreement that the warning was justified - it is only there so that members are aware that moderation action has been taken and that they may have certain restrictions applied to their account. If you feel that you have been unfairly moderated then contact the Moderator concerned - using a PM or the "Report" button is preferable to opening a new thread (although new members may have to do this). But do be aware that the Moderation team has the final word - the rules are set out by the site owner and you are only welcome here if you respect his wishes. Signatures and Avatars There is no formal policy for the use of signatures but if a moderator thinks it is too big and/or distracting then you may be asked to tone it down. No-one likes wading through signatures that are a page high. Similarly for avatars, expect distracting flashing and animated gifs to be removed. Reporting If you feel a post needs Moderator attention, please use the "Report" button next to the post date at the top. You can then enter details of why you have reported the post - but there is no need to include the content of the post as that is done automatically. The Moderating team will be alerted to the post and will deal with it as soon as they can. If you suspect a EULA violation, do not expect the Moderating team to do all the work - please provide some evidence in the report such as a copy of (or link to) the EULA in question, as well as the section you believe has been violated. Finally, please do not enter into an argument with the original poster - that is why we have Moderators. Spam Please do not react to spam in any way other than reporting it. Multiple reports are combined by the forum software, so there is no need to announce that you have reported the spam - in fact doing so only increases the work for the Moderator who deals with it. Interacting with this website Anyone found abusing the website is subject to harsh punishment without warning. A non-exhaustive list of potential abuses include: Automated forum registration or login. Automated posting or sending messages on the forum. Automated manipulation of polls, user reputation or other forum features. Automated creation or comments on issue tracker tickets. Automated creation or editing of wiki pages. Other abuses which are either examples of excessive bandwidth usage or automation of the site. Use common sense. If you do not have common sense, don't do anything. Do not automate the forum, wiki or issue tracker in any way at all. Scripts which automatically update AutoIt such as AutoUpdateIt are acceptable as long as they are not abused and do not generate excessive bandwidth usage.0 points