Jump to content

Pardalito

Members
  • Posts

    13
  • Joined

  • Last visited

Everything posted by Pardalito

  1. Sorry... Forgot to define shutdown high priority. If Not _SetProcessShutdownParameters(0xFFF) Then ; MSDN says maximum is 0x4FF, but it worked for me If Not _SetProcessShutdownParameters(0x4FF) Then ; MSDN says this is reserved for System, but worked for me _SetProcessShutdownParameters(0x3FF) ; highest not reserved number, if everything else does not work EndIf EndIf Func _SetProcessShutdownParameters($dwLevel, $dwFlags=0) ; http://msdn.microsoft.com/en-us/library/ms686227%28VS.85%29.aspx ; Prog@ndy Local $aResult = DllCall("Kernel32.dll", "int", "SetProcessShutdownParameters", "dword", $dwLevel, "dword", $dwFlags) If @error Then Return SetError(1,0,0) Return $aResult[0] EndFunc Solved !!! Thanks, Pardalito.
  2. Hello, I used this function many times and work great, but now with Windows 7 I have a little problem. I have an AutoIt script that runs 2 childs processes, httpd.exe and mysqld.exe. When a try to shutdown Windows 7, this function blocks the shutdown correctly, but kills the 2 childs processes (httpd.exe and mysqld.exe). In Windows XP this problem doesn’t happens. Blocks shutdown and the 2 childs processes still running correctly. Using the _ShutdownBlockReasonCreate method. Any idea to prevent the kill of this 2 childs processes in Win 7? Thanks.
  3. Thanks Jon. Work’s well for my Project. Continue the good work...
  4. Hello Lazycat, Good UDF. Thanks. Best Regards, Pardalito.
  5. Hello jchd, Yes... You have right. I understand now. Thanks.
  6. Hello jchd, This is a nice idea... Slower, but a nice idea. If you get only de ANSI files and then convert these files to UTF-8, then you have a fast process. For future versions a function to determinate a charset/enconding from file, are welcome. Something like that: FileEncoding('ansi.php') = 1 FileEncoding('utf-8.php') = 2 FileEncoding('utf-16.php') = 3 ... 1 = ANSI Charset 2 = UTF-8 Charset 3 = UTF-16 Charset ... Thanks again jchd. P.S.: If somebody have more ideas to do this, please write
  7. Hello again, In the release notes of v3.3.4.0: Added: Ability to read and write UTF-8 files with no BOM including automatic detection during reading. Sorry... But I don't see any function/procedure in the includes folder... Best regards, Pardalito.
  8. Hello jchd, I need an app that search my web files (.php) and do a log of files that don’t have UTF-8 charset/encoding. For example: I have 1000 files and I have 2 files in ANSI. When a run this future app, the log must include this 2 files in ANSI. In the thread that you mention I don’t see any function to do detection of UTF-8 files. In the latest release of AutoIt, I don’t see any procedure to detect the file charset. Any help? Thanks for your reply. Best regards, Pardalito.
  9. Hello, There is a solution to detect file encoding/charset? I need to detect if my file(s) have UTF-8 encoding (without BOM). I try to read the first 3 Hex words but the number changes: 0x3C3F70 0x3C3439 0x3C6D65 0x3C6874 0x3C7461 0x3C2144 0x093C64 (UTF-8 without BOOM) 0xEFBBBF ... Anyone knows a good solution to see if the file have UTF-8 encoding/charset without BOM? Best regards, Pardalito. Edit: Typo
  10. Very good... Thanks.
  11. Hello, Yes... You have right... Works like a charm and in array return the serial number or the security dongle. $result = DllCall(@ScriptDir & "\UniKey.dll", "int", "UniKey", "int", $fcode, "int*", $handler, "int*", $lp1, "int*", $lp2, "int*", $p1, "int*", $p2, "int*", $p3, "int*", $p4, "byte*", $buffer) _ArrayDisplay($result) Many thanks. Best Regards, Pardalito.
  12. Hello and thanks, Changed... $result = DllCall(@ScriptDir & "\UniKey.dll", "int", "UniKey", "int", $fcode, "int*", $handler, "int*", $lp1, "int*", $lp2, "int*", $p1, "int*", $p2, "int*", $p3, "int*", $p4, "byte*", $buffer) msgbox(0,'',String($result) & " - " & $result) The fatal error disappears (perfect), but I dont have or I don't see the response by security dongle. The $result is null. API in VC6: extern "C" long __stdcall UniKey(WORD Function, WORD* handle, DWORD* lp1, DWORD* lp2, WORD* p1, WORD* p2, WORD* p3, WORD* p4, BYTE* buffer); For $fcode = 1 all the values are optional. I dont see the error, any ideas? Best Regards, Pardalito.
  13. Hello, I need help to access a security dongle dll. But after many tries I’m going crazy... Code in VB6: Declare Function UniKey Lib "UniKey.DLL" (ByVal fcode As Integer, ByRef handle As Integer, ByRef lp1 As Long, ByRef lp2 As Long, ByRef p1 As Long, ByRef p2 As Long, ByRef p3 As Long, ByRef p4 As Long, ByRef buffer As Byte) As Integer Dim handle(15) As Integer Dim p1, p2, p3, p4, i, j, count, retcode As Long Dim lp1, lp2 As Long Dim buffer() As Byte retcode = UniKey(1, handle(0), lp1, lp2, p1, p2, p3, p4, buffer(0)) Code in VB2008: Declare Function UniKey Lib "UniKey.DLL" (ByVal fcode As Integer, ByRef handle As Integer, ByRef lp1 As Long, ByRef lp2 As Long, ByRef p1 As Integer, ByRef p2 As Integer, ByRef p3 As Integer, ByRef p4 As Integer, ByRef buffer As Byte) As Integer Dim handle As Integer Dim p1, p2, p3, p4, i, j, retcode As Integer Dim lp1, lp2, v As Integer Dim buffer(4096) As Byte retcode = UniKey(1, handle, lp1, lp2, p1, p2, p3, p4, buffer(0)) In VB6 and VB2008 works well, and return (retcode) the value 0. With this code by me in Autoit: Dim $fcode, $handler, $lp1, $lp2, $p1, $p2, $p3, $p4, $buffer, $result $fcode = 1 $handler = 0 $p1 = 1234 $p2 = 1234 $p3 = 1234 $p4 = 1234 $buffer = 0 $result = DllCall("UniKey.dll", "int", "UniKey", "int", $fcode, "int", $handler, "int", $lp1, "int", $lp2, "int", $p1, "int", $p2, "int", $p3, "int", $p4, "byte", $buffer) The Autoit closes with a fatal error. Any suggestion? Best Regards, Pardalito.
×
×
  • Create New...