Welcome Guest.   Make a donation to an author on the site August 01, 2014, 12:47:58 AM  *

Please login or register.
Or did you miss your validation email?


Login with username and password (forgot your password?)
Why not become a lifetime supporting member of the site with a one-time donation of any amount? Your donation entitles you to a ton of additional benefits, including access to exclusive discounts and downloads, the ability to enter monthly free software drawings, and a single non-expiring license key for all of our programs.


You must sign up here before you can post and access some areas of the site. Registration is totally free and confidential.
 
The N.A.N.Y. Challenge 2013! Download dozens of custom programs!
   
  Forum Home Thread Marks Chat! Downloads Search Login Register  
  Show Posts
      View this member's profile 
      donate to someone Donate to this member 
Pages: Prev 1 ... 75 76 77 78 79 [80] 81 82 83 84 85 ... 130 Next
1976  Main Area and Open Discussion / General Software Discussion / Re: Why is my computer hiccuping every few seconds? on: February 09, 2011, 10:02:29 AM
Does the same thing as CCleaner, if you have CCleaner just turn it on (as mentioned here):

[attach=1]

Also, a couple of others I mentioned in the following post here.

EDIT: Dang it! f0dder snuck in between edits again.
1977  Main Area and Open Discussion / General Software Discussion / Re: Why is my computer hiccuping every few seconds? on: February 08, 2011, 11:34:50 PM
Just for interests sake, what version of Firefox are you using?

I'm running the nightly build of v4 and I can't say I've ever noticed anything like that.
1978  Main Area and Open Discussion / Living Room / Re: NoteSlate - mono color tablet, nice price on: February 08, 2011, 11:25:26 PM
If this product doesn't turn out to be vaporware, I'll pre-order at first opportunity.

Heck, wait until nudone buys it, ('cause he buys all new gadgets, even if they don't work), and then read his review.


 tongue
1979  Main Area and Open Discussion / General Software Discussion / Re: Why is my computer hiccuping every few seconds? on: February 08, 2011, 08:57:27 PM
Well, my interpretation is:

Task Manager: Simple overall view of the current system/program status allowing you to do simple things, eg. kill/start a task.

Resource Monitor: More indepth view of what processes are doing on the system, eg. processes are broken down into CPU usage, threads, Disk usage, Memory usage, etc while still allowing you to do things such as kill them.

Process Explorer: Kind of a love child between the two above smiley but doesn't include things like Disk usage/calls.

Interesting...I didn't think I had Windows Defender installed, but it is.  Furthermore, it is disabled, yet the process MsMpEng.exe is on with 34 threads going.  I looked it up and that exe is attributed to Windows Defender.  I checked again, and yes, it is disabled, so I don't get it.  i do have Microsoft Security Essentials, but that shouldn't include Defender, does it?

Once you install MSE, Defender kind of gets seconded into it and as such ceases to exist as a separate entity.  FWIW, here it has anywhere around 35 threads but 0 CPU.  If you open up MSE and turn off Real Time Protection you'll see the number of threads against MsMpEng.exe drop by about 10.
1980  Main Area and Open Discussion / General Software Discussion / Re: Why is my computer hiccuping every few seconds? on: February 08, 2011, 08:29:55 PM
You could try running the Resource Monitor, (perfmon.exe /res), and see if there is any annomalies in Disk Response time, which might give you a process and/or file to look at.

[attachthumb=1]

Also ensure you're running the latest motherboard drivers and check to see if there is a later motherboard BIOS.
1981  DonationCoder.com Software / Post New Requests Here / Re: IDEA: Movie Mode on: February 08, 2011, 07:55:20 PM
Thanks April, source added to post above.
1982  DonationCoder.com Software / Post New Requests Here / Re: IDEA: Movie Mode on: February 08, 2011, 05:04:21 PM
The relaunching has an issue: nothing with command line parameters is being relaunched.

Could you post or PM the ini file, (blank anything you don't want seen) ?

Ah, I think my handling of quotes was a little skewiff.

Try this one, it seems to work OK with the specific example you gave above - might need to rework it for more complicated quoting.

Have also removed the option to leave open the output CLI, (just to make the parameters in the ini file a little simpler), but if anyone wants it back, say something.

Formatted for AutoIt with the GeSHI Syntax Highlighter [copy or print]
  1. ; Filename: Movie-ize.au3
  2. #NoTrayIcon
  3. #Region ;**** Directives created by AutoIt3Wrapper_GUI ****
  4. #AutoIt3Wrapper_icon=popcorn-32x32.ico
  5. #AutoIt3Wrapper_UseUpx=n
  6. #AutoIt3Wrapper_UseX64=n
  7. #AutoIt3Wrapper_Res_Icon_Add=popcorn-32x32.ico
  8. #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
  9.  
  10. #include <_SysTray.au3>
  11. #include <Process.au3>
  12. #include '_OsVersionInfo.au3'
  13.  
  14. Global $inifile = 'Movie-ize.ini', $tempini = 'Movie-tmp.ini', $_state = False, $_term = False
  15.  
  16. ;--- Start Tray menu stuff
  17. Opt("TrayMenuMode", 1)
  18. Opt("TrayOnEventMode", 1)
  19.  
  20. $movieon = TrayCreateItem('Movie-ize',-1,-1,1)
  21. TrayItemSetOnEvent(-1, '_movieOn')
  22. $movieoff = TrayCreateItem('De-Movie-ize',-1,-1,1)
  23. TrayItemSetOnEvent(-1, '_movieOff')
  24. $prefs = TrayCreateItem('Preferences',-1,-1,0)
  25. TrayItemSetOnEvent(-1, '_prefs')
  26. $about = TrayCreateItem('About',-1,-1,0)
  27. TrayItemSetOnEvent(-1, '_about')
  28. $exit = TrayCreateItem('Exit',-1,-1,0)
  29. TrayItemSetOnEvent(-1,'_Exit')
  30. TraySetIcon('Movie-ize.exe', 4)
  31. TraySetToolTip("Get out the popcorn 'cause it's movie time!")
  32. TrayItemSetState($movieoff, 129)
  33. TrayItemSetState($movieon, 64)
  34. ;--- End Tray menu stuff
  35.  
  36. If Not FileExists($inifile) Then
  37. _CreateBaseIni()
  38. $kill = IniReadSection($inifile, 'Programs')
  39. $kparam = IniReadSection($inifile, 'Parameters')
  40.  
  41. If $CmdLine[0] > 0 Then $_term = True
  42. If $_term Then
  43. _RunAndExit()  ;--- If there's a CLI argument then Run and Exit
  44. _Initialise()  ;--- Otherwise, check for Movie-tmp.ini and initialise to movieOn state
  45.  
  46. Sleep(1000)    ;--- Twiddle thumbs
  47.  
  48.  
  49. Func _Initialise()
  50. If FileExists($tempini) Then
  51. $xterm = IniReadSection($tempini, 'Start')
  52. For $i = 1 To $kill[0][0]
  53. $kill[$i][0] = $xterm[$i][1]
  54. $_state = True
  55. TrayItemSetState($movieon, 129)
  56. TrayItemSetState($movieoff, 68)
  57. TrayItemSetState($prefs, 128)
  58. TraySetToolTip('System Movie-ized')
  59.  
  60. Func _Exit()  ;--- If not Run And Exit, checks to see if in MovieOn mode and asks user if they really want to exit
  61. If Not $_term Then
  62. TrayItemSetState($exit, 4)
  63. If $_state And (MsgBox(49, 'Movie-ize', 'System currently Movie-ized!' & @CRLF & 'Do you want to quit in this state?') = 2) Then Return
  64.  
  65. Func _about()
  66. TrayItemSetState($about, 4)
  67. MsgBox(64, 'Movie-ize', 'Movie-ize v0.22')
  68.  
  69. Func _prefs()  ;--- Load the ini into users default editor and wait for exit, then re-read ini
  70. TrayItemSetState($prefs, 4)
  71. If Not $_state Then  ;--- If in MovieOn mode then killed program state will be lost if user edits ini....so don't! >:^(
  72. ShellExecuteWait($inifile)
  73. Sleep(1000)
  74. $kill = IniReadSection($inifile, 'Programs')
  75. $kparam = IniReadSection($inifile, 'Parameters')
  76. MsgBox(48, 'Movie-ize', 'System currently Movie-ized,' & @CRLF & 'Preferences will be unavailable.')
  77.  
  78. Func _movieOn()  ;--- Cycles thru program array, if there's a process match it kills it and sets corresponding element to 1
  79. Local $i, $guineapig
  80. If Not $_term Then
  81. TrayItemSetState($movieon, 129)
  82. TrayItemSetState($movieoff, 64)
  83. TrayItemSetState($prefs, 128)
  84. $_state = True
  85. For $i = 1 To $kill[0][0]
  86. If $kill[$i][1] <> '' Then
  87. $guineapig = StringMid($kill[$i][1], StringInStr($kill[$i][1], '\', 0, -1) + 1)
  88. If ProcessExists($guineapig) Then
  89. ProcessClose($guineapig)
  90. $kill[$i][0] = 1
  91. $kill[$i][0] = 0
  92. _RefreshSystemTray()
  93. If Not $_term Then TraySetToolTip('System Movie-ized')
  94.  
  95. Func _movieOff()  ;--- Cycles thru program array looking for 1 element, if found tries to restart the associated program
  96. Local $i, $exec, $wdir, $execcmd
  97. If Not $_term Then
  98. TrayItemSetState($movieon, 64)
  99. TrayItemSetState($movieoff, 129)
  100. TrayItemSetState($prefs, 64)
  101. $_state = False
  102. For $i = 1 To $kill[0][0]
  103. If $kill[$i][0] = 1 Then
  104. If StringLeft($kill[$i][1], 1) = '>' Then
  105. $exec = StringMid($kill[$i][1], 2)
  106. $wdir = StringMid($kill[$i][1], 2, StringInStr($kill[$i][1], '\', 0, -1) - 2)
  107. $execcmd = '"' & $exec & '" ' & $kparam[$i][1]
  108. Run(@ComSpec & ' /c "' & $execcmd & '"', $wdir, @SW_HIDE)
  109. Run($kill[$i][1])
  110. Sleep(500)
  111. If Not $_term Then
  112. TraySetToolTip("Get out the popcorn 'cause it's movie time!")
  113. FileDelete($tempini)
  114.  
  115. Func _CreateBaseIni()  ;--- Creates a basic ini file first time it's run
  116. Local $i
  117. IniWrite($inifile, 'Programs', 'Program1', 'C:\Program Files\Skype\skype.exe')
  118. IniWrite($inifile, 'Programs', 'Program2', '>C:\Program Files\xchat\xchat.exe')
  119. IniWrite($inifile, 'Parameters', 'Param1', '')
  120. IniWrite($inifile, 'Parameters', 'Param2', '-d "E:\Programs Installed\xchat-pu70\settings"')
  121.  
  122. Func _TempIni()  ;--- For Run And Exit, writes a temporary ini file with initial program states, (QaD)
  123. Local $i
  124. For $i = 1 To $kill[0][0]
  125. IniWrite($tempini, 'Start', 'Start' & $i, $kill[$i][0])
  126. IniWrite($tempini, 'Programs', 'Program' & $i, $kill[$i][1])
  127. IniWrite($tempini, 'Parameters', 'Param' & $i, $kparam[$i][1])
  128.  
  129. Func _RunAndExit()  ;--- If the temporary ini exists, assumes already run once and refills array with correct values before calling _movieOff
  130. Local $i        ;--- otherwise call _movieOn then _TempIni to write list of killed programs
  131. If FileExists($tempini) Then
  132. $xterm = IniReadSection($tempini, 'Start')
  133. $kill = IniReadSection($inifile, 'Programs')
  134. $kparam = IniReadSection($inifile, 'Parameters')
  135. For $i = 1 To $xterm[0][0]
  136. $kill[$i][0] = $xterm[$i][1]
  137. _movieOff()
  138. FileDelete($tempini)
  139. _movieOn()
  140. _TempIni()
  141. _Exit()
  142.  
  143. Func _RefreshSystemTray()  ;--- The magic that clears the SysTray of dead icons courtesy of a UDF by Tuape & Erik Pilsits
  144. $count = _SysTrayIconCount()
  145. For $i = $count - 1 To 0 Step -1
  146. $handle = _SysTrayIconHandle($i)
  147. $visible = _SysTrayIconVisible($i)
  148. $pid = WinGetProcess($handle)
  149. $name = _ProcessGetName($pid)
  150. $title = WinGetTitle($handle)
  151. $tooltip = _SysTrayIconTooltip($i)
  152. If $pid = -1 Then _SysTrayIconRemove($i)
  153.  
  154. If _OsVersionTest($VER_GREATER_EQUAL, 6, 1) Then
  155. $countwin7 = _SysTrayIconCount(2)
  156. For $i = $countwin7 - 1 To 0 Step -1
  157. $handle = _SysTrayIconHandle($i, 2)
  158. $visible = _SysTrayIconVisible($i, 2)
  159. $pid = WinGetProcess($handle)
  160. $name = _ProcessGetName($pid)
  161. $title = WinGetTitle($handle)
  162. $tooltip = _SysTrayIconTooltip($i, 2)
  163. If $pid = -1 Then _SysTrayIconRemove($i, 2)

UPDATE: v0.22 - Cleaned up some stupid typos, removed some stuff that I forgot.
                        - Now sets the tray menu items to disabled/enabled so you don't call things twice, (why didn't I think of that before?).
                        - Added ability to run and exit, just call it with a command line argument (writes a temp ini when it kills programs, deletes it after relaunching them).
                        - Added some comments to source, ('cause mouser told me I should).
1983  DonationCoder.com Software / Post New Requests Here / Re: IDEA: Movie Mode on: February 08, 2011, 01:24:45 AM
Sounds good to me so far and the tray icons won't be a problem.

I'm afraid I fixed that, so you'll have to download it again from above post  embarassed

I also gave it an obligatory random version number so I can keep up with myself.

Quote
There is no extra CLI window when I launch XChat that way.

Oh well, I've left in the option of leaving the output window open.
1984  Main Area and Open Discussion / Living Room / Re: which is more important, system ram or video ram? on: February 07, 2011, 08:46:26 PM
@Carol: You could save yourself UKP20 and get the 955BE, same chip as the 965BE.  Only difference is the default multiplier of the 965 is one step higher - something that can easily be rectified in the BIOS for the Black Editions.
1985  DonationCoder.com Software / Post New Requests Here / Re: IDEA: Movie Mode on: February 07, 2011, 06:38:48 PM
Thanks, got an idea how to go about it - other than that, is it suitable for intended purpose?

eg. The method it uses to kill programs tends to leave their icons in the SysTray until you wander your mouse over them, is this a problem?

Of course, if it is a problem I don't know what I'm going to do about FIXED

While I'm at it, when running programs from command line do you want the CLI window to be open/closed/optional ?

EDIT: Try this one.

Delete the old ini file, it'll create a new one with a couple of examples.
Main things to notice are:
1) Prefix DOS, (or CLI run programs), with the '>' character;
2) Match the parameters with the programs, ie. Param1 is for Program1, etc;

Oh, if it wasn't obvious in the first post, it can handle more than 10 programs - just keep incrementing the program and parameter number.
1986  DonationCoder.com Software / Post New Requests Here / Re: IDEA: Movie Mode on: February 07, 2011, 04:50:58 PM
Annoyed with constant popup requesters from people who want to be your Facebook friend?
Find that the latest Nigerian Prince has interrupted your movie watching by offering you a once in a lifetime offer to get wealthy?
Do dings, bells, chimes and buzzes make you miss that once in a million Call of Duty: Black Ops headshot?
Constantly find yourself openning the door for salesmen?  (Sorry, got carried away  embarassed )

Well, your prayers are answered!*

Try ***Movie-ize***, (catchy name, huh).

Comes with a money back guarantee!**

Instructions:
1) Put it anywhere
2) Run it
3) Marvel at the Tray icon
3) Select Preferences to edit the ini file, it's pretty self-explanatory: one line per program, full path required, increment the key number as you go, (ie. Program11, Program12, etc).  It throws Skype in as an example entry.

I should note that all it does is close the process, if the process pops up a requester asking for confirmation, it won't get it from this program.

EDIT: Crap!  Didn't see the command line parameter bit  embarassed
I'll have a look at that.  Can you send me an example command line for it?

Removed, see post below.


* Maybe
** Disclaimer: All waranties void if this software proves useful or not.  Liability also not accepted for damage to eyesight through increased movie watching or DVT from failing to move from chair.  Warranty also considered to be void if it's used on a system it wasn't designed for, ie. mine.
1987  Main Area and Open Discussion / General Software Discussion / Re: In search of a partition identifier ... on: February 06, 2011, 05:35:28 PM
I'm not sure if the exes "compiled" by AutoIt3 conform to the standard.

Excellent!  Works in detecting CUI/GUI compiled AutoIt...now to apply my meager C knowledge in working out how they do it smiley

EDIT: Here's a AutoIt conversion, not the whole file.exe program, just up to the part I was interested in.  Seems to work OK as long as the AutoIt program hasn't been UPX'd of course.

Now to turn it into a function.

Formatted for AutoIt with the GeSHI Syntax Highlighter [copy or print]
  1. #Region ;**** Directives created by AutoIt3Wrapper_GUI ****
  2. #AutoIt3Wrapper_UseUpx=n
  3. #AutoIt3Wrapper_UseX64=n
  4. #AutoIt3Wrapper_Change2CUI=y
  5. #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
  6. ; file.au3
  7.  
  8. $maxfilesize = 8192
  9. Dim $buffer[$maxfilesize]
  10.  
  11. If $CmdLine[0] = 0 Then Exit
  12.  
  13. $hFile = FileOpen($CmdLine[1], 16)
  14. If $hFile = -1 Then
  15. MsgBox(0, 'Error!', 'Failed to open file.')
  16. For $i = 0 To 8191
  17. $buffer[$i] = Dec(StringMid(FileRead($hFile, 1), 3))
  18.  
  19. FileClose($hFile)
  20.  
  21. ; Test for executable
  22. If ($buffer[0]=77 And $buffer[1]=90) Or ($buffer[0]=90 And $buffer[1]=77) Then ; MZ or ZM
  23. ConsoleWrite('DOS/Win executable')
  24. ConsoleWrite('Not DOS/Win executable')
  25.  
  26. $offset=0
  27. $format=0
  28.  
  29. ; Test for NE/PE format
  30. $neoffset=($buffer[61] + $buffer[60]) * 256
  31. If ($buffer[$neoffset] = 78 And $buffer[$neoffset + 1] = 69) Then
  32. $format = 3
  33. $offset = $neoffset
  34.  
  35. $peoffset = $buffer[60]
  36. If ($peoffset > $maxfilesize) Then
  37. $peoffset = 0
  38.  
  39. If ($buffer[$peoffset] = 80 And $buffer[$peoffset + 1] = 69) Then
  40. $format = 1
  41. $offset = $peoffset
  42.  
  43. If ($format = 0) Then
  44. $i = 0
  45. While (($format = 0) And ($i < $maxfilesize - 4))
  46. If ($buffer[$i] = 80) And ($buffer[$i + 1] = 69) And ($buffer[$i + 2] = 0) And ($buffer[$i + 3] = 0) Then
  47. $offset = $i
  48. $format = 2
  49. $i += 1
  50.  
  51. ; Depending on the type of Format try to gain further information about the file
  52. If ($format = 1 Or $format = 2) Then
  53. If ($buffer[$offset + 4] = 0 And $buffer[$offset + 5] = 0) Then ConsoleWrite(', defined as an ANY / unknown machine type executable')
  54. If ($buffer[$offset + 4] = 76 And $buffer[$offset + 5] = 1) Then ConsoleWrite(', i386 32bit executable')
  55. If ($buffer[$offset + 4] = 100 And $buffer[$offset + 5] = 134) Then ConsoleWrite(', x86-64 64bit executable')
  56. If ($buffer[$offset + 4] = 0 And $buffer[$offset + 5] = 2) Then ConsoleWrite(', Intel Itanium executable')
  57. If ($buffer[$offset + 4] = 240 And $buffer[$offset + 5] = 1) Then ConsoleWrite(', Power PC (little endian) executable')
  58. If ($buffer[$offset + 4] = 241 And $buffer[$offset + 5] = 1) Then ConsoleWrite(', Power PC (with floating point support) executable')
  59. If ($buffer[$offset + 4] = 211 And $buffer[$offset + 5] = 1) Then ConsoleWrite(', Matsushita AM33')
  60. If ($buffer[$offset + 4] = 192 And $buffer[$offset + 5] = 1) Then ConsoleWrite(', ARM little endian')
  61. If ($buffer[$offset + 4] = 188 And $buffer[$offset + 5] = 14) Then ConsoleWrite(', EFI byte code')
  62. If ($buffer[$offset + 4] = 65 And $buffer[$offset + 5] = 144) Then ConsoleWrite(', Mitsubishi M32R little endian')
  63. If ($buffer[$offset + 4] = 102 And $buffer[$offset + 5] = 2) Then ConsoleWrite(', MIPS16')
  64. If ($buffer[$offset + 4] = 102 And $buffer[$offset + 5] = 3) Then ConsoleWrite(', MIPS with FPU')
  65. If ($buffer[$offset + 4] = 102 And $buffer[$offset + 5] = 4) Then ConsoleWrite(', MIPS 16 with FPU')
  66. If ($buffer[$offset + 4] = 102 And $buffer[$offset + 5] = 1) Then ConsoleWrite(', MIPS little endian / R4000')
  67. If ($buffer[$offset + 4] = 162 And $buffer[$offset + 5] = 1) Then ConsoleWrite(', Hitachi SH3')
  68. If ($buffer[$offset + 4] = 163 And $buffer[$offset + 5] = 1) Then ConsoleWrite(', Hitachi SH3 DSP')
  69. If ($buffer[$offset + 4] = 166 And $buffer[$offset + 5] = 1) Then ConsoleWrite(', Hitachi SH4')
  70. If ($buffer[$offset + 4] = 168 And $buffer[$offset + 5] = 1) Then ConsoleWrite(', Hitachi SH5')
  71. If ($buffer[$offset + 4] = 194 And $buffer[$offset + 5] = 1) Then ConsoleWrite(', Thumb')
  72. If ($buffer[$offset + 4] = 105 And $buffer[$offset + 5] = 1) Then ConsoleWrite(', MIPS little-endian WCE v2')
  73. If ($buffer[$offset + 4] = 132 And $buffer[$offset + 5] = 1) Then ConsoleWrite(', Alpha')
  74. If ($buffer[$offset + 4] = 104 And $buffer[$offset + 5] = 2) Then ConsoleWrite(', Motorola 68000')
  75. If ($buffer[$offset + 4] = 144 And $buffer[$offset + 5] = 2) Then ConsoleWrite(', PA-RISC')
  76.  
  77. If ($buffer[$offset + 23] = 32 And $buffer[$offset + 22] > 0) Then ConsoleWrite(', dll')
  78. If ($buffer[$offset + 23] = 10 And $buffer[$offset + 22] > 0) Then ConsoleWrite(', system file')
  79.  
  80. If ($buffer[$offset + 92] = 0 And $buffer[$offset + 93] = 0) Then ConsoleWrite(', unknown system')
  81. If ($buffer[$offset + 92] = 1 And $buffer[$offset + 93] = 0) Then ConsoleWrite(', native')
  82. If ($buffer[$offset + 92] = 2 And $buffer[$offset + 93] = 0) Then ConsoleWrite(', GUI')
  83. If ($buffer[$offset + 92] = 3 And $buffer[$offset + 93] = 0) Then ConsoleWrite(', console/cmd')
  84. If ($buffer[$offset + 92] = 7 And $buffer[$offset + 93] = 0) Then ConsoleWrite(', POSIX')
  85.  

EDIT: Got sidetracked, while it will tell how the program was compiled it still won't tell you how it was run...but at least I can make a single program that covers both compilation options.

Here's a function, returns True if compiled for GUI, False for anything else.

Formatted for AutoIt with the GeSHI Syntax Highlighter [copy or print]
  1. MsgBox(0, '', _GUITest(@ScriptFullPath))
  2.  
  3. Func _GUITest($file)
  4. Local $maxfilesize = 8192, $hFile, $offset, $buffer, $i, $format, $neoffset, $peoffset
  5. Dim $buffer[$maxfilesize]
  6.  
  7. $hFile = FileOpen($file, 16)
  8. For $i = 0 To 8191
  9. $buffer[$i] = Dec(StringMid(FileRead($hFile, 1), 3))
  10. FileClose($hFile)
  11.  
  12. $offset=0
  13. $format=0
  14.  
  15. $peoffset = $buffer[60]
  16. If ($peoffset > $maxfilesize) Then
  17. $peoffset = 0
  18.  
  19. If ($buffer[$peoffset] = 80 And $buffer[$peoffset + 1] = 69) Then
  20. $format = 1
  21. $offset = $peoffset
  22.  
  23. If ($format = 0) Then
  24. $i = 0
  25. While (($format = 0) And ($i < $maxfilesize - 4))
  26. If ($buffer[$i] = 80) And ($buffer[$i + 1] = 69) And ($buffer[$i + 2] = 0) And ($buffer[$i + 3] = 0) Then
  27. $offset = $i
  28. $format = 2
  29. $i += 1
  30.  
  31. ; Depending on the type of Format try to gain further information about the file
  32. If ($format = 1 Or $format = 2) Then
  33. If ($buffer[$offset + 92] = 2 And $buffer[$offset + 93] = 0) Then
1988  Main Area and Open Discussion / General Software Discussion / Re: In search of a partition identifier ... on: February 06, 2011, 04:25:09 AM
Great!  Thanks Miles, I'll have a look at it - had a look at the WinApiEx UDF earlier but couldn't see anything.

I couldn't believe they didn't have a macro, (eg. @console), already available.

EDIT: Seems that you need to have UPX'd the compiled script for it to work...bummer!  Still, might be able to adapt it.

Found something here, ie. get the parent process - if it's explorer.exe then it was run via double-click, if it's cmd.exe it's via CLI.
1989  Main Area and Open Discussion / General Software Discussion / Re: In search of a partition identifier ... on: February 05, 2011, 09:46:27 PM
It that case, perhaps you should sign up for the AutoHK Programming School, (which I'm currently going through in AutoIt) Wink

Here's the source, (a heavily edited version of the CompInfo UDF), but I could have also used AutoIt ScriptOMatic to generate and butcher.

I took the easier route.

Formatted for AutoIt with the GeSHI Syntax Highlighter [copy or print]
  1. #Region ;**** Directives created by AutoIt3Wrapper_GUI ****
  2. #AutoIt3Wrapper_UseUpx=n
  3. #AutoIt3Wrapper_UseX64=n
  4. #AutoIt3Wrapper_Change2CUI=y
  5. #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
  6.  
  7. #region Global Variables and Constants
  8. If Not(IsDeclared("$cI_CompName")) Then
  9. Global $cI_CompName = @ComputerName
  10. Global Const $cI_VersionInfo = "00.03.08"
  11. Global Const $cI_aName = 0, _
  12. $cI_aDesc = 4
  13. Global $wbemFlagReturnImmediately = 0x10, _ ;DO NOT CHANGE
  14. $wbemFlagForwardOnly = 0x20 ;DO NOT CHANGE
  15. Global $ERR_NO_INFO = "Array contains no information", _
  16. $ERR_NOT_OBJ = "$colItems isnt an object"
  17. #endregion Global Variables and Constants
  18.  
  19. #region Boot Configuration
  20. Dim $BootConfig
  21. _ComputerGetBootConfig($BootConfig)
  22. $error = @error
  23. $extended = @extended
  24. Switch $extended
  25. Case 1
  26. _ErrorMsg($ERR_NO_INFO)
  27. Case 2
  28. _ErrorMsg($ERR_NOT_OBJ)
  29. #endregion Boot Configuration
  30.  
  31. #region ComputerOS Configuration
  32. Dim $OSs
  33. _ComputerGetOSs($OSs)
  34. $error = @error
  35. $extended = @extended
  36. Switch $extended
  37. Case 1
  38. _ErrorMsg($ERR_NO_INFO)
  39. Case 2
  40. _ErrorMsg($ERR_NOT_OBJ)
  41. #endregion ComputerOS Configuration
  42.  
  43. $CompOS = StringSplit($OSs[1][0],'|')
  44. $CompOS[0] = $BootConfig[1][0]
  45.  
  46. If $CmdLine[0] = 1 Then
  47. Switch $CmdLine[1]
  48. Case 'A', 'a'
  49. ConsoleWrite($CompOS[0])
  50. Case 'O', 'o'
  51. ConsoleWrite($CompOS[1])
  52. Case 'B', 'b'
  53. ConsoleWrite($CompOS[3])
  54. Case 'S', 's'
  55. ConsoleWrite($CompOS[2])
  56. Case 'E', 'e'
  57. For $i = 0 To 3
  58. ConsoleWrite($CompOS[$i] & @CRLF)
  59. $info = 'WhatBoot [A|O|B|S|E]' & @CRLF & 'Where: A - Active partition' & @CRLF & '       O - Operating System' & _
  60. @CRLF & '       B - Boot partition' & @CRLF & '       S - System directory' & @CRLF & '       E - Everything'
  61. ConsoleWrite($info)
  62.  
  63.  
  64. Func _ComputerGetBootConfig(ByRef $aBootConfigInfo)
  65. Local $colItems, $objWMIService, $objItem
  66. Dim $aBootConfigInfo[1][8], $i = 1
  67.  
  68. $objWMIService = ObjGet("winmgmts:\\" & $cI_Compname & "\root\CIMV2")
  69. $colItems = $objWMIService.ExecQuery("SELECT * FROM Win32_BootConfiguration", "WQL", $wbemFlagReturnImmediately + $wbemFlagForwardOnly)
  70.  
  71. If IsObj($colItems) Then
  72. For $objItem In $colItems
  73. ReDim $aBootConfigInfo[UBound($aBootConfigInfo) + 1][8]
  74. $aBootConfigInfo[$i][0]  = $objItem.Description
  75. $i += 1
  76. $aBootConfigInfo[0][0] = UBound($aBootConfigInfo) - 1
  77. If $aBootConfigInfo[0][0] < 1 Then
  78. SetError(1, 1, 0)
  79. SetError(1, 2, 0)
  80. EndFunc ;_ComputerGetBootConfig
  81.  
  82. Func _ComputerGetOSs(ByRef $aOSInfo)
  83. Local $colItems, $objWMIService, $objItem
  84. Dim $aOSInfo[1][60], $i = 1
  85.  
  86. $objWMIService = ObjGet("winmgmts:\\" & $cI_Compname & "\root\CIMV2")
  87. $colItems = $objWMIService.ExecQuery("SELECT * FROM Win32_OperatingSystem", "WQL", $wbemFlagReturnImmediately + $wbemFlagForwardOnly)
  88.  
  89. If IsObj($colItems) Then
  90. For $objItem In $colItems
  91. ReDim $aOSInfo[UBound($aOSInfo) + 1][60]
  92. $aOSInfo[$i][0]  = $objItem.Name
  93. $i += 1
  94. $aOSInfo[0][0] = UBound($aOSInfo) - 1
  95. If $aOSInfo[0][0] < 1 Then
  96. SetError(1, 1, 0)
  97. SetError(1, 2, 0)
  98. EndFunc ;_ComputerGetOSs
  99.  
  100. #region ---- Internal Functions
  101. Func _ErrorMsg($message, $time = 0)
  102. ConsoleWrite("Error! - " & $message)
  103. #endregion Internal Functions

Happy it worked  cheesy

You might not need the ebook, I find the examples in the help docs and throughout the AutoIt forum are usually enough to get me either headed in the right direction or almost exactly what I require.  The hard part is getting the search terms right.  Many a time I've started writing a function to do something then searched in the forum to find that it's included in a UDF so all I need is a function call  embarassed

ATM I can't work out how to tell whether or not the program is run via CLI or GUI which would allow me to add both types of output.  I'm sure it's really easy but stuffed if I can find a variable, (or process), to check for so I can do it.
1990  Main Area and Open Discussion / General Software Discussion / Re: In search of a partition identifier ... on: February 05, 2011, 05:57:10 PM
Been searching for something, preferably portable, that will identify the currently active OS partition.

When you say 'active' do you mean the partition that is marked as Active that carries the MBR, (I only have one per all drives), or do you mean the current System partition ?

ie. In the picture below: The Active or the Boot partition?

[attach=1]

Try the attached compiled AutoIt script, it's console only, (so you can stick it in batch file or something), let me know if you want GUI instead.

Quote
D:\My Docs\AutoIt>whatboot a
\Device\Harddisk2\Partition1
D:\My Docs\AutoIt>whatboot b
\Device\Harddisk2\Partition2
D:\My Docs\AutoIt>whatboot o
Microsoft Windows 7 Home Premium
D:\My Docs\AutoIt>whatboot s
C:\Windows
D:\My Docs\AutoIt>whatboot e
\Device\Harddisk2\Partition1
Microsoft Windows 7 Home Premium
C:\Windows
\Device\Harddisk2\Partition2

D:\My Docs\AutoIt>whatboot
WhatBoot [A|O|B|S|E]
Where: A - Active partition
       O - Operating System
       B - Boot partition
       S - System directory
       E - Everything
D:\My Docs\AutoIt>

EDIT: Should have mentioned, numbering starts at 1 for partitions.
1991  Main Area and Open Discussion / General Software Discussion / Re: How to create a shortcut for the "wireless network connection" in Windows XP? on: February 03, 2011, 02:16:22 PM
Thanks for clarifying - I'll leave you to you nutz and futz now  tongue
1992  Main Area and Open Discussion / General Software Discussion / Re: How to create a shortcut for the "wireless network connection" in Windows XP? on: February 03, 2011, 02:06:10 PM
Aahh...I see.....

But, (you knew that was coming didn't you), prior to XP SP2 doesn't that mean that Wireless Connection Manager, (or the window you get after hitting View Wireless Networks, whatever it's called), wasn't available?

ie. Prior to XP SP2, didn't you have to use whatever software the manufacturer provided with the adapter and as such won't what you're trying to do not work anyway?

Sorry, it's been a while since I saw anything but XP SP3 around.
1993  Main Area and Open Discussion / General Software Discussion / Re: How to create a shortcut for the "wireless network connection" in Windows XP? on: February 03, 2011, 11:55:56 AM
Note: Granted using the WiFi API 4wd mentioned above would have been a more elegant solution (simpler code & faster to pound out), however it also doesn't run on (isn't available in) Windows XP ... Which is (after all) or target platform.

Sorry if I seem to be pushing a dead donkey but I'm still not clear here, everything I've read on the Native WiFi API says it's available from XP SP2, (SP2 via patch, incorporated into SP3), onwards, (when Wireless Zero Config was introduced - I would have thought most people would be running SP3 by now), the only function not available to XP seems to be WlanGetInterfaceCapability according to MSDN.

So I would have thought that their example code for WlanEnumInterfaces would be just what's needed, (bearing in mind their note about GUIDs at the bottom which seems to make any program more convoluted than it needs to be).

I'm just trying to understand why it wouldn't run for you on XP but feel free to call me an idiot - I've been called worse  tongue
1994  DonationCoder.com Software / Post New Requests Here / Re: IDEA: Block/Unblock all network traffic button (one-click) on: February 02, 2011, 11:42:50 PM
OK, give this a try - it uses devcon to get the status and (dis|en)able the network adapter.

I don't see how it's going to work if you're blocked from (dis|en)abling via the Network Connections Control Panel but who knows, stranger things have happened.

If it doesn't work, then the only option left is to either modify the program to elevate to SYSTEM user or try and run the devcon command elevated and see what happens.

NOTES: You no longer have a choice of toggling ALL connections.

Actual fact it probably works better than NetToggle because the status is more consistantly reported but it does have a LOT less error checking Wink

REMOVED - See following posts.
1995  DonationCoder.com Software / Post New Requests Here / Re: IDEA: Block/Unblock all network traffic button (one-click) on: February 02, 2011, 08:12:10 PM
Just for interests sake, a x64 version of devcon can be found here.

They might even go so far as providing the link to the file for you.  but the best way would be to have the program's installer offer to download the file and install it for you in case it's not installed yet.

I'm going for something a bit easier, AutoIt allows incorporating binaries as a resource into the compiled program - so it will just extract the x86/x64 version out of the compiled program as required.

Probably not exactly kosher regarding distribution license but I'm feeling too old and lazy to be bothered by the more complicated method of grabbing it from MS or the location of the x64 version, (what happens if they change the address?), and installing it.

Also, I have no idea how to write an installer and I *hate* programs that cannot be unzipped and run unless there is a very good reason.

I can't see any reason why this won't run from a flash drive when I've finished, (fingers and toes crossed).
1996  DonationCoder.com Software / Post New Requests Here / Re: IDEA: Block/Unblock all network traffic button (one-click) on: February 01, 2011, 08:44:34 PM
Man, this adapter ID thing is totally the reason why there are no good third party network software for windows.  I've always wondered why there were no cool little software out there to improve on little annoyances like this related to networks.

It would be nice to know whether devcon worked in your situation before proceeding along this path.

Any chance you can download DEVCON, do the following in a CLI and paste the results in list.txt here?

devcon listclass net >list.txt

Then we could give you a devcon command to try and disable the adapter, if it doesn't work then there doesn't seem to be an easy way around the permissions.
1997  DonationCoder.com Software / Post New Requests Here / Re: IDEA: Block/Unblock all network traffic button (one-click) on: February 01, 2011, 07:09:50 PM
Given permissions being set that disallow normal users from disabling the adapters, how is using devcon, (which I've used for other things), going to help?

Guess I'll have to fire up XP Pro and have a play in the Group Policy editor.

Scratch that, looks like server OS only.

Time to put the thinking cap on.

^ You are correct. There is a 32 and a 64bit version. Completely forgot about that.

The 64bit version included is for Intel Itaniums, (ia64), won't work on x64 installations.

i don't think you're a cracker failure.

I wasn't suggesting I'm a cracker failure, perish the thought, I was suggesting my next program would be a cracker failure....as in format your drive type  Grin

^Yep. That's the tricky part of the equation. You'd need to get that information somehow. If not through devcon, then some other way. I'd guess polling the registry would be how a pro would get it.

devcon listclass net >list.txt

Then string match the first 3 characters of each line to USB, PCI or BTH - should pick up almost any network hardware, giving you hardware ID, (for devcon), and adapter name, (for GUI).
1998  DonationCoder.com Software / Post New Requests Here / Re: IDEA: Block/Unblock all network traffic button (one-click) on: February 01, 2011, 05:28:22 PM
you're right.  I'm at work, and i can't disable this connection.  I'm guessing it's a restriction put in place by our network admins. (see attachment in previous post)

Possibly, (from here):

Quote
Ability to Enable/Disable a LAN connection
Administrative Template: System
Policy Node: USER
Policy Path: Administrative Templates\Network\Network Connections
Supported On: At least Microsoft Windows 2000 Service Pack 1
Help/Explain Text: Determines whether users can enable/disable LAN connections. If you enable this setting, the Enable and Disable options for LAN connections are available to users (including nonadministrators). Users can enable/disable a LAN connection by double-clicking the icon representing the connection, by right-clicking it, or by using the File menu. If you disable this setting (and enable the Enable Network Connections settings for Administrators setting), double-clicking the icon has no effect, and the Enable and Disable menu items are disabled for all users (including administrators). Important: If the Enable Network Connections settings for Administrators is disabled or not configured, this setting will not apply to administrators on post-Windows 2000 computers. If you do not configure this setting, only Administrators and Network Configuration Operators can enable/disable LAN connections. Note: Administrators can still enable/disable LAN connections from Device Manager when this setting is disabled.
Registry Settings: HKLM\Software\Policies\Microsoft\Windows\Network Connections!NC_LanConnect

Ah well, my second crack at a coding snack has failed to live up to expectations  Sad

On the bright, the third time should be a cracker, (whether cracker failure I'm not sure about).  cheesy

It's usually a troubleshooting reason.  The most recent example is I'm trying to troubleshoot my email program, and I don't want it accidentally sending recieving any email until all my settings are the way i like it.  because if i don't like it, I'm going to move certain files around and i don't want an email or two slipping in there during the interim, because then my last "good" files are not the latest and greatest.  So stuff like that.

I usually use the 'one size fits all' solution of unplugging the network cable. Wink
1999  DonationCoder.com Software / Post New Requests Here / Re: IDEA: Block/Unblock all network traffic button (one-click) on: February 01, 2011, 03:09:04 AM
OK, it's had a name change, (but you can change it to anything you like), to NetToggle v0.99

WHAT:  A simple program for toggling the state, (enable/disable), of one or all of the network interfaces.   Tray icon changes to reflect current status.

REQUIREMENTS: Windows XP+SP3 (x86/x64) or later.

USAGE: On first run it will prompt for a network interface from the drop down list, select one and click Save.  Interface selected is save to an ini file in the same directory as the executable.
      
Click the LMB on the tray icon to toggle the state of the interface.
      
Click the RMB on the tray icon to open the interface selector.
      
To exit the program, click the RMB on the tray icon and then click the window Close button, (X in top right).
      
NOTES: You can rename the executable when you run it, it will prompt for an interface and save it to a new ini under the same name as the executable.  So you can run multiple copies, one for each interface.

See post here.
2000  Main Area and Open Discussion / General Software Discussion / Re: How to create a shortcut for the "wireless network connection" in Windows XP? on: January 31, 2011, 07:45:43 PM
The C# Native WiFi API thing didn't pan out as it's Vista/7 only (I'm not ready to give-up on XP just yet), so I'm polking around looking for options.

That's strange because they implemented it from XP SP2 onwards, well according to Microsoft....but then, what would they know smiley

And it seems to work OK on XP-SP3 via my LANToggle program, (ie. it lists the interfaces and lets me (dis|en)able them), AutoIt of course so maybe there is a little more trickery going on.

However, I don't think it will work if the you don't use the Wireless Zero Config in Windows, (ie. the adapter uses whatever the manufacturer supplied by way of connection software).
Pages: Prev 1 ... 75 76 77 78 79 [80] 81 82 83 84 85 ... 130 Next
DonationCoder.com | About Us
DonationCoder.com Forum | Powered by SMF
[ Page time: 0.545s | Server load: 0.03 ]