LeHuynhNam
Active Members-
Posts
93 -
Joined
-
Last visited
About LeHuynhNam
- Birthday 02/06/1992
Profile Information
-
Location
Next to a coffee
Recent Profile Visitors
500 profile views
LeHuynhNam's Achievements
Wayfarer (2/7)
0
Reputation
-
Need Reg Listview and Treeview Help
LeHuynhNam replied to LeHuynhNam's topic in AutoIt General Help and Support
i found some useful link http://www.autoitscript.com/forum/index.php?showtopic=115334&view=findpost&p=809823 i'm now still try to make my own scripts but seem difficult. I have another Listview question? how could i display (Default) Key name to listview? (Default) key always return "" and doesnt appear on listview -
Two questions about icons and UDF ListView
LeHuynhNam replied to 4ggr35510n's topic in AutoIt General Help and Support
not sure what you mean? If you want to add icon to list view here is my code #include "GuiListView.au3" #include "GuiImageList.au3" $Title = "Add Icon" $RegForm = GUICreate($Title, 757, 498, -1, -1, -1) $ListView = GUICtrlCreateListView("COL1|Col2|Col3|",266, 56, 386, 408, BitOR($LVS_REPORT,$LVS_SINGLESEL,$LVS_SHOWSELALWAYS)) ;Add icon $hImage = _GUIImageList_Create(16, 16, 5, 3) _GUIImageList_AddIcon($hImage, @SystemDir & "\shell32.dll", 7) ;icon1 _GUIImageList_AddIcon($hImage, @SystemDir & "\shell32.dll", 8) ;icon2 _GUICtrlListView_SetImageList($listview, $hImage, 1) _GUICtrlListView_AddItem($ListView,"Icon2",1);set icon2 _GUICtrlListView_AddItem($ListView,"Icon1",0);seticon1 GUISetState(@SW_SHOW) Do Until GUIGetMsg() = -3 -
Thanks KaFu so much I did it. i cant think it is so easy like that
-
Hey Kafu, My program have to Display many Open or Save Dialogs one is Import Dialog, One is Export Dialog,etc And my question is: how can i make _FileSaveDialogEx() as a function which i can modify the Button Text to the text i like whenever i call it? Like that _FileSaveDialogEx("", @MyDocumentsDir, "Text Files (*.txt)", BitOR($OFN_OVERWRITEPROMPT, $OFN_PATHMUSTEXIST, $OFN_DONTADDTORECENT), "", 0, "_FileSave_HookProc",$BtnText) $BTnText is the Text to replace Save text
-
Need Reg Listview and Treeview Help
LeHuynhNam replied to LeHuynhNam's topic in AutoIt General Help and Support
Thanks PsaltyDS yeah, i mean it. i've tried some way but still stuck with it may be i dont have a clearly algorithms to do it Let's me more time to try to solve it whenever i cant do it you will give me some point ok? -
Need Reg Listview and Treeview Help
LeHuynhNam replied to LeHuynhNam's topic in AutoIt General Help and Support
i mean i have 2 problems, the example you said is problem 2. I dont know to display this listview correctly and problem 1(treeview prob) i still unsolve it Edit: Problem 2 solved still have problem 1 -
Thanks KaFu So much Im stuck with it for some days ( i still have a question, i want to change Func _FileSave_HookProc($hWnd, $Msg, $wParam, $lParam) to a Function like _FileSave_HookProc($TxtOKBtn,$TxtCancelBtn,$TitleOfDialog,$hWnd, $Msg, $wParam, $lParam) but when i edit this and change the Text in _FileSave_HookProc() "Import", "Cancel", "Import To"... to $TxtOKBtn.... nothing happen and it change to default OpenDialog
-
I have 2 problem: 1: I want to create a Treeview which display a Registry key and all its subkey and when the Key Expand it has one icon, Collapes has other icon. I've tried some way but failed ( 2: I found a useful UDF (KaFu's _EnumRegKeys2Array() UDF) and i've tried to display it using ListView and still fail Eg: #include <GuiConstantsEx.au3> #include <GuiListView.au3> #include <GuiImageList.au3> $URL = "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run" $Form1 = GUICreate("Form1", 633, 447, 193, 125) $ListView = GUICtrlCreateListView("Name|Type|Data", 16, 24, 602, 406,BitOR($LVS_REPORT,$LVS_EDITLABELS,$LVS_SINGLESEL,$LVS_SHOWSELALWAYS,$LVS_SORTDESCENDING)) _GUICtrlListView_SetUnicodeFormat($ListView, True) _GUICtrlListView_SetColumnWidth($ListView, 0, 120) _GUICtrlListView_SetColumnWidth($ListView, 1, 50) _GUICtrlListView_SetColumnWidth($ListView, 2, 200) $Result = _EnumRegKeys2Array($URL) _Example1() ;_Example2() Func _Example1() For $i = 1 to $Result[0][0] ;_GUICtrlListView_SetItemImage($ListView,0, "C:\Documents and Settings\HippyNotRight\Desktop\New Folder\RegEdit\REG_SZ.ico") _GUICtrlListView_AddItem($ListView,$Result[$i][0],$i) _GUICtrlListView_AddSubItem($ListView,0,$Result[$i][2],1,1) _GUICtrlListView_AddSubItem($ListView, 0,$Result[$i][1],2,2) Next GUISetState(@SW_SHOW) EndFunc Func _Example2() _GUICtrlListView_DeleteAllItems(GUICtrlGetHandle($ListView)) _GUICtrlListView_AddArray($ListView,$Result) GUISetState(@SW_SHOW) EndFunc #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Func _EnumRegKeys2Array($sRegKey) Local Const $REG_NONE = 0 Local Const $REG_SZ = 1 Local Const $REG_EXPAND_SZ = 2 Local Const $REG_BINARY = 3 Local Const $REG_DWORD = 4 Local Const $REG_DWORD_BIG_ENDIAN = 5 Local Const $REG_LINK = 6 Local Const $REG_MULTI_SZ = 7 Local Const $REG_RESOURCE_LIST = 8 Local Const $REG_FULL_RESOURCE_DESCRIPTOR = 9 Local Const $REG_RESOURCE_REQUIREMENTS_LIST = 10 Local Const $REG_QWORD = 11 ; Vista Local $aResult[1][3], $aResult_sub, $i, $y Local $sRegKey_Name, $sRegKey_Value, $sRegKey_Type if stringright($sRegKey,1) <> "\" then $sRegKey = $sRegKey & "\" $aResult[0][0] = "0" $i = 1 while 1 $sRegKey_Name = RegEnumVal($sRegKey, $i) if @error then ExitLoop redim $aResult[ubound($aResult)+1][3] $aResult[ubound($aResult)-1][0] = $sRegKey & $sRegKey_Name $sRegKey_Value = RegRead($sRegKey,$sRegKey_Name) $sRegKey_Type = @extended if $sRegKey_Type = $REG_NONE then $sRegKey_Type = "REG_NONE" if $sRegKey_Type = $REG_SZ then $sRegKey_Type = "REG_SZ" if $sRegKey_Type = $REG_EXPAND_SZ then $sRegKey_Type = "REG_EXPAND_SZ" if $sRegKey_Type = $REG_BINARY then $sRegKey_Type = "REG_BINARY" if $sRegKey_Type = $REG_DWORD then $sRegKey_Type = "REG_DWORD" if $sRegKey_Type = $REG_DWORD_BIG_ENDIAN then $sRegKey_Type = "REG_DWORD_BIG_ENDIAN" if $sRegKey_Type = $REG_LINK then $sRegKey_Type = "REG_LINK" if $sRegKey_Type = $REG_MULTI_SZ then $sRegKey_Type = "REG_MULTI_SZ" if $sRegKey_Type = $REG_RESOURCE_LIST then $sRegKey_Type = "REG_RESOURCE_LIST" if $sRegKey_Type = $REG_FULL_RESOURCE_DESCRIPTOR then $sRegKey_Type = "REG_FULL_RESOURCE_DESCRIPTOR" if $sRegKey_Type = $REG_RESOURCE_REQUIREMENTS_LIST then $sRegKey_Type = "REG_RESOURCE_REQUIREMENTS_LIST" if $sRegKey_Type = $REG_QWORD then $sRegKey_Type = "REG_QWORD" ; Vista $aResult[ubound($aResult)-1][1] = $sRegKey_Value $aResult[ubound($aResult)-1][2] = $sRegKey_Type $i += 1 WEnd $i = 1 while 1 $sRegKey_Name = RegEnumKey($sRegKey, $i) if @error then ExitLoop $aResult_sub = _EnumRegKeys2Array($sRegKey & $sRegKey_Name) if ubound($aResult_sub) > 1 Then for $y = 1 to UBound($aResult_sub)-1 redim $aResult[ubound($aResult)+1][3] $aResult[ubound($aResult)-1][0] = $aResult_sub[$y][0] $aResult[ubound($aResult)-1][1] = $aResult_sub[$y][1] $aResult[ubound($aResult)-1][2] = $aResult_sub[$y][2] next EndIf $i += 1 WEnd $aResult[0][0] = UBound($aResult)-1 return $aResult EndFunc You can see the Eg1 and Eg2 not display the Array correctly. How can i display $result to a Listview? Thanks in advanced!
-
Thanks for replying @KaFu: i have to download AutoIT ver 3.2.10.0 to run Siao's Script and i think Siao use Notepad's Save Dialog and then Customize it by use ControlCommand. I've tried to use ControlSetText to change the Save text to other text but failed Someone can give me a point?
-
Thanks for all reply, Im trying to solve this problem
-
Bump
-
Hey, I try to make a listview display it but fail Can you give me some point? Eg: #include <GuiConstantsEx.au3> #include <GuiListView.au3> #include <GuiImageList.au3> $URL = "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run" $Form1 = GUICreate("Form1", 633, 447, 193, 125) $ListView = GUICtrlCreateListView("Name|Type|Data", 16, 24, 602, 406,BitOR($LVS_REPORT,$LVS_EDITLABELS,$LVS_SINGLESEL,$LVS_SHOWSELALWAYS,$LVS_SORTDESCENDING)) _GUICtrlListView_SetUnicodeFormat($ListView, True) _GUICtrlListView_SetColumnWidth($ListView, 0, 120) _GUICtrlListView_SetColumnWidth($ListView, 1, 50) _GUICtrlListView_SetColumnWidth($ListView, 2, 200) $Result = _EnumRegKeys2Array($URL) _Example1() ;_Example2() Func _Example1() For $i = 1 to $Result[0][0] ;_GUICtrlListView_SetItemImage($ListView,0, "C:\Documents and Settings\HippyNotRight\Desktop\New Folder\RegEdit\REG_SZ.ico") _GUICtrlListView_AddItem($ListView,$Result[$i][0],$i) _GUICtrlListView_AddSubItem($ListView,0,$Result[$i][2],1,1) _GUICtrlListView_AddSubItem($ListView, 0,$Result[$i][1],2,2) Next GUISetState(@SW_SHOW) EndFunc Func _Example2() _GUICtrlListView_DeleteAllItems(GUICtrlGetHandle($ListView)) _GUICtrlListView_AddArray($ListView,$Result) GUISetState(@SW_SHOW) EndFunc #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Func _EnumRegKeys2Array($sRegKey) Local Const $REG_NONE = 0 Local Const $REG_SZ = 1 Local Const $REG_EXPAND_SZ = 2 Local Const $REG_BINARY = 3 Local Const $REG_DWORD = 4 Local Const $REG_DWORD_BIG_ENDIAN = 5 Local Const $REG_LINK = 6 Local Const $REG_MULTI_SZ = 7 Local Const $REG_RESOURCE_LIST = 8 Local Const $REG_FULL_RESOURCE_DESCRIPTOR = 9 Local Const $REG_RESOURCE_REQUIREMENTS_LIST = 10 Local Const $REG_QWORD = 11 ; Vista Local $aResult[1][3], $aResult_sub, $i, $y Local $sRegKey_Name, $sRegKey_Value, $sRegKey_Type if stringright($sRegKey,1) <> "\" then $sRegKey = $sRegKey & "\" $aResult[0][0] = "0" $i = 1 while 1 $sRegKey_Name = RegEnumVal($sRegKey, $i) if @error then ExitLoop redim $aResult[ubound($aResult)+1][3] $aResult[ubound($aResult)-1][0] = $sRegKey & $sRegKey_Name $sRegKey_Value = RegRead($sRegKey,$sRegKey_Name) $sRegKey_Type = @extended if $sRegKey_Type = $REG_NONE then $sRegKey_Type = "REG_NONE" if $sRegKey_Type = $REG_SZ then $sRegKey_Type = "REG_SZ" if $sRegKey_Type = $REG_EXPAND_SZ then $sRegKey_Type = "REG_EXPAND_SZ" if $sRegKey_Type = $REG_BINARY then $sRegKey_Type = "REG_BINARY" if $sRegKey_Type = $REG_DWORD then $sRegKey_Type = "REG_DWORD" if $sRegKey_Type = $REG_DWORD_BIG_ENDIAN then $sRegKey_Type = "REG_DWORD_BIG_ENDIAN" if $sRegKey_Type = $REG_LINK then $sRegKey_Type = "REG_LINK" if $sRegKey_Type = $REG_MULTI_SZ then $sRegKey_Type = "REG_MULTI_SZ" if $sRegKey_Type = $REG_RESOURCE_LIST then $sRegKey_Type = "REG_RESOURCE_LIST" if $sRegKey_Type = $REG_FULL_RESOURCE_DESCRIPTOR then $sRegKey_Type = "REG_FULL_RESOURCE_DESCRIPTOR" if $sRegKey_Type = $REG_RESOURCE_REQUIREMENTS_LIST then $sRegKey_Type = "REG_RESOURCE_REQUIREMENTS_LIST" if $sRegKey_Type = $REG_QWORD then $sRegKey_Type = "REG_QWORD" ; Vista $aResult[ubound($aResult)-1][1] = $sRegKey_Value $aResult[ubound($aResult)-1][2] = $sRegKey_Type $i += 1 WEnd $i = 1 while 1 $sRegKey_Name = RegEnumKey($sRegKey, $i) if @error then ExitLoop $aResult_sub = _EnumRegKeys2Array($sRegKey & $sRegKey_Name) if ubound($aResult_sub) > 1 Then for $y = 1 to UBound($aResult_sub)-1 redim $aResult[ubound($aResult)+1][3] $aResult[ubound($aResult)-1][0] = $aResult_sub[$y][0] $aResult[ubound($aResult)-1][1] = $aResult_sub[$y][1] $aResult[ubound($aResult)-1][2] = $aResult_sub[$y][2] next EndIf $i += 1 WEnd $aResult[0][0] = UBound($aResult)-1 return $aResult EndFunc You can see the Eg1 and Eg2 not display the Array correctly. How can i display $result to a Listview? another Question: How can i add an icon to a Listview Item? Thanks in advanced!
-
I think if we have a virus which disable regedit 2 codes are Unable to run I use it script but dont know why doesn't it run? 1st time i run it worked well but now isnt working $URL = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" $MyDocsFolder = "::{450D8FBA-AD25-11D0-98A8-0800361B1103}" $var = FileSaveDialog( "Save to a registry file (*.reg)", $MyDocsFolder, "Registry Files (*.reg)", 2+16) If Not @error Then ;MsgBox(0,"","REGEDIT /E "& FileGetShortName($var)&".reg "&''&_GUICtrlStatusBar_GetText ($StatusBar, 1)&'') _RunDOS("REGEDIT /E "& '"'&FileGetShortName($var)& '.reg" "'&$URL&'"') EndIf
-
png Background and png button help me???
LeHuynhNam replied to loveau3's topic in AutoIt GUI Help and Support
Hope This Help #include <GDIPlus.au3>; this is where the magic happens, people #include<IE.au3> #include <WindowsConstants.au3> #include <GuiConstantsEx.au3> #include <GuiImageList.au3> $dll=DllOpen("user32.dll") _GDIPlus_Startup() #Region ### START Koda GUI section ### Form= $gui1 = GUICreate("Form1", 744, 464, 233, 359, BitOR($WS_MAXIMIZEBOX,$WS_MINIMIZEBOX,$WS_SIZEBOX,$WS_THICKFRAME,$WS_DLGFRAME,$WS_GROUP,$WS_TABSTOP)) GUISetState(@SW_SHOW) $hImage = _GDIPlus_ImageLoadFromFile(@ScriptDir&"\01.png") $hImage1 = _GDIPlus_ImageLoadFromFile(@ScriptDir&"\02.png") ; Extract image width and height from PNG $hImage2 = _GDIPlus_ImageLoadFromFile(@ScriptDir&"\03.png") $gui2 = GUICreate("Form1", 0, 0, 500,300,$WS_POPUP,BitOR($WS_EX_LAYERED,$WS_EX_MDICHILD),$gui1) SetBitmap($gui2,$hImage,255) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 buttonpng($gui2,$hImage,$hImage1,$hImage2) $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Func SetBitmap($hGUI, $hImage, $iOpacity) Local $hScrDC, $hMemDC, $hBitmap, $hOld, $pSize, $tSize, $pSource, $tSource, $pBlend, $tBlend $hScrDC = _WinAPI_GetDC(0) $hMemDC = _WinAPI_CreateCompatibleDC($hScrDC) $hBitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hImage) $hOld = _WinAPI_SelectObject($hMemDC, $hBitmap) $tSize = DllStructCreate($tagSIZE) $pSize = DllStructGetPtr($tSize) DllStructSetData($tSize, "X", _GDIPlus_ImageGetWidth($hImage)) DllStructSetData($tSize, "Y", _GDIPlus_ImageGetHeight($hImage)) $tSource = DllStructCreate($tagPOINT) $pSource = DllStructGetPtr($tSource) $tBlend = DllStructCreate($tagBLENDFUNCTION) $pBlend = DllStructGetPtr($tBlend) DllStructSetData($tBlend, "Alpha", $iOpacity) DllStructSetData($tBlend, "Format", 1) _WinAPI_UpdateLayeredWindow($hGUI, $hScrDC, 0, $pSize, $hMemDC, $pSource, 0, $pBlend, $ULW_ALPHA) _WinAPI_ReleaseDC(0, $hScrDC) _WinAPI_SelectObject($hMemDC, $hOld) _WinAPI_DeleteObject($hBitmap) _WinAPI_DeleteDC($hMemDC) EndFunc ;==>SetBitmap func buttonpng($guicanset,$anh1,$anh2,$anh3) if hander()=$guicanset then SetBitmap($guicanset,$anh2,255) Do if event() then Do if hander()<>$guicanset then SetBitmap($guicanset,$anh1,255) Else SetBitmap($guicanset,$anh3,255) EndIf Until not event() if hander()=$guicanset then SetBitmap($guicanset,$anh2,255) MsgBox(0,"","Sample Button") EndIf EndIf Until hander()<>$guicanset SetBitmap($guicanset,$anh1,255) EndIf EndFunc Func hander() Local $iRet = DllCall("user32.dll", "int", "WindowFromPoint", "long", MouseGetPos(0), "long", MouseGetPos(1)) If IsArray($iRet) Then Return HWnd($iRet[0]) Return SetError(1, 0, 0) EndFunc Func event($sHexKey="01", $vDLL = $dll) ; $hexKey must be the value of one of the keys. ; _Is_Key_Pressed will return 0 if the key is not pressed, 1 if it is. Local $a_R = DllCall($vDLL, "short", "GetAsyncKeyState", "int", '0x' & $sHexKey) If @error Then Return SetError(@error, @extended, False) Return BitAND($a_R[0], 0x8000) <> 0 EndFunc ;==>_IsPressed Button.zip -
Yeah, i want to Replace Open Text in Button with other Text I like eg: Export, Import