Leaderboard
Popular Content
Showing content with the highest reputation on 07/16/2018 in all areas
-
Icon for compiled script disappears!
FrancescoDiMuro and one other reacted to Earthshine for a topic
nope. just tested it on a clean vm with just exe. you need use the Compile in the Tools menu, go select the icon you need and it embeds it. if you compile from explorer context menu or otherwise, it probably won't embed the resource. go test it.2 points -
howto StdOutRead() for EXE writing to "same position" all the time?
FrancescoDiMuro reacted to careca for a topic
Can you send the files needed so I can reproduce this? you provided a lot of information to get my head around, bit confusing, not sure if you just want the count or the actual packets.1 point -
My program won't run
KickStarter15 reacted to careca for a topic
Can we all just stop replying until there's code to work with?1 point -
This is a known problem. Replace Return _WinAPI_CallWindowProc($g_LV_OldWndProc, $hWnd, $uMsg, $wParam, $lParam) with Return DllCall("user32.dll", "lresult", "CallWindowProc", "ptr", $g_LV_OldWndProc, "hwnd", $hWnd, "uint", $uMsg, "wparam", $wParam, "lparam", $lParam)[0] You should use _WinAPI_SetWindowSubclass() and related functions for subclassing.1 point
-
What is the exact location of firefox? "Program files" or "Program files (86)"? Jos1 point
-
Icon for compiled script disappears!
FrancescoDiMuro reacted to Earthshine for a topic
nice avatar Skeletor, I mean, Blanka is cool, but that fits your name1 point -
I think the device has not Unique ID so It's generate by the system. check here: It says: Note: If the second character of the unique instance ID is a '&', then the ID was generated by the system, as the device did not have a serial number. Saludos1 point
-
Minimised Virtual keyboard.
badcoder123 reacted to FrancescoDiMuro for a topic
@caramen Did you try WinSetState()? I just tried to minimize osk.exe, and I got 23 as WinGetState() result1 point -
1 point
-
I know this is pretty old now but i was trying to get comms accross local system, admin and limited users for months in windows 10 and was just not having any luck with anything at all. ended up finding this solution, CreateFileW kernel32 dll call to create the handle to write the message in mailslot.au3 had to be changed because it still worked between admin and another limited user as it was, but not from local system to any other user. had to change the file attributes to normal instead of the original flag $SECURITY_ANONYMOUS. see below only after this would the security attributes pointer used to create the mailslot actually take affect on the system account. Func _MailSlotWrite($sMailSlotName, $vData, $iMode = 0) Local $aCall = DllCall("kernel32.dll", "ptr", "CreateFileW", _ "wstr", $sMailSlotName, _ "dword", 0x40000000, _ ; GENERIC_WRITE "dword", 1, _ ; FILE_SHARE_READ "ptr", 0, _ ; lp security attributes (ignored on open existing) "dword", 3, _ ; OPEN_EXISTING "dword", 128, _ ; 0, _ ; SECURITY_ANONYMOUS replaced with file attribute normal 128 "ptr", 0) ; ......... above now works when creating the mailslot with a security pointer which i have used permissions.au3 udf to create, shown below. #include "MailSlot.au3" #include <Permissions.au3> Global Const $sMailSlotName = "\\.\mailslot\SampleCrossSessonMailslot" Global $ptrSecurityDescriptor = _ConvertStringSecurityDescriptorToSecurityDescriptor("O:BAD:(A;OICI;GRGW;;;AU)(A;OICI;GA;;;BA)(A;OICI;GA;;;SY)") If @error Then Global $aError = DllCall("kernel32.dll", "dword", "GetLastError") if not @Compiled Then ConsoleWrite("err: " & $aError[0] & @CR) EndIf Global $tSecurityAttributes = DllStructCreate("dword Length;ptr Descriptor;bool InheritHandle") DllStructSetData($tSecurityAttributes, 1, DllStructGetSize($tSecurityAttributes)) DllStructSetData($tSecurityAttributes, 2, DllStructGetPtr($ptrSecurityDescriptor)) DllStructSetData($tSecurityAttributes, 3, 0) ; InheritHandle = FALSE Global $hMailSlot = _MailSlotCreate($sMailSlotName,0,0,$tSecurityAttributes) hopefully this saves someone else from banging their head against the wall.1 point
-
Selecting Multiple ListView Items with the Mouse
FrancescoDiMuro reacted to careca for a topic
#include <GUIConstantsEx.au3> #include <MsgBoxConstants.au3> #include <WindowsConstants.au3> #include <ListViewConstants.au3> Example() Func Example() GUICreate("listview items", 220, 250, 100, 200, -1, $WS_EX_ACCEPTFILES) GUISetBkColor(0x00E0FFFF) ; will change background color Local $idListview = GUICtrlCreateListView("col1 |col2|col3 ", 10, 10, 200, 150,BitOR($LVS_SHOWSELALWAYS, $LVS_REPORT)) Local $idButton = GUICtrlCreateButton("Value?", 75, 170, 70, 20) Local $idItem1 = GUICtrlCreateListViewItem("item2|col22|col23", $idListview) Local $idItem2 = GUICtrlCreateListViewItem("item1|col12|col13", $idListview) Local $idItem3 = GUICtrlCreateListViewItem("item3|col32|col33", $idListview) Local $idItem3 = GUICtrlCreateListViewItem("item23|col632|col3433", $idListview) Local $idItem3 = GUICtrlCreateListViewItem("items3|col332|col7533", $idListview) GUICtrlCreateInput("", 20, 200, 150) GUICtrlSetState(-1, $GUI_DROPACCEPTED) ; to allow drag and dropping GUISetState(@SW_SHOW) GUICtrlSetData($idItem2, "ITEM1") GUICtrlSetData($idItem3, "||COL33") GUICtrlDelete($idItem1) ; Loop until the user exits. While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop Case $idButton MsgBox($MB_SYSTEMMODAL, "listview item", GUICtrlRead(GUICtrlRead($idListview)), 2) Case $idListview MsgBox($MB_SYSTEMMODAL, "listview", "clicked=" & GUICtrlGetState($idListview), 2) EndSwitch WEnd EndFunc ;==>Example Straight from the help file example with just 1 modification.1 point -
I'm no sure how is designed ObjGet internally but probably a minor bug because I did a test using ROT which is fast enough. Test Script: #include <Excel.au3> #include <Array.au3> #include <WinAPI.au3> Global Const $sIID_IEnumMoniker = '{00000102-0000-0000-c000-000000000046}' Global Const $sTagIEnumMoniker = "Next hresult(dword;ptr*;dword*);" & _ "Skip hresult(dword);" & _ "Reset hresult();" & _ "Clone hresult(ptr*);" Global Const $sIID_IMoniker = '{0000000f-0000-0000-C000-000000000046}' Global Const $sTagIMoniker = "GetClassID hresult( clsid )" & _ "IsDirty hresult( );" & _ "Load hresult( ptr );" & _ "Save hresult( ptr, bool );" & _ "GetSizeMax hresult( uint64 );" & _ "BindToObject hresult( ptr;ptr;clsid;idispatch*);" & _ "BindToStorage hresult( ptr;ptr;clsid;ptr*);" & _ "Reduce hresult( ptr;dword;ptr*;ptr*);" & _ "ComposeWith hresult( ptr;bool;ptr*);" & _ "Enum hresult( bool;ptr*);" & _ "IsEqual hresult( ptr);" & _ "Hash hresult( dword*);" & _ "IsRunning hresult( ptr;ptr;ptr);" & _ "GetTimeOfLastChange hresult( ptr;ptr;int64*);" & _ "Inverse hresult( ptr*);" & _ "CommonPrefixWith hresult( ptr;ptr*);" & _ "RelativePathTo hresult( ptr;ptr*);" & _ "GetDisplayName hresult( ptr;ptr;wstr*);" & _ "ParseDisplayName hresult( ptr;ptr;wstr;ulong*;ptr*);" & _ "IsSystemMoniker hresult( dword*);" Global Const $IID_IRunningObjectTable = "{00000010-0000-0000-C000-000000000046}" Global Const $sTagIRunningObjectTable = "Register HRESULT(DWORD;PTR;PTR;DWORD*);" & _ "Revoke HRESULT(DWORD);" & _ "IsRunning HRESULT(PTR*);" & _ "GetObject HRESULT(PTR;PTR*);" & _ "NoteChangeTime HRESULT(DWORD;PTR*);" & _ "GetTimeOfLastChange HRESULT(PTR*;PTR*);" & _ "EnumRunning HRESULT(PTR*);" Global Const $IID_IDispatch = "{00020400-0000-0000-C000-000000000046}" Local $oExcel1 = _Excel_Open() Local $oExcel2 = _Excel_Open(True, False, True, True, True) Local $oExcel3 = _Excel_Open(True, False, True, True, True) For $i = 1 To 5 _Excel_BookNew($oExcel1, 1) _Excel_BookNew($oExcel2, 1) _Excel_BookNew($oExcel3, 1) Next Local $hTimer = TimerInit() Local $aWorkBooks = _Excel_BookListEx() _ArrayDisplay($aWorkBooks, " _Excel_BookListEx Time: " & TimerDiff($hTimer)) _Excel_Close($oExcel1) _Excel_Close($oExcel2) _Excel_Close($oExcel3) Func _Excel_BookListEx($oExcel = Default) Local $aBooks[0][3], $iIndex = 0 If IsObj($oExcel) Then If ObjName($oExcel, 1) <> "_Application" Then Return SetError(1, 0, 0) Local $iTemp = $oExcel.Workbooks.Count ReDim $aBooks[$iTemp][3] For $iIndex = 0 To $iTemp - 1 $aBooks[$iIndex][0] = $oExcel.Workbooks($iIndex + 1) $aBooks[$iIndex][1] = $oExcel.Workbooks($iIndex + 1).Name $aBooks[$iIndex][2] = $oExcel.Workbooks($iIndex + 1).Path Next Else If $oExcel <> Default Then Return SetError(1, 0, 0) Local $aCall = DllCall("Ole32.dll", "LONG", "GetRunningObjectTable", "DWORD", 0, "PTR*", 0) Local $pIRunningObjectTable = $aCall[2] Local $oRunningObjectTable = ObjCreateInterface($pIRunningObjectTable, $IID_IRunningObjectTable, $sTagIRunningObjectTable) Local $pIEnumMoniker = 0 $oRunningObjectTable.EnumRunning($pIEnumMoniker) Local $oEnumMoniker = ObjCreateInterface($pIEnumMoniker, $sIID_IEnumMoniker, $sTagIEnumMoniker) Local $pMoniker = 0 Local $iFetched = 0 Local $oMoniker = 0 Local $pCTX = 0 Local $oWorkBook = 0 $aCall = DllCall("Ole32.dll", "long", "CreateBindCtx", "dword", 0, "ptr*", 0) $pCTX = $aCall[2] While $oEnumMoniker.Next(1, $pMoniker, $iFetched) = 0 $oMoniker = ObjCreateInterface($pMoniker, $sIID_IMoniker, $sTagIMoniker) $oMoniker.BindToObject($pCTX, 0, $IID_IDispatch, $oWorkBook) If IsObj($oWorkBook) Then ReDim $aBooks[UBound($aBooks)+1][3] $aBooks[$iIndex][0] = $oWorkBook $aBooks[$iIndex][1] = $oWorkBook.Name $aBooks[$iIndex][2] = $oWorkBook.Path $iIndex+=1 EndIf WEnd EndIf Return ($iIndex > 0 ? SetError(0, $iIndex, $aBooks) : SetError(1, 0, $aBooks)) EndFunc ;==>_Excel_BookListEx Saludos1 point
-
How to center the text in a group box
Xandy reacted to InunoTaishou for a topic
The group control is just a button so you need to use a button style flag and include the ButtonConstants.au3 #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <EditConstants.au3> #include <ButtonConstants.au3> Example() Func Example() Local $flags = 0, $iMsg = 0 GUICreate("My GUI group") GUICtrlCreateGroup("Group 1", 10, 20, 190, 140, BitOr($WS_THICKFRAME, $BS_CENTER)) ; I want to cnter "Group 1" GUICtrlCreateRadio("Radio 1", 20, 50, 50, 20) GUICtrlCreateRadio("Radio 2", 20, 70, 60, 50) GUICtrlCreateGroup("", -99, -99, 1, 1) GUISetState(@SW_SHOW) ; Loop until the user exits. While 1 $iMsg = GUIGetMsg() If $iMsg = $GUI_EVENT_CLOSE Then ExitLoop WEnd EndFunc ;==>Example1 point -
1 point
-
Use Return For example Func _DoNothingMuch() Sleep(2000) Return Sleep(2000) EndFunc This will sleep two seconds, and then exit... so the next Sleep(2000) is useless.1 point