Jump to content

MilesAhead

Active Members
  • Posts

    698
  • Joined

  • Last visited

Everything posted by MilesAhead

  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. See the Ping function in the help.
  10. That would be cheating. Too easy.
  11. 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.
  12. 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.
  13. 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.
  14. 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.
  15. 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.
  16. I have found an easy way to do things like run a program that deletes every index.dat file on the Windows system partition, using the RunOnce registry key. I wrote a small freeware to set it conveniently called RunItOnce. The program it runs will run before login. So it should not be interactive at all. You may download RunItOnce from my page It just so happens the utility is written in AutoIt3. Edit: The beauty of using the RunOnce key in the Registry is the system gets the info, then removes it from the Registry for you. You don't have to worry about cleaning up after yourself. RunItOnce will set the RunOnce key of the user whose account is active when RunItOnce is run. IOW, it uses the Users RunOnce Registry key, not Administrator. But it should work fine for deleting system files since they are not considered to be "in use by the system" prior to login. At least it had no problem running a program that deleted every index.dat file on C: for me. Try it and see. But I would definitely make an image backup first!!
  17. You could try opening the file in binary mode to see if that makes a difference with binary files likely to be found in System32. You might look at some binary files with a hex editor to see if a trailing LF is stored with a leading zero or as a single byte. Edit: I seem to remember in hex editors seeing line feeds as one byte. If I remember right Dos was little endian so the small nibble would be first as in 0x0A00. But you should look for yourself to be sure as this was Dos 16 bit stuff when I was poking through binary files back in the day.
  18. I have a freeware written in AutoIt3 designed to make it a bit easier to snap up source code from selected text on a browser page. I call it SourceSnap Mainly the idea is to save source to a filename, or for small selections, add the selection to a snp file. It is very simple. Just meant to make things a bit easier than free handing it. Like all freeware on my page it is free for you to use at your own risk. Don't get paranoid if VirusTotal shows a few red flags. I regularly download everything on my page using DownLoadThemAll and compare the md5 sums with the zip files I have stored locally.
  19. I never did much with the Shell Namespace because I didn't have to and it is a pita. This site may shed some light on it: https://msdn.microsoft.com/en-us/library/windows/desktop/cc144090(v=vs.85).aspx#unknown_13653 The confusion may be that the PIDL is like an integer type that is used as a pointer. You might try to find examples in a different programming language. Maybe something in C# or C++ on the Code Project site.
  20. I am by no means experienced in this area. But I agree with the comment that the system should make it difficult to bypass the protection rather than making it impossible. Some people will not buy any software that calls home, on principle. They assume some data mining is going on along with the license protection. I would attempt to find some case studies and/or statistics. Copy protection schemes have been around for some time. There are probably cost/benefit metrics out there somewhere for the various techniques.
  21. Just to add an idea for a "calling home" solution, I think the originator of Sandboxie, when he changed the license from a serial number to online verification, had it set up that it had to be verified every so many months. IOW, if the site was down you could still use all functions of the software, unless it was unable to update the online verification for 90 days or whatever the time period was. It seems more and more software products are calling home. I installed Wise Care 365 Pro giveaway a few months back. It was for a year with no updates. Then they changed it so the updater would work, but the license would expire at the year deadline. When I installed it the stipulation was if I did not upgrade to extend the Pro license it would revert to the free version. The free functions were fine with me. So I figured let it revert to free. No go. Now even if I uninstall the pro, scrub the registry, install the free, when I run it I still get the Pro extender nag screen and it quits, even though there is over a month left on the license. This calling home crap is living up to the dread that made me stop updating Sandboxie once the licensing switched away from a local serial number system. But I digress. You can use some kind of scheme where the server does not have to be up 24/7. But as others noted, if implemented in .au3 it may be simple to bypass.
  22. Could the network be slowing you down? Have you tried a simple copy to the local drive, then read from the HD? If it is still slow you might try memory mapped files. That is what the OS uses to map exe images into ram. User programs can create memory mapped files to share the same data across processes. Where it may help you is the call MapViewOfFile which lets you map a chunk of the file into a memory range. With some experience, or if you can find a library for Memory Mapped Files, you may use that call to create a window into the file. The position in the file used to fill the buffer is adjustable. Also the size.
  23. Well you know what they say about computers. Mubers in, mubers out.
  24. I didn't learn about my error programming using GWBasic for a long time!! heh heh Just kidding. I also did QuickBasic 3.0 for a while. Now if I try to use FreeBasic I struggle with the syntax. It has so many compatibility modes that just about every function call syntax I try looks right but generates a syntax error.
  25. Just for grins you may want to try my compiled UpdateEnv program. It uses a variation of Melba's Toast with 3 calls to EnvUpdate() and sleep while the toast is showing. Just makes it obvious to the user that something is happening. Mainly I use it to flush the Registry to disk without having to log out and back in. That is why I make 3 calls. Just to try to drive in the nail. The file is UpdateEnv.zip on the page below http://milesaheadsoftware.org/ btw I have noticed on Windows 7 and Windows 8.0 that EnvUpdate() can have long delays and hang at times. I think that is one reason I wrapped it in Toast. To make it obvious where the program was pausing. It seems to require killing via Task Manager much less often the way I have it now. Three calls interspersed with calls to Sleep(). If I just let it sit it will usually complete on its own accord. Most times it runs as expected though. I have no idea why unless the Registry has lots of changes to save to disk? I don't know.
×
×
  • Create New...