Leaderboard
Popular Content
Showing content with the highest reputation on 04/27/2015 in all areas
-
The forum is currently being upgraded - this post details the status. Content may look badly formatted at the moment. This is normal until the background rebuild tasks have finished. There is no need to re-edit your old posts or signatures to fix them, this should happen automatically. Please resist the urge to do so The post rebuild is estimated at 9 hours - it's not a quick task. Current Status: Forum upgraded - 100%AutoIt code boxes rebuilt - 100%Double-spaced paragraphs fixed up (as best I can) - 100%Forum to Wiki Access - 100%Signatures rebuilt - 100%Posts rebuilt (emoticons, bbcode, attachments, images, quotes) - 100%Legacy BBCode fixed in signatures​color - 100%color=rgb() - 100%url - 100%img - 100%size - 100%Search engine online - 100%2 points
-
AuPad
Mannyfresh15 reacted to MikahS for a file
Version 1.9.5
1,238 downloads
This is a notepad program written entirely in AutoIt. It has all the basics of notepad that you would expect. This is NOT feature complete, yet. I have included the source code for your pleasure, and feel free to give me pointers if you'd like to help out development (This is all done with AutoIt version 3.3.14.0) If you use any code from this, please leave a comment or something linking to this post, thank you. Prev dls from old forum: 783 run the install to put the AuPad.exe and AuPad.ico in the program files directory under AuPad. Also, the install puts the RESH.au3 (all thanks to @Beege) UDFs into your include folder for you. Included in the .zip: Install.exe, Install.au3, AuPad.au3, AuPad.exe, aupad.ico, uninstall.au3, Uninstall.exe, and RESH.au3 Current Features: Version History:1 point -
1 point
-
When no order by clause is specified, SQL engines are free to return results in any order of their choice. Most of the times that means the simple order which you expect, namely the order resulting from inserts/deletes/replaces but one should never rely on this. You can achieve the order you want by unioning resuts along with a select number, like this: $sSql_Query = _ "select ffp from (" & _ " SELECT 1 rank, filename, FullFilePath ffp FROM DB WHERE FileName LIKE '%" & $Search_1 & "%' " & _ " union all " & _ " SELECT 2 rank, filename, FullFilePath ffp FROM DB WHERE FileName LIKE '%" & $Search_2 & "%' " & _ " union all " & _ " SELECT 3 rank, filename, FullFilePath ffp FROM DB WHERE FileName LIKE '%" & $Search_3 & "%' " & _ ") " & _ "ORDER BY rank, FileName"1 point
-
Saving PDF with COM from PDFCreator
SorryButImaNewbie reacted to Zedna for a topic
Here is nice example1 point -
New PDFCreator Controls
SorryButImaNewbie reacted to Zedna for a topic
Use COM: ObjCreate() But PDFCreator since version 1.9.x totaly rewritten whole application completely from scratch and COM is not finished even in new version 2.0 So you have to install latest old PDFCreator 1.7.3 version where COM is working OK.1 point -
Saving PDF with COM from PDFCreator
SorryButImaNewbie reacted to jguinch for a topic
Did you try the automatic saving in PDFCreator ? You can configure a PDFCreator printer (profile) witch generates PDF in silent mode in the specified folder, with a specified file name. Also, you can configure it to execute a script after the PDF conversion.1 point -
Try this : #include <MsgBoxConstants.au3> #include <GUIConstantsEx.au3> $mainform = GUICreate("test", 500, 500, 500, 500) GUISetFont(10, 100000, 0, "Segoe UI") GUISetBkColor(0x00bbbb) GUICtrlSetColor(-1, 0x00bbbb) GUISetState(@SW_SHOW) $about = GUICtrlCreateButton("About",110, 110, 110 , 110 ) GUICtrlSetColor(-1, 0x6699FF) GUISetState(@SW_SHOW) GUICtrlSetBkColor($about, 0x2929A3) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $about about() EndSwitch Sleep(10) WEnd Func about() Send ("{F1}") MsgBox ( $MB_SYSTEMMODAL , "F1", "F1 Has been Pressed") EndFunc Be aware : If you send F1 in your script you wont see when the key in pressed since ... F1 does not doing anysomething else in your windows. You can add a condoition with other includes.. if i remember it's misc.au3 and use : If _IsPressed ("{F1}") Then "Open this website" EndIfor any other action If your question is answered dont forget to mark the topic solved1 point
-
it is still not clear at all but well i am gonna to explain you two type of action possible, becose i guess you need one or the other: A:)you can use a function for one keypress B:)or click on a buttom to simulate a keypress A:) If you bind a key to one function it s very simple to do for exemple : i want to send a command after the F1 key pressed you can code somthing like that HotKeySet("{F1}", "About") Function About () "Do my about function" EndFuncDont forget to bind F1 at the beginning of your script B:) if you push on the about button you want to emulate the F1 you have to setup a switch case code in your script Switch GUIGetMsg() Case $About Send ("{F1}") EndSwitchin this case i assume you made a GUI in your script with a button declared as the "$About" variable. If you need something else plz say us.1 point
-
SQLite - is order by selection possible?
sdfaheemuddin reacted to Zedna for a topic
Use UNION like this $sSql_Query = "SELECT FullFilePath FROM DB WHERE FileName LIKE '%" & $Search_1 & "%' UNION SELECT FullFilePath FROM DB WHERE FileName LIKE '%" & $Search_2 & "%' UNION SELECT FullFilePath FROM DB WHERE FileName LIKE '%" & $Search_31 point -
This code can update the file resource of All Autoit versions Important before use this code must compress the AutoIt Exe file without using UPX option This section was added to the code Local $FullPath = "" if StringUpper($pFileName) == StringUpper($OutFile) Then $SplitA = StringSplit($OutFile,"\") For $i = 1 To $SplitA[0] if $i = $SplitA[0] Then $FullPath &= "New_" & $SplitA[$i] Else $FullPath &= $SplitA[$i] & "\" EndIf Next $OutFile = $FullPath EndIf New script #Include <WinAPI.au3> ;This code can update the resource files of All Autoit versions ;Important before use this code must compress the AutoIt file without using UPX option ; AutoIt file ==> Autoit.exe Global $AutoitScriptCodeDataStruct = 0 ,$ImageFileName = "" $hUpdate = BeginUpdateResource("Autoit.exe","Autoit.exe") $DataStruct = StringToDataStruct("0123456789") UpdateResource($hUpdate,10,5,DllStructGetPtr($DataStruct),DllStructGetSize($DataStruct)) EndUpdateResource($hUpdate) Func BeginUpdateResource($pFileName = "Autoit.exe",$OutFile = "NewExeFile.exe",$bDeleteExistingResources = False) ;---------------------------------------------------------------Begins ;Get Image File WithOut Autoit Script Code And Save it In $OutFile = "NewExeFile.exe" Local $OF_READWRITE = 0x00000002 ,$OF_CREATE = 0x00001000 Local $FullPath = "" if $pFileName == $OutFile Then $SplitA = StringSplit($OutFile,"\") For $i = 1 To $SplitA[0] if $i = $SplitA[0] Then $FullPath &= "New_" & $SplitA[$i] Else $FullPath &= $SplitA[$i] & "\" EndIf Next $OutFile = $FullPath EndIf $ImageFileName = $OutFile $hFile = _WinAPI_CreateFile($pFileName, 2, 2) if Not ($hFile) Then Return -1 $HFILE1 = WINAPIOpenFile($OutFile,$OF_CREATE + $OF_READWRITE) $HFILE2 = WINAPIOpenFile($OutFile,$OF_CREATE + $OF_READWRITE) If Not ($HFILE1) Or Not ($HFILE2) Then Return -2 $IMAGE_DOS_HEADER = READ_IMAGE_DOS_HEADER($hFile,0) WRITE_IMAGE_DOS_HEADER($HFILE1,0,$IMAGE_DOS_HEADER) $MovePos = DllStructGetData($IMAGE_DOS_HEADER,"lfanew") $lfanew = $MovePos $Signature = READ_Signature($hFile,$MovePos) $IMAGE_NT_SIGNATURE_MAC = 0x00004550 ;C++6 WINNT.H $IMAGE_NT_SIGNATURE = 0x50450000 ;C++6 WINNT.H if DllStructGetData($Signature,"Signature") <> $IMAGE_NT_SIGNATURE_MAC And _ DllStructGetData($Signature,"Signature") <> $IMAGE_NT_SIGNATURE Then Return -3 WRITE_Signature($HFILE1,$MovePos,$Signature) $MovePos += DllStructGetSize($Signature) $IMAGE_FILE_HEADER = READ_IMAGE_FILE_HEADER($hFile,$MovePos) WRITE_IMAGE_FILE_HEADER($HFILE1,$MovePos,$IMAGE_FILE_HEADER) $MovePos += DllStructGetSize($IMAGE_FILE_HEADER) $IMAGE_OPTIONAL_HEADER = READ_IMAGE_OPTIONAL_HEADER($hFile,$MovePos) $IMAGE_NT_OPTIONAL_HDR32_MAGIC = 0x10b ;C++6 WINNT.H $IMAGE_NT_OPTIONAL_HDR64_MAGIC = 0x20b ;C++6 WINNT.H if DllStructGetData($IMAGE_OPTIONAL_HEADER,"Magic") <> $IMAGE_NT_OPTIONAL_HDR32_MAGIC _ And DllStructGetData($IMAGE_OPTIONAL_HEADER,"Magic") <> $IMAGE_NT_OPTIONAL_HDR64_MAGIC _ Then Return -4 $IMovePos = $MovePos WRITE_IMAGE_OPTIONAL_HEADER($HFILE1,$MovePos,$IMAGE_OPTIONAL_HEADER) $NumberOfSections = DllStructGetData($IMAGE_FILE_HEADER,"NumberOfSections") $MovePos += DllStructGetSize($IMAGE_OPTIONAL_HEADER) $JMovePos = $MovePos $SizeOfHeaders = DllStructGetData($IMAGE_OPTIONAL_HEADER,"SizeOfHeaders") ;SizeOf IMAGE_SECTION_HEADER ==> 40 $RemainderSize = $SizeOfHeaders - ($MovePos + $NumberOfSections * 40) $DataPos = ($MovePos + $NumberOfSections * 40) $DataStruct = READ_Data($hFile,$DataPos,$RemainderSize) WRITE_Data($HFILE2,$DataPos,$DataStruct) For $i = 1 To $NumberOfSections $IMAGE_SECTION_HEADER = READ_IMAGE_SECTION_HEADER($hFile,$MovePos) WRITE_IMAGE_SECTION_HEADER($HFILE1,$MovePos,$IMAGE_SECTION_HEADER) $PointerToRawData = DllStructGetData($IMAGE_SECTION_HEADER,"PointerToRawData") $SizeOfRawData = DllStructGetData($IMAGE_SECTION_HEADER,"SizeOfRawData") $VirtualAddress = DllStructGetData($IMAGE_SECTION_HEADER,"VirtualAddress") $ByteStruct = READ_SECTION($hFile,$PointerToRawData,$SizeOfRawData) WRITE_SECTION($HFILE2,$PointerToRawData,$byteStruct) $MovePos += DllStructGetSize($IMAGE_SECTION_HEADER) Next _WinAPI_CloseHandle($hFile) _WinAPI_CloseHandle($HFILE1) _WinAPI_CloseHandle($HFILE2) ;Get Image File WithOut Autoit Script Code And Save it In $OutFile = "NewExeFile.exe" ;-------------------------------------------------------------------------------- end $ImageFileSize = FileGetSize($OutFile) ;Get Image File Size WithOut Autoit Script Code $AutoitFileSize = FileGetSize($pFileName) ;Get Autoit File Size With Autoit Script Code $pFileName = "Autoit.exe" $AutoitScriptCodeSize = $AutoitFileSize - $ImageFileSize ;Get Autoit Script Code Size $AutoitScriptCodeDataStruct = FileToDataStruct($pFileName,2,$ImageFileSize,0) ;Flag = 2 Char ;$iPos = $ImageFileSize ;$iMethod = $FILE_BEGIN ;Get Autoit Script Code in DataStruct $HANDLE = DllCall("kernel32.dll","HANDLE","BeginUpdateResource","str", _ $OutFile,"BOOL",$bDeleteExistingResources) ;BeginUpdateResource New Image File ==> $OutFile if @error Then Return -5 Else if $HANDLE[0] = 0 Then Return -5 Return $HANDLE[0] EndIf EndFunc Func UpdateResource($hUpdate,$lpType,$lpName,$lpData,$cbData,$wLanguage = 0) if IsString($lpType) Then $DataType1 = "str" $lpType = StringUpper($lpType) ELSE $DataType1 = "long" $lpType = Int($lpType) EndIf if IsString($lpName) Then $DataType2 = "str" $lpName = StringUpper($lpName) ELSE $DataType2 = "long" $lpName = Int($lpName) EndIf $BOOL = DllCall("kernel32.dll","BOOL","UpdateResource","HANDLE",$hUpdate,$DataType1 _ ,$lpType,$DataType2,$lpName,"WORD",$wLanguage,"ptr",$lpData,"DWORD",$cbData) if Not @error Then Return $BOOL[0] Return 0 EndFunc Func EndUpdateResource($hUpdate,$fDiscard = False) Local $nBytes $BOOL = DllCall("kernel32.dll","BOOL","EndUpdateResource","HANDLE",$hUpdate,"BOOL",$fDiscard) if @error Then Return -1 if $BOOL[0] = 0 Then Return -1 $hFile = _WinAPI_CreateFile($ImageFileName,2,4) ;$ImageFileName = $OutFile if Not($hFile) Then Return -2 _WinAPI_SetFilePointer($hFile,0,2) ;Set File Pointer To The End Byte Or To The End Char Of File $AutoitScriptCodeDataStruct_Size = DllStructGetSize($AutoitScriptCodeDataStruct) $AutoitScriptCodeDataStruct_PTR = DllStructGetPtr($AutoitScriptCodeDataStruct) $BOOL = _WinAPI_WriteFile($hFile,$AutoitScriptCodeDataStruct_PTR,$AutoitScriptCodeDataStruct_Size,$nBytes) ;Write In The End Of New File $ImageFileName Autoit Script Code Data It Is Encrypted data if Not ($BOOL) Then Return -3 _WinAPI_CloseHandle($hFile) Return 1 EndFunc Func FileToDataStruct($FileName,$Flag = 1,$iPos = 0 ,$iMethod = 0) ;$Flag=1 Return BYTE DataStruct ;$Flag=2 Return Char DataStruct ;iPos Number of bytes to move the file pointer ;$iMethod ;[optional] The starting point for the file pointer move. ;Can be one of the predefined values: ;$FILE_BEGIN = 0 - The starting point is zero (0) or the beginning of the file ;$FILE_CURRENT = 1 - The starting point is the current value of the file pointer. ;$FILE_END = 2 - The starting point is the current end-of-file position. ;Implicit value is $FILE_BEGIN = 0 Local $iRead $FileSize = FileGetSize($FileName) if $FileSize = 0 Then Return -1 $hFile = _WinAPI_CreateFile($FileName, 2, 2) if Not($hFile) Then Return -2 _WinAPI_SetFilePointer($hFile,$iPos,$iMethod) if $Flag <> 1 Then $DataStruct = DllStructCreate("char[" & $FileSize & "]") Else $DataStruct = DllStructCreate("byte[" & $FileSize & "]") EndIf $BOOL = _WinAPI_ReadFile($hFile, DllStructGetPtr($DataStruct),$FileSize,$iRead) if @error Then Return -3 _WinAPI_CloseHandle($hFile) if $BOOL Then Return $DataStruct Else Return -3 EndIf EndFunc Func StringToDataStruct($Text,$Flag = 1) ;$Flag=1 Return BYTE DataStruct ;$Flag=2 Return Char DataStruct $Len = StringLen($Text) if $Len = 0 Then Return -1 if $Flag <> 1 Then $DataStruct = DllStructCreate("char[" & $Len & "]") Else $DataStruct = DllStructCreate("byte[" & $Len & "]") EndIf DllStructSetData($DataStruct,1,$Text) Return $DataStruct EndFunc Func CRE_IMAGE_SECTION_HEADER($BytePtr = 0) Local $IMAGE_SIZEOF_SHORT_NAME = 8 $Tag = _ ;// IMAGE_SECTION_HEADER C++6 WINNT.H without union "byte Name[" & $IMAGE_SIZEOF_SHORT_NAME & "];" & _ "dword Misc;" & _ "dword VirtualAddress;" & _ "dword SizeOfRawData;" & _ "dword PointerToRawData;" & _ "dword PointerToRelocations;" & _ "dword PointerToLinenumbers;" & _ "ushort NumberOfRelocations;" & _ "ushort NumberOfLinenumbers;" & _ "dword Characteristics" if ($BytePtr) Then _ Return MRtlMoveMemory($Tag,$BytePtr,40) ;reading the IMAGE_SECTION_HEADER Return DllStructCreate($Tag) ;Create EndFunc Func CRE_IMAGE_OPTIONAL_HEADER($BytePtr = 0) Local $Tag = _ ;// IMAGE_OPTIONAL_HEADER C++6 WINNT.H "ushort Magic;" & _ "ubyte MajorLinkerVersion;" & _ "ubyte MinorLinkerVersion;" & _ "dword SizeOfCode;" & _ "dword SizeOfInitializedData;" & _ "dword SizeOfUninitializedData;" & _ "dword AddressOfEntryPoint;" & _ "dword BaseOfCode;" & _ "dword BaseOfData;" & _ "dword ImageBase;" & _ "dword SectionAlignment;" & _ "dword FileAlignment;" & _ "ushort MajorOperatingSystemVersion;" & _ "ushort MinorOperatingSystemVersion;" & _ "ushort MajorImageVersion;" & _ "ushort MinorImageVersion;" & _ "ushort MajorSubsystemVersion;" & _ "ushort MinorSubsystemVersion;" & _ "dword Win32VersionValue;" & _ "dword SizeOfImage;" & _ "dword SizeOfHeaders;" & _ "dword CheckSum;" & _ "ushort Subsystem;" & _ "ushort DllCharacteristics;" & _ "dword SizeOfStackReserve;" & _ "dword SizeOfStackCommit;" & _ "dword SizeOfHeapReserve;" & _ "dword SizeOfHeapCommit;" & _ "dword LoaderFlags;" & _ "dword NumberOfRvaAndSizes;" & _ "byte byteData[128]" ; 128 ==> sizeof(IMAGE_DATA_DIRECTORY) * IMAGE_NUMBEROF_DIRECTORY_ENTRIES if ($BytePtr) Then _ Return MRtlMoveMemory($Tag,$BytePtr,224) Return DllStructCreate($Tag) ;Create EndFunc Func CRE_IMAGE_FILE_HEADER ($BytePtr = 0) $Tag = _ ;//File header format C++6 WINNT.H "ushort Machine;" & _ "ushort NumberOfSections;" & _ "dword TimeDateStamp;" & _ "dword PointerToSymbolTable;" & _ "dword NumberOfSymbols;" & _ "ushort SizeOfOptionalHeader;" & _ "ushort Characteristics" if ($BytePtr) Then _ Return MRtlMoveMemory($Tag,$BytePtr,20) ;reading the File header format Return DllStructCreate($Tag) ;Create EndFunc Func CRE_IMAGE_DOS_HEADER($BytePtr = 0) $Tag = _ ;// DOS .EXE header C++6 WINNT.H "ushort magic;" & _ ;// Magic number "ushort cblp;" & _ ;// Bytes on last page of file "ushort cp;" & _ ;// Pages in file "ushort crlc;" & _ ;// Relocations "ushort cparhdr;" & _ ;// Size of header in paragraphs "ushort minalloc;" & _ ;// Minimum extra paragraphs needed "ushort maxalloc;" & _ ;// Maximum extra paragraphs needed "ushort ss;" & _ ;// Initial (relative) SS value "ushort sp;" & _ ;// Initial SP value "ushort csum;" & _ ;// Checksum "ushort ip;" & _ ;// Initial IP value "ushort cs;" & _ ;// Initial (relative) CS value "ushort lfarlc;" & _ ;// File address of relocation table "ushort ovno;" & _ ;// Overlay number "ushort res[4];" & _ ;// Reserved words "ushort oemid;" & _ ;// OEM identifier (for e_oeminfo) "ushort oeminfo;" & _ ;// OEM information; e_oemid specific "ushort res2[10];" & _ ;// Reserved words "dword lfanew" ;// File address of new e if ($BytePtr) Then _ Return MRtlMoveMemory($Tag,$BytePtr,64) ;reading the dos header Return DllStructCreate($Tag) ;Create EndFunc Func READ_SECTION($hFile,$MovePos,$Size) Local $nBytes _WinAPI_SetFilePointer($hFile,$MovePos) $byteStruct = DllStructCreate("byte[" & $Size & "]") $byteStructPtr = DllStructGetPtr($byteStruct) _WinAPI_ReadFile($hFile,$byteStructPtr,$Size,$nBytes) Return $byteStruct EndFunc Func WRITE_SECTION($hFile,$MovePos,$byteStruct) Local $nBytes _WinAPI_SetFilePointer($hFile,$MovePos) $Size = DllStructGetSize($byteStruct) $byteStructPtr = DllStructGetPtr($byteStruct) _WinAPI_WriteFile($hFile,$byteStructPtr,$Size,$nBytes) EndFunc Func READ_Data($hFile,$MovePos,$Size) Local $nBytes _WinAPI_SetFilePointer($hFile,$MovePos) $byteStruct = DllStructCreate("BYTE[" & $Size & "]") $byteStructPtr = DllStructGetPtr($byteStruct) _WinAPI_ReadFile($hFile,$byteStructPtr,$Size,$nBytes) Return $byteStruct EndFunc Func WRITE_Data($hFile,$MovePos,$byteStruct) Local $nBytes _WinAPI_SetFilePointer($hFile,$MovePos) $Size = DllStructGetSize($byteStruct) $byteStructPtr = DllStructGetPtr($byteStruct) _WinAPI_WriteFile($hFile,$byteStructPtr,$Size,$nBytes) EndFunc Func READ_IMAGE_DOS_HEADER($hFile,$MovePos) Local $nBytes _WinAPI_SetFilePointer($hFile,$MovePos) $IMAGE_DOS_HEADER = CRE_IMAGE_DOS_HEADER() $Size = DllStructGetSize($IMAGE_DOS_HEADER) $PIMAGE_DOS_HEADER = DllStructGetPtr($IMAGE_DOS_HEADER) _WinAPI_ReadFile($hFile,$PIMAGE_DOS_HEADER,$Size,$nBytes) Return $IMAGE_DOS_HEADER EndFunc Func WRITE_IMAGE_DOS_HEADER($hFile,$MovePos,$IMAGE_DOS_HEADER) Local $nBytes _WinAPI_SetFilePointer($hFile,$MovePos) $Size = DllStructGetSize($IMAGE_DOS_HEADER) $PIMAGE_DOS_HEADER = DllStructGetPtr($IMAGE_DOS_HEADER) Return _WinAPI_WriteFile($hFile,$PIMAGE_DOS_HEADER,$Size,$nBytes) EndFunc Func READ_Signature($hFile,$MovePos) Local $nBytes _WinAPI_SetFilePointer($hFile,$MovePos) $Tag_Signature = "dword Signature" $Signature = DllStructCreate($Tag_Signature) $PSignature = DllStructGetPtr($Signature) $Size = DllStructGetSize($Signature) _WinAPI_ReadFile($hFile,$PSignature,$Size,$nBytes) Return $Signature EndFunc Func WRITE_Signature($hFile,$MovePos,$Signature) Local $nBytes _WinAPI_SetFilePointer($hFile,$MovePos) $Size = DllStructGetSize($Signature) $PSignature = DllStructGetPtr($Signature) Return _WinAPI_WriteFile($hFile,$PSignature,$Size,$nBytes) EndFunc Func READ_IMAGE_FILE_HEADER($hFile,$MovePos) Local $nBytes _WinAPI_SetFilePointer($hFile,$MovePos) $IMAGE_FILE_HEADER = CRE_IMAGE_FILE_HEADER() $Size = DllStructGetSize($IMAGE_FILE_HEADER) $PIMAGE_FILE_HEADER = DllStructGetPtr($IMAGE_FILE_HEADER) _WinAPI_ReadFile($hFile,$PIMAGE_FILE_HEADER,$Size,$nBytes) Return $IMAGE_FILE_HEADER EndFunc Func WRITE_IMAGE_FILE_HEADER($hFile,$MovePos,$IMAGE_FILE_HEADER) Local $nBytes _WinAPI_SetFilePointer($hFile,$MovePos) $Size = DllStructGetSize($IMAGE_FILE_HEADER) $PIMAGE_FILE_HEADER = DllStructGetPtr($IMAGE_FILE_HEADER) Return _WinAPI_WriteFile($hFile,$PIMAGE_FILE_HEADER,$Size,$nBytes) EndFunc Func READ_IMAGE_OPTIONAL_HEADER($hFile,$MovePos) Local $nBytes _WinAPI_SetFilePointer($hFile,$MovePos) $IMAGE_OPTIONAL_HEADER = CRE_IMAGE_OPTIONAL_HEADER() $Size = DllStructGetSize($IMAGE_OPTIONAL_HEADER) $PIMAGE_OPTIONAL_HEADER = DllStructGetPtr($IMAGE_OPTIONAL_HEADER) _WinAPI_ReadFile($hFile,$PIMAGE_OPTIONAL_HEADER,$Size,$nBytes) Return $IMAGE_OPTIONAL_HEADER EndFunc Func WRITE_IMAGE_OPTIONAL_HEADER($hFile,$MovePos,$IMAGE_OPTIONAL_HEADER) Local $nBytes _WinAPI_SetFilePointer($hFile,$MovePos) $Size = DllStructGetSize($IMAGE_OPTIONAL_HEADER) $PIMAGE_OPTIONAL_HEADER = DllStructGetPtr($IMAGE_OPTIONAL_HEADER) Return _WinAPI_WriteFile($hFile,$PIMAGE_OPTIONAL_HEADER,$Size,$nBytes) EndFunc Func READ_IMAGE_SECTION_HEADER($hFile,$MovePos) Local $nBytes _WinAPI_SetFilePointer($hFile,$MovePos) $IMAGE_SECTION_HEADER = CRE_IMAGE_SECTION_HEADER() $Size = DllStructGetSize($IMAGE_SECTION_HEADER) $PIMAGE_SECTION_HEADER = DllStructGetPtr($IMAGE_SECTION_HEADER) _WinAPI_ReadFile($hFile,$PIMAGE_SECTION_HEADER,$Size,$nBytes) Return $IMAGE_SECTION_HEADER EndFunc Func WRITE_IMAGE_SECTION_HEADER($hFile,$MovePos,$IMAGE_SECTION_HEADER) Local $nBytes if $MovePos <> 0 Then _WinAPI_SetFilePointer($hFile,$MovePos) $Size = DllStructGetSize($IMAGE_SECTION_HEADER) $PIMAGE_SECTION_HEADER = DllStructGetPtr($IMAGE_SECTION_HEADER) Return _WinAPI_WriteFile($hFile,$PIMAGE_SECTION_HEADER,$Size,$nBytes) EndFunc Func RtlMoveMemory($sourcePtr,$destPtr,$MovePos) DllCall("Kernel32.dll","none","RtlMoveMemory","ptr",$sourcePtr,"ptr",$destPtr,"dword",$MovePos) EndFunc Func MRtlMoveMemory($Tag_Struct,$Ptr,$MovePos) $Struct = DllStructCreate($Tag_Struct) $StructPtr = DllStructGetPtr($Struct) DllCall("Kernel32.dll","none","RtlMoveMemory","ptr",$StructPtr,"ptr",$Ptr,"dword",$MovePos) Return $Struct EndFunc Func WINAPIOpenFile($lpFileName,$uStyle) $Tag_OFSTRUCT = _ "byte cBytes;" & _ "byte fFixedDisk;" & _ "ushort nErrCode;" & _ "ushort Reserved1;" & _ "ushort Reserved2;" & _ "char szPathName[260]" $OFSTRUCT = DllStructCreate($Tag_OFSTRUCT) $lpReOpenBuff = DllStructGetPtr($OFSTRUCT) $HFILE = DllCall("Kernel32.dll","hwnd","OpenFile","str",$lpFileName,"ptr",$lpReOpenBuff,"long",$uStyle) if Not @error Then Return $HFILE[0] Return 0 EndFunc1 point
-
Question about _FileWriteFromArray
souldjer777 reacted to sirjaymz for a topic
Thanks for responding. I apologize, I thought I could respond to any post. Is the etiquette to start a new thread? This is what I came up with based on the help files. Does this look like it should work? ;My array Global $ArrayGrid_Queue [100] [20] $ArrayGrid_Queue[0][0] = "Queue Number";Column0 = Queue Number $ArrayGrid_Queue[0][1] = "Job Number"; JobNumber $ArrayGrid_Queue[0][2] = "Job Number Current Status"; JobNumber current Status. $ArrayGrid_Queue[0][3] = "Number Of Copies"; Number of Copies to Burn. $ArrayGrid_Queue[0][4] = "ISO/Image File Name"; "ISO/Image File Name" $ArrayGrid_Queue[0][5] = "Cover File Name"; "Cover File Name" $ArrayGrid_Queue[0][6] = "Job Priority"; "JobPriority" $ArrayGrid_Queue[0][7] = "Time Submitted"; Time Stamp Job Submitted by User to Queue $ArrayGrid_Queue[0][8] = "Time Started"; Time Stamp by Srv of when Job was Started. $ArrayGrid_Queue[0][9] = "Time Completed"; Time Stamp by Srv of when Job was Completed. $ArrayGrid_Queue[0][10] = "Write Speed"; 1x,2x,2,4x,4x, etc. $ArrayGrid_Queue[0][11] = "Verify"; Yes or NO $ArrayGrid_Queue[0][12] = "Delete Image"; Yes or NO $ArrayGrid_Queue[0][13] = "Delete Cover"; Yes or NO $ArrayGrid_Queue[0][14] = "Job Lock"; Meaning, client can not make changes, server has control of this job only. $ArrayGrid_Queue[0][15] = "" $ArrayGrid_Queue[0][16] = "" $ArrayGrid_Queue[0][17] = "" $ArrayGrid_Queue[0][18] = "" $ArrayGrid_Queue[0][19] = "" $Path2QueueFileUD = "C:\" Local $File = FileSaveDialog ( "Save Queue", $Path2QueueFileUD, "Queue File (*.ini)", 2+16, "Queue.ini" ) If Not @error Then For $r = 0 to UBound($ArrayGrid_Queue,1) - 1 For $c = 0 to UBound($ArrayGrid_Queue,2) - 1 IniWrite ( $File, $r, $ArrayGrid_Queue[0][$c], $ArrayGrid_Queue[$r][$c] Next Next Local $szDrive, $szDir, $szFName, $szExt _PathSplit ($File, $szDrive, $szDir, $szFName, $szExt) $Path2QueueFileUD = $szDrive & $szDir EndIf1 point