Jump to content

MilesAhead

Active Members
  • Posts

    698
  • Joined

  • Last visited

Profile Information

  • Member Title
    Eclectician

Recent Profile Visitors

569 profile views

MilesAhead's Achievements

  1. Here's a silly one. Global $condition = (True) ? SomeFunc(True) : False Func SomeFunc($val) MsgBox(0, "Terniary Test", "$condition is: " & $val) Return $val EndFunc ;==>SomeFunc
  2. I agree with jchd about trying to run programs to handle the virus on a diseased machine. If anything at least make a bootable USB on a clean machine to scan your system after booting the flash drive. On a clean PC you can download Avast Trial version and make a bootable flash drive with the current av database. Boot your infected PC from the flash drive and run the scan. I assume source code backups were made when the PC was still clean?
  3. Right. With Inno the "macro scripting" to do things the built in functions cannot is a subset of Pascal. If you know Turbo Pascal or Delphi you will feel right at home writing your own functions/procedures. Afa as AV scanners I think you are better off just to include a disclaimer that there are bound to be false positives. As the number of scanners increase the likelihood of false positives rises. So you can find yourself wasting time exponentially if you try to rework your code so as not to trigger a scanner. After all, there are more scanners being published every day. How can you pass tests you do not know even exist? It gets to absurdity at some point.
  4. +1. I used Inno quite a bit a few years back. It is especially nice if you already know Pascal as it uses that for scripting. There is even a nice free styling tool for adding a bit of glitz to the install dialogs. At least there was. The Dll for it only added about 1/4 MB to the installer size if I remember rightly. I got away from installers when everyone demanded stuff be "portable." Tough to go far wrong with Inno though.
  5. It does on my laptop. Likely the number to use in the modulus function is dependent on the speed of the machine. A tooltip may work better than a msgbox though.
  6. I am not totally sure what you want the result to be but the changes I made reduced the number of label updates. Local $Timer = TimerInit() Local $Delay = 30 Local $TimeS = $Delay - Int((TimerDiff($Timer)) / 1000) Local $While = 1 $hGUI = GUICreate("Attendo...", 400, 100) GUISetState(@SW_SHOW, $hGUI) Local $Abort = GUICtrlCreateButton("ABORT", 170, 60) GUISetIcon("shell32.dll", 51) Local $Label = GUICtrlCreateLabel("Attendo " & $TimeS & " secondi" & @CRLF & "premere ABORT se si vuole interrompere", 110, 20) While $While = 1 Switch GUIGetMsg() Case $Abort Exit EndSwitch If Not Mod($TimeS, 2) Then GUICtrlSetData($Label, "Attendo " & $TimeS & " secondi" & @CRLF & "premere ABORT se si vuole interrompere") $TimeS = $Delay - Int((TimerDiff($Timer)) / 1000) EndIf WEnd
  7. I would start by looking in the help at the _Singleton function. I don't know what the "merge" program does in the page you referenced. But most single instance programs designed to be run from context menu in Explorer detect if there is already a primary instance running, and if so, transfers the command tail to it, then quits. So for example if you launch EditPad7 Lite by right clicking 20 text files in Explorer, if the single instance option is checked in preferences, you should only get one copy of the Editor with 20 tabs open and a txt file in each tab. If _Singleton is not fast enough you may have to do the CreateMutex calls yourself "by hand" as it is shown in the C++ Program you referenced. Basically the scheme is that every instance tries to create the mutex. The one that succeeds is the "primary" instance. All the ones that fail to create the mutex send the command tail(the command line arguments) to it, then exit. To do this you need to use some form of IPC, or Inter-Process Communication. There are many to choose from. Messages, such as WM_COPYDATA, make a temp file with the data that is read by the primary instance, named memory mapped files.. on and on. Which is "best" varies with factors unique to your application. I am sure there is existing code that demonstrates the WM_COPYDATA method in AutoIt3 if you search the forums.
  8. You would probably need to know about the specific text editor. EditPad Lite 7 will have the word "Insert" or "Overwrite" in the status bar. Other editors may use a block cursor or caret depending on the mode. Notepad seems to stay in Insert mode no matter what I do. You may be able to detect the editor by accumulating the class names of windows used by them and check for tell tale signs. But I suspect many of the simple editors will change mode without any indicator. The user can tell the mode by watching if the text is overwritten or inserted. I would have thought more would use a block cursor for overwrite mode. But there seems to be no standard behavior.
  9. I agree. I used to add some style elements to the install dialog using the free ISSkin tool for Inno. Also if you know Pascal you can do quite a bit with the Inno scripting if there is something not covered by other options. Last time I tried the skin styler it added maybe 1/4 MB to the size of the installer. It puts a Dll in the install folder to supply the customized resources. You can easily delete the Dll when the install is done. Very cool for a free installer.
  10. Looking at an old program of mine where I drop files on a Listbox, the control does not need to have $WS_EX_ACCEPTFILES set. Only the Gui, if you are dropping the files from Explorer the parent window handles it. The control you want it dropped on only needs to set $GUI_DROPACCEPTED in the call to GuiCtrlSetState. At least that works for me dropping a list of filenames from explorer. I haven't done drag and drop to get the images.
  11. For additional techniques search on IPC or Inter-Process Communication. If there is a single value that is the result of the processing then write to file or standard out may be all you need. If you have written the launching application as well as the launched program there are many methods that would allow you to process ongoing files/input/whatever using the launched program passing the results back to the launcher. One is using windows messaging and WM_COPYDATA. Or you could use memory mapped files or another form of shared memory. There may be a UDF around that does WM_COPYDATA processing. It is a relatively easy way to pass info from a processing handler to a main program on an ongoing basis. Also named memory mapped files are not difficult once you have done the first one. Likewise I would look for an existing UDF or at code written in another programming language to see how it is done. Windows uses memory mapped files underneath many of the shared memory stuff to actually implement the memory sharing. Also for loading executables into memory. So is is likely to be one of the more optimized areas of system code.
  12. Also if just using it for yourself, if you set Firefox to open links in a new tab rather than a new window it should work as expected.
  13. Good idea. Awhile back I lost a domain I had for several years. I guess putting the new one in my sig slipped my mind.
×
×
  • Create New...