Leaderboard
Popular Content
Showing content with the highest reputation on 02/06/2013 in all areas
-
Form Builder beta
mLipok reacted to BuckMaster for a topic
Update v1.0.6 Major script overhaul, I literally started over from scratch only adding parts of code from the old script that were solid. I don’t have a help file made as of now so I am going to explain all of the functionality in this post - Form Builder is no longer bi-directional, you now toggle between script mode and GUI mode using a button in the top right or F4 - The script no longer recompiles on every change but instead inserts changes into the script - Form Builder no longer cares about Event mode or GuiGetMsg mode - No more .gui files, you now edit .au3 scripts directly - Script edit is now a SciLexer control, includes syntax highlighting, folding, call tips, keywords, and inline error annotations. - Script output console is now at the bottom in script mode - Main GUI menu redone, most functions from SciTe have been added along with their hotkeys - All restrictions to editing the script have been removed - GDI+ and Graphic editors removed - Cleanup of script, stability greatly increased - Hotkeys no longer use _IsPressed they now use GUIAccelerator keys (with exception to a few) - Multiple scripts can be open - Form Builder buffers the open scripts and adds an asterisk * to scripts that have been modified - Rich Edit, GUIScrollbars, Dummy, and Updown are disabled for now until I can add them - GUI Menu controls cannot be created as of now but will be rendered in the editor - Undo and Redo actions in script mode and GUI mode added, the GUI undo and redo buffer is cleared switching between modes - The Undo and Redo buffers do not have a limit but are cleared when switching between modes or scripts - Undo and Redo actions do not work for controls that have no control handle - The Treeview now works as a Go to function for controls and functions in script mode - Form Builder now tries to preserve as much of the original content as possible, it will save whitespace in-between parameters and comments on controls - Treeview context menu reworked, much more responsive - Unicode support added File -> Encoding -> UTF-8 - Language support added, I added a couple of language files and used Google translate just so I could size my GUI's for different languages, I do not support what those language files say - Selecting a GUI in the Treeview in GUI mode will allow you to change the GUI's Handle, Position, Background Color, State, Cursor, Font, Font Size and Font Attributes - Auto Declare is no longer hiding in the settings, it is now on the top right and is a toggle between Off, Global and Local - Help File Lookup added (Ctrl + H), allows you to search selected text in the help file, Any variable will be searched and the first result will be displayed, any string will be searched as a keyword in the index - Added current script line, column, and selection length in the bottom left - Standard undeclared style constants are checked before script execution and the script will prompt if an undefined style constant is found - You can now toggle script whitespace, EOL characters, line numbers, margins and output in the View menu - View -> Toggle All Folds works as it does in SciTe, only base level folds are changed and the first fold found determines whether to expand or contract - Form Builder Settings redone - Bugs with submitting data and control selection have been fixed - Fixed problems with frequently called repetitive functions causing issues with large scripts - Fixed bugs with B, I, U and S font attribute buttons getting stuck and called when enter was pressed Update v1.0.7 - Help File Look-up hotkey changed to Ctrl+B - Replace hotkey changed to Ctrl+H - Changes to $SCN_MODIFIED so only text events are notified - Bookmarks added, Ctrl+M to add or delete a Bookmark from the current line - Edit -> Bookmarks -> Set Bookmark changes the currently selected Bookmark - Edit -> Clear Current Bookmarks deletes only the currently selected Bookmark - Allows you to change foreground and background colors of Bookmarks - Added F2 hotkey for Next Bookmark - Added Shift+F2 hotkey for Previous Bookmark - Fixed a bug that made it so script annotation did not show up for some people - Script errors and warnings now add a Bookmark on each line - Ctrl+E hotkey added to clear all Bookmarks and Annotations - Minor GUI tweaks - Fixed a bug with the GUI Style undo action - Undo and Redo actions for GUI windows will now update the window properties if the GUI is selected - F4 Hotkey no longer switches modes, switching modes is now F10 - F4 is to toggle next error or warning message, works like it does in SciTe, bookmarks the line and highlights the error in the console - Shift+F4 Hotkey added to toggle previous error or warning message - Shift+F5 Hotkey added to clear script output - Ctrl+F5 Hotkey added as SyntaxCheck Prod - Form Builder now performs a SyntaxCheck before entering GUI Mode and prompts on Error or Warning - Language Select Menu Added Settings -> Lanugage - Icons added to main menu - Languages added to all new menu items and msgbox's - Language Files updated for new data - Language Support added for Arabic, Chinese, Dutch, French, German, Hebrew, Japanese, Swedish, Thai, and Vietnamese [ Google Translate ] - Fixed bug with updating a language that made it look like ANSI and UTF-8 were both selected - Added redo button next to undo button - Font attribute buttons Bold, Italic, Underline and Strike-Out changed to labels Update v1.0.8 - Somehow a main function got deleted causing the script to crash on some changes - Fixed some issues with updating Languages Hotkeys Ctrl + N - New Blank Script Ctrl + G - New GUI Script Ctrl + O - Open Script Ctrl + Shift + S - Save As Ctrl + S - Save Esc - Close Open Script Alt + F4 - Exit Ctrl + Z - Undo Ctrl + Y - Redo Ctrl + X - Cut Ctrl + C - Copy Ctrl + V - Paste Ctrl + A - Select All Ctrl + W - Clear inline script annotation Ctrl + E - Clear inline script annotation and bookmarks Ctrl + F - Find Ctrl + F3 - Find Next Shift + F3 - Find Previous (doesn’t work yet) Ctrl + B - Help File Lookup F5 - Go Alt + F5 - Beta Run F7 - Build Ctrl + F7 - Compile F11 - Full screen F8 - Toggle Show/Hide Script Output Ctrl + I - Open Include Ctrl + H - Replace F1 - AutoIt Help File Ctrl + D - Duplicate Control Delete - Delete Control Ctrl + Shift + 8 - Toggle Show/Hide Script Whitespace Ctrl + Shift + 9 - Toggle Show/Hide Script EOL characters Ctrl - GUI Mode multicontrol selection F10 - Switch Modes F4 - Next Message Shift+F4 - Previous Message Shift+F5 - Clear Output Ctrl+M - Add Bookmark F2 - Next Bookmark Shift+F2 - Previous Bookmark Basic GUI Mode How To Create a Control - click a control on the left - click in the GUI you wish to add the control Left Click: Click and drag to auto resize the control Right Click: Creates the control at a standard size Select a Control - click inside the control or select it in the treeview Change a controls Data - First select the control - modify the controls data on the right, press enter to submit changes state, cursor, font and resizing update when you change the data - when modifying the data parameter the script recognizes if there is a variable in the data and will add quotes accordingly ex. data parameter = $data, End result in script: GUICtrlCreateButton($data, 50, 50, 100, 20) ex. data parameter = data, End result in script: GUICtrlCreateButton("data", 50, 50, 100, 20) ex. data parameter = "data"&$data, End result in script: GUICtrlCreateButton("data"&$data, 50, 50, 100, 20) Applying an Image to a control - select a control - control styles must be applied to some controls before adding an image - click the ... button next to the Image input in the Control Properties area in the bottom right - select the image you want to display, allows jpg, bmp, gif, ico and dll files - selecting a dll will open another prompt to choose which resource to display Control Grouping - multiple controls must be selected - press the group controls button - control grouping allows you to resize and move multiple controls at the same time, as of now groups are deleted when leaving GUI mode I only have a couple odds and ends to finish up before everything should be complete, I need to add Undo and Redo actions for copying and duplicating controls and a couple other minor things, eventually I want to try to add all of the UDF controls as well. If people are willing to translate the language file I would be very grateful, the ones I have right now are from Google translate, I only used them for testing and have no idea what they say. I want to thank Kip, Prog@ndy, Isi360 and all of the other contributors on this forum, without you guys i don't think i could have written this script. Please post any comments, problems or suggestions, BuckMaster * I only used one "magic number" on my main close case statement, only for faster locating, and i don't care. Form Builder Source.zip Form Builder.zip1 point -
No need anymore to use AutoIt3Wrapper This script allows updating resource Of Autoit executable file script File ResUpdate.zip BeginUpdateResource http://msdn.microsoft.com/en-us/library/windows/desktop/ms648030%28v=vs.85%29.aspx UpdateResource http://msdn.microsoft.com/en-us/library/windows/desktop/ms648049%28v=vs.85%29.aspx EndUpdateResource http://msdn.microsoft.com/en-us/library/windows/desktop/ms648032%28v=vs.85%29.aspx ResUpdate.au3 #Include <WinAPI.au3> #include <Memory.au3> #include <File.au3> ; No need anymore to use AutoIt3Wrapper ;This code allows updating resource Of Autoit executable file $DataStruct = StringToDataStruct("0123456789") $hUpdateArray = BeginUpdateResource("Autoit_WithOut_Upx.exe") if @error Then Exit ;Autoit_WithOut_Upx.exe compression WithOut UPX UpdateResource($hUpdateArray,DllStructGetPtr($DataStruct),DllStructGetSize($DataStruct),"str","str") if @error Then Exit EndUpdateResource($hUpdateArray) if @error Then Exit MsgBox(0,"MSG","Was successfully updated resource") $HModule = _WinAPI_LoadLibrary("Autoit_WithOut_Upx.exe") ; $DataStruct = ResGet("str","str",-1,$HModule) if @error Then Exit $StringStruct = DllStructCreate("char[" & @extended & "]",DllStructGetPtr($DataStruct)) MsgBox(0,"MSG","Was successfully Get resource") MsgBox(0,"Res Data",DllStructGetData($StringStruct,1)) _WinAPI_FreeLibrary($HModule) ResUpdateBitmap("bmp.bmp","Autoit_WithOut_Upx.exe",1) if @error Then Exit MsgBox(0,"MSG","Was successfully updated Bmp resource") $HModule = _WinAPI_LoadLibrary("Autoit_WithOut_Upx.exe") ; $DataStruct = ResGet(1,2,-1,$HModule) if @error Then Exit MsgBox(0,"MSG","Was successfully Get Bmp resource") _WinAPI_FreeLibrary($HModule) Func ResUpdateBitmap($BmpFileName,$Dll_Exe_File,$lpName,$wLanguage = 0,$DelExRes = False) ; $BmpFileName Can Be Null Or Zero To Delete specified Resource Local $DataStruct = 0 if IsString($BmpFileName) Then $DataStruct = FileToDataStruct($BmpFileName,2,14) if @error Then Return SetError(1,0,False) Else if $BmpFileName <> 0 Then Return SetError(1,0,False) EndIf $hUpdateArray = BeginUpdateResource($Dll_Exe_File,$DelExRes) if @error Then Return SetError(2,0,False) if IsString($lpName) Then $lpName = StringUpper($lpName) UpdateResource($hUpdateArray,DllStructGetPtr($DataStruct),DllStructGetSize($DataStruct),2,$lpName) if @error Then Return SetError(3,0,False) EndUpdateResource($hUpdateArray) if @error Then Return SetError(4,0,False) Return True EndFunc Func BeginUpdateResource($Dll_Exe_File,$DelExRes = False) Local $RtImageArray = ExtractPEImage($Dll_Exe_File) if @error Then Return SetError(1,0,0) Local $hFileA = $RtImageArray[0][0]; Dll_Exe_File File Local $hFileB = $RtImageArray[1][0] ; PEImage File Local $PEImage = $RtImageArray[1][1] ; PEImage File Local $hFileC = $RtImageArray[2][0] ; SurplusData File Local $SurplusData = $RtImageArray[2][1] ;SurplusData File _WinAPI_CloseHandle($hFileB) Local $HANDLE = DllCall("kernel32.dll","ptr","BeginUpdateResourceW","wstr",$PEImage,"BOOL",$DelExRes) if @error Or $HANDLE[0] = 0 Then _WinAPI_CloseHandle($hFileA) _WinAPI_CloseHandle($hFileC) Return SetError(2,0,0) EndIf Dim $hUpdateArray[2] $hUpdateArray[0] = $HANDLE[0] $hUpdateArray[1] = $RtImageArray Return $hUpdateArray EndFunc Func UpdateResource($hUpdateArray,$lpData,$cbData,$lpType,$lpName,$wLanguage = 0,$DelExRes = False) if Not IsArray($hUpdateArray) Or UBound($hUpdateArray) < 2 Then Return SetError(1,0,False) Local $hUpdate = $hUpdateArray[0] , $DataType1 = "long" , $DataType2 = "long" if IsString($lpType) Then $DataType1 = "wstr" $lpType = StringUpper($lpType) EndIf if IsString($lpName) Then $DataType2 = "wstr" $lpName = StringUpper($lpName) EndIf Local $BOOL = DllCall("kernel32.dll","BOOL","UpdateResourceW","HANDLE",$hUpdate,$DataType1 _ ,$lpType,$DataType2,$lpName,"WORD",$wLanguage,"ptr",$lpData,"DWORD",$cbData) if @error Or $BOOL[0] = 0 Then Return SetError(2,0,False) Return True EndFunc Func EndUpdateResource($hUpdateArray,$fDiscard = False) if Not IsArray($hUpdateArray) Or UBound($hUpdateArray) < 2 Then Return SetError(1,0,False) Local $hUpdate = $hUpdateArray[0] ,$RtImageArray = $hUpdateArray[1] Local $UB1 = UBound($RtImageArray) , $UB2 = UBound($RtImageArray,2) if Not IsArray($RtImageArray) Or $UB1 < 3 Or $UB2 < 2 Then Return SetError(2,0,False) Local $hFileA = $RtImageArray[0][0]; Dll_Exe_File File Local $Dll_Exe_File = $RtImageArray[0][1]; Dll_Exe_File File Local $hFileB = $RtImageArray[1][0] ; PEImage File Local $PEImage = $RtImageArray[1][1] ; PEImage File Local $hFileC = $RtImageArray[2][0] ; SurplusData File Local $SurplusData = $RtImageArray[2][1] ;SurplusData File $BOOL = DllCall("kernel32.dll","BOOL","EndUpdateResourceW","HANDLE",$hUpdate,"BOOL",$fDiscard) if @error Or $BOOL[0] = 0 Then _WinAPI_CloseHandle($hFileA) _WinAPI_CloseHandle($hFileC) Return SetError(3,0,False) EndIf if ($fDiscard) Then _WinAPI_CloseHandle($hFileA) _WinAPI_CloseHandle($hFileC) Return True EndIf Local $hFileB = _WinAPI_CreateFile($PEImage,2,6) if ($hFileB = 0) Then _WinAPI_CloseHandle($hFileA) _WinAPI_CloseHandle($hFileC) Return SetError(4,0,False) EndIf Local $NewFileSize = _WinAPI_GetFileSizeEx($hFileB) Local $SurplusDataSize = _WinAPI_GetFileSizeEx($hFileC) if ($SurplusDataSize) Then Local $tagSurplusDataData = "BYTE[" & $SurplusDataSize & "]" ReadFromWriteTo($hFileC,0,$hFileB,$NewFileSize,$tagSurplusDataData) if @error Then _WinAPI_CloseHandle($hFileA) _WinAPI_CloseHandle($hFileB) _WinAPI_CloseHandle($hFileC) Return SetError(5,0,False) EndIf EndIf _WinAPI_CloseHandle($hFileA) _WinAPI_CloseHandle($hFileB) _WinAPI_CloseHandle($hFileC) if Not (FileCopy($PEImage,$Dll_Exe_File,1)) Then Return SetError(6,0,False) Return True EndFunc Func ExtractPEImage($Dll_Exe_File) Local $hFileA = _WinAPI_CreateFile($Dll_Exe_File,2,2) if ($hFileA = 0) Then Return SetError(1,0,0) Local $PEImage = _TempFile() , $SurplusData = _TempFile() ;$PEImage // Dll Image File Or Exe Image File ;$SurplusData // File Of AutoitScript Code Or File Of SurplusData Data Local $hFileB = _WinAPI_CreateFile($PEImage ,1,6) if ($hFileB = 0) Then _WinAPI_CloseHandle($hFileA) Return SetError(2,0,0) EndIf Local $hFileC = _WinAPI_CreateFile($SurplusData,1,6) if ($hFileC = 0) Then _WinAPI_CloseHandle($hFileA) _WinAPI_CloseHandle($hFileB) Return SetError(3,0,0) EndIf Local $tagIMAGE_DOS_HEADER = "BYTE[60];dword lfanew" Local $IDH = ReadFromWriteTo($hFileA,0,$hFileB,0,$tagIMAGE_DOS_HEADER) if @error Then _WinAPI_CloseHandle($hFileA) _WinAPI_CloseHandle($hFileB) _WinAPI_CloseHandle($hFileC) Return SetError(4,0,0) EndIf Local $MovePos = DllStructGetData($IDH,"lfanew") Local $tagSignature = "dword Signature" Local $Sge = ReadFromWriteTo($hFileA,$MovePos,$hFileB,$MovePos,$tagSignature) if @error Then _WinAPI_CloseHandle($hFileA) _WinAPI_CloseHandle($hFileB) _WinAPI_CloseHandle($hFileC) Return SetError(5,0,0) EndIf $MovePos += DllStructGetSize($Sge) Local $tagIMAGE_FILE_HEADER = "ushort Machine;ushort NumberOfSections;BYTE[16]" Local $IFH = ReadFromWriteTo($hFileA,$MovePos,$hFileB,$MovePos,$tagIMAGE_FILE_HEADER) if @error Then _WinAPI_CloseHandle($hFileA) _WinAPI_CloseHandle($hFileB) _WinAPI_CloseHandle($hFileC) Return SetError(6,0,0) EndIf Local $NumberOfSections = DllStructGetData($IFH,"NumberOfSections") $MovePos += DllStructGetSize($IFH) Local $tagIMAGE_OPTIONAL_HEADER = "BYTE[60];dword SizeOfHeaders;BYTE[160]" Local $IOH = ReadFromWriteTo($hFileA,$MovePos,$hFileB,$MovePos,$tagIMAGE_OPTIONAL_HEADER) if @error Then _WinAPI_CloseHandle($hFileA) _WinAPI_CloseHandle($hFileB) _WinAPI_CloseHandle($hFileC) Return SetError(7,0,0) EndIf Local $SizeOfHeaders = DllStructGetData($IOH,"SizeOfHeaders") $MovePos += DllStructGetSize($IOH) Local $InfoArray[$NumberOfSections][3] Local $IMAGE_SIZEOF_SHORT_NAME = 8 Local $tagIMAGE_SECTION_HEADER = _ "byte Name[" & $IMAGE_SIZEOF_SHORT_NAME & "];" & _ "dword Misc;" & _ "dword VirtualAddress;" & _ "dword SizeOfRawData;" & _ "dword PointerToRawData;" & _ "dword PointerToRelocations;" & _ "dword PointerToLinenumbers;" & _ "ushort NumberOfRelocations;" & _ "ushort NumberOfLinenumbers;" & _ "dword Characteristics" For $i = 1 To $NumberOfSections Local $ISH = ReadFromWriteTo($hFileA,$MovePos,$hFileB,$MovePos,$tagIMAGE_SECTION_HEADER) if @error Then _WinAPI_CloseHandle($hFileA) _WinAPI_CloseHandle($hFileB) _WinAPI_CloseHandle($hFileC) Return SetError(8,0,0) EndIf $InfoArray[$i - 1][0] = DllStructGetData($ISH,"PointerToRawData") $InfoArray[$i - 1][1] = DllStructGetData($ISH,"SizeOfRawData") $InfoArray[$i - 1][2] = DllStructGetData($ISH,"VirtualAddress") $MovePos += DllStructGetSize($ISH) Next Local $RemainderSize = ($SizeOfHeaders - $MovePos) if ($RemainderSize) Then Local $tagRemainderData = "BYTE[" & $RemainderSize & "]" ReadFromWriteTo($hFileA,$MovePos,$hFileB,$MovePos,$tagRemainderData) if @error Then _WinAPI_CloseHandle($hFileA) _WinAPI_CloseHandle($hFileB) _WinAPI_CloseHandle($hFileC) Return SetError(9,0,0) EndIf EndIf Local $PointerToRawData , $SizeOfRawData , $VirtualAddress , $tagSectionData For $i = 1 To $NumberOfSections $PointerToRawData = $InfoArray[$i - 1][0] $SizeOfRawData = $InfoArray[$i - 1][1] $VirtualAddress = $InfoArray[$i - 1][2] if ($SizeOfRawData) Then $tagSectionData = "BYTE[" & $SizeOfRawData & "]" ReadFromWriteTo($hFileA,$PointerToRawData,$hFileB,$PointerToRawData,$tagSectionData) if @error Then _WinAPI_CloseHandle($hFileA) _WinAPI_CloseHandle($hFileB) _WinAPI_CloseHandle($hFileC) Return SetError(10,0,0) EndIf EndIf Next Local $PEImageSize = _WinAPI_GetFileSizeEx($hFileB) ;Get Size Of Image File WithOut Autoit Script Code Or Get Size Of Image File WithOut Surplus Data Local $Dll_Exe_FileSize = _WinAPI_GetFileSizeEx($hFileA) ;Get Size Of Autoit File With Autoit Script Code or Get Size Of Dll_Exe_File With Surplus Data Local $SurplusDataSize = $Dll_Exe_FileSize - $PEImageSize ;Get Size Of Autoit Script Code Or Get Size Of Surplus Data if ($SurplusDataSize) Then Local $tagSurplusDataData = "BYTE[" & $SurplusDataSize & "]" ReadFromWriteTo($hFileA,$PEImageSize,$hFileC,0,$tagSurplusDataData) if @error Then _WinAPI_CloseHandle($hFileA) _WinAPI_CloseHandle($hFileB) _WinAPI_CloseHandle($hFileC) Return SetError(11,0,0) EndIf EndIf Local $RtImageArray[3][2] $RtImageArray[0][0] = $hFileA ; Dll_Exe_File File $RtImageArray[0][1] = $Dll_Exe_File ; Dll_Exe_File File $RtImageArray[1][0] = $hFileB ; PEImage File $RtImageArray[1][1] = $PEImage ; PEImage File $RtImageArray[2][0] = $hFileC ; SurplusData File $RtImageArray[2][1] = $SurplusData ; SurplusData File Return $RtImageArray EndFunc Func ReadFromWriteTo($FileFrom,$FileFromPos,$FileTo,$FileToPos,$tagDataStruct) Local $nBytes = 0 , $BOOL = 0 _WinAPI_SetFilePointer($FileFrom,$FileFromPos) if @error Then Return SetError(1,0,0) _WinAPI_SetFilePointer($FileTo,$FileToPos) if @error Then Return SetError(2,0,0) Local $DataStruct = DllStructCreate($tagDataStruct) if @error Then Return SetError(3,0,0) Local $DataSize = DllStructGetSize($DataStruct) $BOOL = _WinAPI_ReadFile($FileFrom,DllStructGetPtr($DataStruct),$DataSize,$nBytes) if Not($BOOL) Then Return SetError(4,0,0) $BOOL = _WinAPI_WriteFile($FileTo,DllStructGetPtr($DataStruct),$DataSize,$nBytes) if Not($BOOL) Then Return SetError(5,0,0) Return $DataStruct EndFunc Func FileToDataStruct($FileName,$Flag = 2,$iPos = 0) ;$Flag=1 Return BYTE DataStruct ;$Flag=2 Return Char DataStruct ;iPos Number of bytes to move the file pointer Local $iRead $hFile = _WinAPI_CreateFile($FileName,2,2) if ($hFile = 0) Then Return SetError(1,0,0) _WinAPI_SetFilePointer($hFile,$iPos,0) $FileSize = _WinAPI_GetFileSizeEx($hFile) - $iPos Switch $Flag Case 1 $DataStruct = DllStructCreate("char[" & $FileSize & "]") Case 2 $DataStruct = DllStructCreate("byte[" & $FileSize & "]") Case Else _WinAPI_CloseHandle($hFile) Return SetError(2,0,0) EndSwitch $BOOL = _WinAPI_ReadFile($hFile,DllStructGetPtr($DataStruct),$FileSize,$iRead) if $BOOL = 0 Then _WinAPI_CloseHandle($hFile) Return SetError(3,0,0) EndIf _WinAPI_CloseHandle($hFile) Return $DataStruct EndFunc Func StringToDataStruct($Text) $Len = StringLen($Text) if $Len = 0 Then Return SetError(1,0,0) $DataStruct = DllStructCreate("char[" & $Len & "]") DllStructSetData($DataStruct,1,$Text) Return $DataStruct EndFunc Func ResGet($ResName,$ResType,$ResLanguage = -1,$HModule = 0) Local $DataType1 = "LONG",$DataType2 = "LONG" Local $LPVOID,$HRSRC,$ResSize,$HGLOBAL if IsString($ResName) Then $ResName = StringUpper($ResName) $DataType1 = "WSTR" EndIf If IsString($ResType) Then $ResType = StringUpper($ResType) $DataType2 = "WSTR" EndIf if ($HModule = 0) Then $HModule = _WinAPI_GetModuleHandle(0) if ($ResLanguage <> -1) Then $HRSRC = DllCall("Kernel32.dll","ptr","FindResourceExW","ptr",$HModule,$DataType2, _ $ResType,$DataType1,$ResName,"WORD",$ResLanguage) if @error Or $HRSRC[0] = 0 Then Return SetError(1,0,0) Else $HRSRC = DllCall("Kernel32.dll","ptr","FindResourceW","ptr",$HModule,$DataType1,$ResName,$DataType2, _ $ResType) if @error Or $HRSRC[0] = 0 Then Return SetError(1,0,0) EndIf $HRSRC = $HRSRC[0] $ResSize = DllCall("Kernel32.dll","DWORD","SizeofResource","ptr",$HModule,"ptr",$HRSRC) if (@error Or $ResSize[0] = 0) Then Return SetError(2,0,0) $ResSize = $ResSize[0] $HGLOBAL = DllCall("Kernel32.dll","ptr","LoadResource","ptr",$HModule,"ptr",$HRSRC) if @error Or $HGLOBAL[0] = 0 Then Return SetError(3,0,0) $HGLOBAL = $HGLOBAL[0] $LPVOID = DllCall("Kernel32.dll","ptr","LockResource","ptr",$HGLOBAL) if @error Or $LPVOID[0] = 0 Then $BOOL = DllCall("Kernel32.dll","BOOL","FreeResource","ptr",$HGLOBAL) Return SetError(4,0,0) EndIf $LPVOID = $LPVOID[0] $ByteStruct = DllStructCreate("BYTE[" & $ResSize & "]") _MemMoveMemory($LPVOID,DllStructGetPtr($ByteStruct),$ResSize) $BOOL = DllCall("Kernel32.dll","BOOL","FreeResource","ptr",$HGLOBAL) Return SetError(0,$ResSize,$ByteStruct) EndFunc $Dll_Exe_File The name of the file that we will update its resource $DataStruct Data structure that will be added to the resource If the structure of the data is equal to zero will be deleted specified Resource element $lpType Resource type $lpName Resource Name ,$wLanguage Resource Language $DelExRes If true will Delete all elements of Resource then The new element will be added to the resource If false will only add the new element to the resource1 point
-
Msgbox problem
Underdogger reacted to guinness for a topic
I spelt your username wrong sorry. I will try to remember your name, but I help a lot of users so it may be difficult, especially as I noticed you changed your username the other.1 point -
Msgbox problem
Underdogger reacted to guinness for a topic
Underdogger, For simplicity you could look at ExtMsgBox by Melba23 as this uses the custom GUI functions, which I know you are familiar with as I told you to study the custom _ArrayDisplay I created for you and you promised me.1 point -
Form Builder beta
matwachich reacted to BrewManNH for a topic
@matwachich The source code is available for this, you should probably look at the code and instead of just making request after request, how about doing a little of the work yourself and submit the changes in code to the author? I'm sure he'd appreciate the help and/or the ideas you have put down in some kind of work output from you rather than a list of gripes.1 point -
Good coding practices in AutoIt
matwachich reacted to guinness for a topic
Declare variables when they are needed. ; Do I need to post an example?1 point -
How to set profile pic on forum?
ActualAkshay reacted to stormbreaker for a topic
By this, Chimaera meant to click (primary) on your name-link (ActualAkshay) on the top-right position of the page. And please, don't go blabbering about not seeing changing pc option in Firefox. Its clearly available in firefox. The guy helped you, its just that he couldn't express his views properly (or maybe you couldn't understand his views, though they were proper...)1 point -
GUICtrlCreateInput onevent= enter
matwachich reacted to martin for a topic
Just pressing Enter when the input has focus will cause an event from the input, so this example might be what you need. GUICreate("input with Enter") $ip1 = GUICtrlCreateInput("", 30, 40, 120, 22) GUISetState() While 1 $msg = GUIGetMsg() Switch $msg Case - 3 Exit Case $ip1 MsgBox(262144, "ip1", "enter pressed") EndSwitch WEnd1 point -
GetFileAttributes can get the attributes of a symblic link though a flag for detecting a reparse point. The flag also does a symbolic link so not sure of it's accuracy ensuring for certain of symbolic link detection but it tests OK with my brief check with Vista SP1. ; example: returns true if the file is a symbolic link $var = _ReparsePoint('C:\test.txt') MsgBox(0, '', $var) Func _ReparsePoint($string) Local $FILE_ATTRIBUTE_REPARSE_POINT = 0x400 If Not FileExists($string) Then Return SetError(1, 0, '') EndIf $rc = DllCall('kernel32.dll', 'Int', 'GetFileAttributes', 'str', $string) If IsArray($rc) Then If BitAND($rc[0], $FILE_ATTRIBUTE_REPARSE_POINT) = $FILE_ATTRIBUTE_REPARSE_POINT Then Return True EndIf EndIf Return False EndFunc1 point