Leaderboard
Popular Content
Showing content with the highest reputation on 02/14/2015 in all areas
-
If you mean the value populating the listview cell, then yes... #include <GUIConstantsEx.au3> #include <GuiListView.au3> #include <WindowsConstants.au3> $Form1 = GUICreate("Form1", 350, 250, -1, -1) $ListView1 = GUICtrlCreateListView("Header|Header|Header", 0, 0, 350, 250) GuiCtrlCreateListViewItem('Black|Black|Black',$ListView1) GuiCtrlCreateListViewItem('Black|xxxxx|Black',$ListView1) GuiCtrlCreateListViewItem('Black|Black|Black',$ListView1) GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY") GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Func WM_NOTIFY($hWnd, $Msg, $wParam, $lParam) Local $tNMHDR, $hWndFrom, $iCode $tNMHDR = DllStructCreate($tagNMHDR, $lParam) $hWndFrom = DllStructGetData($tNMHDR, "hWndFrom") $iCode = DllStructGetData($tNMHDR, "Code") $hListView = GuiCtrlGetHandle($ListView1) Switch $hWndFrom Case $hListView Switch $iCode Case $NM_CUSTOMDRAW Local $tCustDraw = DllStructCreate($tagNMLVCUSTOMDRAW, $lParam) Local $iDrawStage = DllStructGetData($tCustDraw, "dwDrawStage") If $iDrawStage = $CDDS_PREPAINT Then Return $CDRF_NOTIFYITEMDRAW If $iDrawStage = $CDDS_ITEMPREPAINT Then Return $CDRF_NOTIFYSUBITEMDRAW Local $iSubItem = DllStructGetData($tCustDraw, "iSubItem") Local $iItem = DllStructGetData($tCustDraw, "dwItemSpec") Local $iColor If $iItem = 1 and $iSubItem = 1 Then $iColor = RGB2BGR(0xcc0000) DllStructSetData($tCustDraw, "clrText", $iColor) Return $CDRF_NEWFONT EndSwitch EndSwitch Return $GUI_RUNDEFMSG EndFunc ;==>WM_NOTIFY Func RGB2BGR($iColor) Return BitAND(BitShift(String(Binary($iColor)), 8), 0xFFFFFF) EndFunc ;==>RGB2BGR() kylomas edit: Stick to one thread per question please. You asked the same question >here. If you are not getting a timely response (at least 24 hours) then open your own thread.2 points
-
A single function to convert UTC to/from local time, and/or change the time string representation format. the function accepts a time string (in various formats), a conversion flag, existing input format, and desired output format. all parameters are optional. Note #1: It is understood that core functionality of this UDF can be achieved by the built-in _Date_Time_* functions of the Date UDF - but these are too complex to be used, unless you are a programmer experienced with DLL structs and pointers. Note #2: UTC conversion will return incorrect results for dates for which your system has no DST configured. for example, dates earlier than 1970, or dates in the not-too-near future, or years where your country changed it's DST settings for political reasons and it was not updated in retrospect by Microsoft. UDF (v2.2): #include-Once #include 'TimeConvertConstants.au3' ; #INDEX# ======================================================================================================================= ; Title .........: TimeConvert ; AutoIt Version : 3.3.10.2 ; UDF Version ...: 2.2 ; Status ........: Production ; Language ......: English ; Description ...: A single function to convert UTC to/from local time, and/or change the time string representation format. ; It is understood that core functionality of this UDF can be achieved by the built-in _Date_Time_* functions of ; the Date UDF - but these are too complex to be used, unless you are a programmer experienced with DLL structs ; and pointers. ; Dll ...........: kernel32.dll ; Author(s) .....: orbs ; =============================================================================================================================== ; #CURRENT# ===================================================================================================================== ;_TimeConvert ; =============================================================================================================================== ; #FUNCTION# ==================================================================================================================== ; Name ..........: _TimeConvert ; Description ...: Converts UTC to/from local time, and/or changes the time string representation format. ; Syntax.........: _TimeConvert([$sTime = ''[, $iUTC_Convert = $__TIMECONVERT_CONVERT_NONE[, $sFormatInput = $__TIMECONVERT_FORMAT_SYSTEM[, $sFormatOutput = $__TIMECONVERT_FORMAT_SYSTEM]]]]) ; Parameters ....: $sTime - [optional] A string representation of the time to process. ; $iUTC_Convert - [optional] Instructs the function to convert $sTime as follows: ; $__TIMECONVERT_CONVERT_NONE (0) - (default) Do not convert ; $__TIMECONVERT_CONVERT_UTC_TO_LOCAL (1) - Convert from UTC to local time ; $__TIMECONVERT_CONVERT_LOCAL_TO_UTC (-1) - Convert from local time to UTC ; $sFormatInput - [optional] Specifies the format of $sTime as follows: ; $__TIMECONVERT_FORMAT_SYSTEM ("YYYYMMDDHHNNSS") - (default) 14-digits time stamp. ; $__TIMECONVERT_FORMAT_LOGICAL ("YYYY/MM/DD HH:NN:SS") ; $__TIMECONVERT_FORMAT_UK ("DD/MM/YYYY HH:NN:SS") ; $__TIMECONVERT_FORMAT_US ("MM/DD/YYYY HH:NN:SS") ; $__TIMECONVERT_FORMAT_LOGICAL_WIDE ("YYYY/MM/DD HH:NN:SS") ; $__TIMECONVERT_FORMAT_UK_WIDE ("DD/MM/YYYY HH:NN:SS") ; $__TIMECONVERT_FORMAT_US_WIDE ("MM/DD/YYYY HH:NN:SS") ; $__TIMECONVERT_FORMAT_US_LITERAL_LONG ("MMMM DTH, YYYY, H:NN PM") ; $__TIMECONVERT_FORMAT_US_LITERAL_SHORT ("MMM-DD YYYY, H:NN PM") ; $sFormatOutput - [optional] Specifies the desired format of the return value. Use same values as $sFormatInput ; Return values .: Success - Returns the conversion result. ; Failure - Returns the partly-processed input and sets @error to 1. ; Author ........: orbs ; Modified ......: ; Remarks .......: - Constants are defined in the file "TimeConvertConstants.au3". ; - The predefined formats for $sFormatInput and $sFormatOutput are common but not exhaustive, and you can ; define your own custom formats as you see fit. ; - Note that WIDE values for $sFormatInput and $sFormatOutput have two spaces between date and time substrings. ; You can find the wide format commonly used by Excel. ; - All parameters are optional; if all are omitted, the return value is the current local time as a 14-digits ; time stamp ("YYYYMMDDHHNNSS"). ; Related .......: ; Link ..........: ; Example .......: Yes ; =============================================================================================================================== Func _TimeConvert($sTime = '', $iUTC_Convert = $__TIMECONVERT_CONVERT_NONE, $sFormatInput = $__TIMECONVERT_FORMAT_SYSTEM, $sFormatOutput = $__TIMECONVERT_FORMAT_SYSTEM) ; >>> bug workaround = for some reason, default values do not apply when script passes "Default" as parameter If $sTime = '' Then $sTime = @YEAR & @MON & @MDAY & @HOUR & @MIN & @SEC If $iUTC_Convert = Default Then $iUTC_Convert = $__TIMECONVERT_CONVERT_NONE If $sFormatInput = Default Then $sFormatInput = $__TIMECONVERT_FORMAT_SYSTEM If $sFormatOutput = Default Then $sFormatOutput = $__TIMECONVERT_FORMAT_SYSTEM ; >>> end of bug workaround ; sanitize input for default format If $sFormatInput = $__TIMECONVERT_FORMAT_SYSTEM And (StringLen($sTime) <> 14 Or Not StringIsDigit($sTime)) Then Return SetError(1, 0, $sTime) Local Const $tagSYSTEMTIME = 'struct;word Year;word Month;word Dow;word Day;word Hour;word Minute;word Second;word MSeconds;endstruct' Local $sYYYY, $sYY, $sMMMM, $sMMM, $sMM, $sDTH, $sDD, $sD, $sHH, $sH, $sPM, $sNN, $sSS Local $aMonths[12] = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'] Local $iMonth Local $iMonthNameMaxLength = 9 ; length of "September" Local $tSystemTime_BeforeConversion, $tSystemTime_AfterConversion If $sFormatInput <> $__TIMECONVERT_FORMAT_SYSTEM Then $sYYYY = StringMid($sTime, StringInStr($sFormatInput, 'YYYY', 1), 4) If $sYYYY = '' Then $sYYYY = @YEAR $sYY = StringRight($sYYYY, 2) $sMMMM = StringMid($sTime, StringInStr($sFormatInput, 'MMMM', 1), $iMonthNameMaxLength) If $sMMMM = '' Then ; no long month, maybe there is abbr month $sMMM = StringMid($sTime, StringInStr($sFormatInput, 'MMM', 1), 3) If $sMMM = '' Then ; no abbr month, maybe there is numeric month $sMM = StringMid($sTime, StringInStr($sFormatInput, 'MM', 1), 2) Else ; there is abbr month, process it For $iMonth = 0 To UBound($aMonths) - 1 If StringLeft($aMonths[$iMonth], 3) = $sMMM Then $sMM = StringFormat('%02i', $iMonth + 1) Next EndIf Else ; there is long month, process it For $iMonth = 0 To UBound($aMonths) - 1 If $aMonths[$iMonth] = StringLeft($sMMMM, StringLen($aMonths[$iMonth])) Then $sMM = StringFormat('%02i', $iMonth) Next EndIf If $sMM = '' Then $sMM = @MON $sDD = StringMid($sTime, StringInStr($sFormatInput, 'DD', 1), 2) If $sDD = '' Then ; no DD, maybe there is DTH $sDTH = StringMid($sTime, StringInStr($sFormatInput, 'DTH', 1), 4) If $sDTH = '' Then ; no DTH, maybe there is D $sD = StringMid($sTime, StringInStr($sFormatInput, 'D', 1), 2) If StringIsDigit($sD) Then ; 2-digits day $sDD = $sD ElseIf StringIsDigit(StringLeft($sD, 1)) Then ; 1-digit day $sDD = '0' & StringLeft($sD, 1) EndIf Else ; DTH If StringIsDigit(StringMid($sDTH, 2, 1)) Then ; 2-digits day $sDD = StringLeft($sDTH, 2) Else ; 1-digit day $sDD = '0' & StringLeft($sDTH, 1) EndIf EndIf EndIf If Number($sDD) = 0 Then $sDD = @MDAY $sHH = StringMid($sTime, StringInStr($sFormatInput, 'HH', 1), 2) If $sHH = '' Then ; no HH, maybe there is H $sH = StringMid($sTime, StringInStr($sFormatInput, 'H', 1), 2) If StringIsDigit($sH) Then ; 2-digits hour $sHH = $sH ElseIf StringIsDigit(StringLeft($sH, 1)) Then ; 1-digit hour $sHH = '0' & StringLeft($sH, 1) Else $sHH = @HOUR EndIf EndIf If StringInStr($sFormatInput, 'PM', 1) And StringInStr($sTime, 'pm', 1) Then $sHH = StringFormat('%02i', Number($sHH) + 12) $sNN = StringMid($sTime, StringInStr($sFormatInput, 'NN', 1), 2) If $sNN = '' Then $sNN = @MIN $sSS = StringMid($sTime, StringInStr($sFormatInput, 'SS', 1), 2) If $sSS = '' Then $sSS = @SEC $sTime = $sYYYY & $sMM & $sDD & $sHH & $sNN & $sSS EndIf If Not (StringIsDigit($sTime) And StringLen($sTime) = 14) Then Return SetError(1, 0, $sTime) If $iUTC_Convert = $__TIMECONVERT_CONVERT_LOCAL_TO_UTC Or $iUTC_Convert = $__TIMECONVERT_CONVERT_UTC_TO_LOCAL Then $sYYYY = StringLeft($sTime, 4) $sMM = StringMid($sTime, 5, 2) $sDD = StringMid($sTime, 7, 2) $sHH = StringMid($sTime, 9, 2) $sNN = StringMid($sTime, 11, 2) $sSS = StringMid($sTime, 13, 2) $tSystemTime_BeforeConversion = DllStructCreate($tagSYSTEMTIME) DllStructSetData($tSystemTime_BeforeConversion, 'Month', $sMM) DllStructSetData($tSystemTime_BeforeConversion, 'Day', $sDD) DllStructSetData($tSystemTime_BeforeConversion, 'Year', $sYYYY) DllStructSetData($tSystemTime_BeforeConversion, 'Hour', $sHH) DllStructSetData($tSystemTime_BeforeConversion, 'Minute', $sNN) DllStructSetData($tSystemTime_BeforeConversion, 'Second', $sSS) $tSystemTime_AfterConversion = DllStructCreate($tagSYSTEMTIME) If $iUTC_Convert = $__TIMECONVERT_CONVERT_LOCAL_TO_UTC Then DllCall('kernel32.dll', 'bool', 'TzSpecificLocalTimeToSystemTime', 'ptr', 0, 'ptr', DllStructGetPtr($tSystemTime_BeforeConversion), 'struct*', $tSystemTime_AfterConversion) Else DllCall('kernel32.dll', 'bool', 'SystemTimeToTzSpecificLocalTime', 'ptr', 0, 'ptr', DllStructGetPtr($tSystemTime_BeforeConversion), 'struct*', $tSystemTime_AfterConversion) EndIf $sTime = StringFormat('%04d%02d%02d%02d%02d%02d', _ DllStructGetData($tSystemTime_AfterConversion, 'Year'), _ DllStructGetData($tSystemTime_AfterConversion, 'Month'), _ DllStructGetData($tSystemTime_AfterConversion, 'Day'), _ DllStructGetData($tSystemTime_AfterConversion, 'Hour'), _ DllStructGetData($tSystemTime_AfterConversion, 'Minute'), _ DllStructGetData($tSystemTime_AfterConversion, 'Second')) EndIf If $sFormatOutput <> $__TIMECONVERT_FORMAT_SYSTEM Then $sYYYY = StringLeft($sTime, 4) $sYY = StringRight($sYYYY, 2) $sMM = StringMid($sTime, 5, 2) $sMMMM = $aMonths[Number($sMM) - 1] $sMMM = StringLeft($sMMMM, 3) $sDD = StringMid($sTime, 7, 2) $sD = String(Number($sDD)) Switch $sD Case '1' $sDTH = $sD & 'st' Case '2' $sDTH = $sD & 'nd' Case Else $sDTH = $sD & 'th' EndSwitch $sHH = StringMid($sTime, 9, 2) $sPM = 'am' If StringInStr($sFormatOutput, 'PM', 1) And Number($sHH) > 12 Then $sHH = StringFormat('%02i', Number($sHH) - 12) $sPM = 'pm' EndIf $sH = String(Number($sHH)) $sNN = StringMid($sTime, 11, 2) $sSS = StringMid($sTime, 13, 2) $sTime = $sFormatOutput $sTime = StringReplace($sTime, 'YYYY', $sYYYY, 0, 1) $sTime = StringReplace($sTime, 'YY', $sYY, 0, 1) $sTime = StringReplace($sTime, 'DTH', $sDTH, 0, 1) $sTime = StringReplace($sTime, 'DD', $sDD, 0, 1) $sTime = StringReplace($sTime, 'D', $sD, 0, 1) $sTime = StringReplace($sTime, 'HH', $sHH, 0, 1) $sTime = StringReplace($sTime, 'H', $sH, 0, 1) $sTime = StringReplace($sTime, 'PM', $sPM, 0, 1) $sTime = StringReplace($sTime, 'NN', $sNN, 0, 1) $sTime = StringReplace($sTime, 'SS', $sSS, 0, 1) $sTime = StringReplace($sTime, 'MMMM', $sMMMM, 0, 1) $sTime = StringReplace($sTime, 'MMM', $sMMM, 0, 1) $sTime = StringReplace($sTime, 'MM', $sMM, 0, 1) EndIf Return $sTime EndFunc ;==>_TimeConvert constants: #include-once ; #INDEX# ======================================================================================================================= ; Title .........: TimeConvert_Constants ; AutoIt Version : 3.3.10.2 ; Description ...: Constants for the TimeConvert UDF (v2.x) ; Author(s) .....: orbs ; =============================================================================================================================== ; #CONSTANTS# =================================================================================================================== ; UTC/local convertion instructions Global Const $__TIMECONVERT_CONVERT_NONE = 0 Global Const $__TIMECONVERT_CONVERT_UTC_TO_LOCAL = 1 Global Const $__TIMECONVERT_CONVERT_LOCAL_TO_UTC = -1 ; common string formats for time representation Global Const $__TIMECONVERT_FORMAT_SYSTEM = 'YYYYMMDDHHNNSS' Global Const $__TIMECONVERT_FORMAT_LOGICAL = 'YYYY/MM/DD HH:NN:SS' Global Const $__TIMECONVERT_FORMAT_UK = 'DD/MM/YYYY HH:NN:SS' Global Const $__TIMECONVERT_FORMAT_US = 'MM/DD/YYYY HH:NN:SS' Global Const $__TIMECONVERT_FORMAT_LOGICAL_WIDE = 'YYYY/MM/DD HH:NN:SS' Global Const $__TIMECONVERT_FORMAT_UK_WIDE = 'DD/MM/YYYY HH:NN:SS' Global Const $__TIMECONVERT_FORMAT_US_WIDE = 'MM/DD/YYYY HH:NN:SS' Global Const $__TIMECONVERT_FORMAT_US_LITERAL_LONG = 'MMMM DTH, YYYY, H:NN PM' Global Const $__TIMECONVERT_FORMAT_US_LITERAL_SHORT = 'MMM-DD YYYY, H:NN PM' ; =============================================================================================================================== example script: #AutoIt3Wrapper_Au3Check_Parameters=-q -d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 -w 7 #include 'TimeConvert.au3' Global $sTimeStamp_Local = _TimeConvert() Global $sTimeStamp_Random = Random(1970, 2038, 1) & StringFormat('%02i', Random(1, 12, 1)) & StringFormat('%02i', Random(1, 28, 1)) & StringFormat('%02i', Random(0, 23, 1)) & StringFormat('%02i', Random(0, 59, 1)) & StringFormat('%02i', Random(0, 59, 1)) MsgBox(0, 'TimeConvert UDF demo', _ 'Local Time :' & @TAB & $sTimeStamp_Local & @CRLF & _ 'UTC Description :' & @TAB & _TimeConvert($sTimeStamp_Local, $__TIMECONVERT_CONVERT_LOCAL_TO_UTC, Default, $__TIMECONVERT_FORMAT_US_LITERAL_LONG) & @CRLF & _ @CRLF & _ 'Random Time :' & @TAB & $sTimeStamp_Random & @CRLF & _ 'UTC, UK-style :' & @TAB & _TimeConvert($sTimeStamp_Random, $__TIMECONVERT_CONVERT_LOCAL_TO_UTC, Default, $__TIMECONVERT_FORMAT_UK))1 point
-
handling multiple gui
KennethWalle reacted to Melba23 for a topic
KennethWalle, Indeed you have not, which is why you got a friendly warning and nothing more. M231 point -
Adele, If you want to colour the whole line rather then just the subitem it is a bit simpler: #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <GuiListView.au3> $hGUI = GUICreate("Test", 500, 500) $cListView = GUICtrlCreateListView("Header|Header|Header", 0, 0, 350, 250) GUICtrlCreateListViewItem('00|01|02', $cListView) GUICtrlCreateListViewItem('10|11|12', $cListView) GUICtrlCreateListViewItem('20|21|22', $cListView) GUISetState() GUIRegisterMsg($WM_NOTIFY, "_WM_NOTIFY") While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Func _WM_NOTIFY($hWnd, $iMsg, $wParam, $lParam) #forceref $hWnd, $iMsg, $wParam Local $tNMLISTVIEW, $iItem, $iCode, $cID $tNMLISTVIEW = DllStructCreate($tagNMLISTVIEW, $lParam) $iCode = DllStructGetData($tNMLISTVIEW, "Code") If $iCode = $NM_CLICK Then $iItem = DllStructGetData($tNMLISTVIEW, "Item") $cID = _GUICtrlListView_GetItemParam($cListView, $iItem) ; Autoit stores the ControlID in the item paramter GUICtrlSetColor($cID, 0xFF0000) EndIf EndFunc ;==>_WM_NOTIFY M231 point
-
Hi mLipok, that should be no problem, the 7z interface doesn't want files it want streams. You could try it as following: 1. create your $oIStream using CreateStreamOnHGlobal() and fill it with the buffer you have extracted 2. the same way create outstreams for the files you want to extract 3. In function IArchiveExtractCallback_GetStream you pass these outstream to the callback 4. after extract function finished, use the ReadBinaryFromStream() function to convert stream to a buffer1 point
-
square65, Glad I could help and that you understood. Never be afraid to ask questions like this. I am sure that there are lot of other members who are very glad that you decided to ask this one - the answer to which is not as simple as it looks at first sight. M231 point
-
square65, $GUI_CHECKED is a constant in the GUIConstantsEx.au3 file which indicated the "checked" state of a checkbox or radio - and of course there is an equivalent $GUI_UNCHECKED. You can see from the Help file that GUICtrlRead actually returns the control state for checkboxes and radios - unless the advanced parameter is set. As far as I know, this rather confusing behaviour has been part of AutoIt since it began so just accept it. Anyway, looking at the table on the GUICtrlSetState page of the Help file you can see that there are many possible states and several of them can be applied at the same time - so it is quite possible that a checkbox could be, for example, both checked and disabled. in this case, the return from GUICtrlRead would not be a simple $GUI_CHECKED, but would actually be BitOr($GUI_CHECKED, $GUI_DISABLE) and a simple check for $GUI_CHECKED would fail. So you should use BitAnd to check whether the returned value contains the value you wish - although in many cases a simple comparison is valid as there will be only the one state returned. That brings us on to the subject of binary maths and using bits as flags - I suggest reading the early paragraphs of the Setting Styles tutorial in the Wiki which explains in some detail why you need to use the Bit* functions to combine and read styles - and states. I hope that helps - please ask again if not. M231 point
-
Peter221, I am assuming that you want to check for the running processes iteratively. The following construct does just that. You will need to integrate it into your code. ; array of process to monitor local $aProcesses = [ _ "Wireshark.exe", _ "ollydbg.exe", _ "idaq.exe", _ "fiddler.exe", _ "spyxx.exe", _ "devenv.exe", _ "wpe.exe", _ "wpepro.exe", _ "wpepro.net.exe", _ "ProcessHacker.exe" _ ] ; switch set in adlib / monitored in main loop local $bDBG = false ; check for debugger every second adlibregister('_chkdbg',1000) main() func main() while 1 ; ; going along doing whatever the main loop is doing ; if $bDBG Then ; ; oh oh, found a debugger, do something, possible just kill it ; $bDBG = false ; reset switch for next iteration EndIf sleep(1000) wend endfunc ; adlib routine / sets DBG switch at first instance of a debugger and returns func _chkdbg() for $1 = 0 to UBound($aProcesses) - 1 if processexists($aProcesses[$1]) then $bDBG = True Return endif next endfunc func _exit() Exit endfunc1 point
-
İe menu with guıcontrol not working
mesale0077 reacted to UEZ for a topic
The issue is that the child window overlaps the parent GUI. Thus you cannot click through the child window. Btw, with Win8 you can click through the child window. As a workaround you can use GUIGetCursorInfo() to check whether your mouse is hovering the controls. Something like this here: #AutoIt3Wrapper_Version=b #include <IE.au3> #include <ButtonConstants.au3> #include <EditConstants.au3> #include <StaticConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <Process.au3> #include <WinAPI.au3> If UBound(ProcessList(@ScriptName)) > 2 Then Exit OnAutoItExitRegister("_IE_Embedded_unregistry") RegWrite('HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION', _ProcessGetName(@AutoItPID), "REG_DWORD", 0x00002af9) Global $Form1 = GUICreate("by @mesale0077", 680, 470, -1, -1) GUISetBkColor(0xb0c4de, $Form1) $Label1 = GUICtrlCreateLabel("KCYNSY :", 68, 16, 112, 17) $Label2 = GUICtrlCreateLabel("SCYNSY :", 68, 60, 120, 17) $Input2 = GUICtrlCreateInput("3", 192, 56, 57, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_NUMBER)) GUICtrlSetLimit(-1, 2) $Input1 = GUICtrlCreateInput("1", 192, 16, 57, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_NUMBER)) GUICtrlSetLimit(-1, 2) $Button1 = GUICtrlCreateButton("CLİCK ME", 256, 24, 57, 41, $WS_GROUP) GUICtrlSetCursor(-1, 0) $Label3 = GUICtrlCreateLabel("Hazyrlayan: @mesale0077", 176, 88, 144, 17) Global $hGUI = GUICreate("", 684, 468, 0, 0, $WS_POPUP, BitOR(0, $WS_EX_LAYERED, $WS_EX_MDICHILD), $Form1) GUISetBkColor(0xb0c4de, $hGUI) $oIE = _IECreateEmbedded() $Obj_RCV = GUICtrlCreateObj($oIE, 0, 0, 684, 468) Local $oDocEvents = ObjEvent($oIE.document, "Event_", "HTMLDocumentEvents2") #forceref $oDocEvents _IENavigate($oIE, @ScriptDir & "\index.html") _HideScroll($oIE) Local $oEventsDoc = ObjEvent($oIE.document, "Event_", "HTMLDocumentEvents2") #forceref $oEventsDoc _IEAction($oIE, "refresh") _IELoadWait($oIE) GUISetState(@SW_SHOWNA, $hGUI) GUISetState(@SW_SHOW, $Form1) _API_SetLayeredWindowAttributes($hGUI, 0xb0c4de, 0xC0) #Region - GUI SelectLoop While 1 $extMsg = GUIGetMsg() Switch $extMsg Case $GUI_EVENT_CLOSE RegDelete('HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION', _ProcessGetName(@AutoItPID)) Exit Case $Button1 MsgBox(0, "", "helloword") EndSwitch $a = GUIGetCursorInfo($Form1) Switch $a[2] Case 1 Switch $a[4] Case $Input1, $Input2 ControlFocus($Form1, "", $a[4]) Case $Button1 ControlClick($Form1, "", $Button1) GUISwitch($Form1) EndSwitch EndSwitch WEnd Func _HideScroll($Temp_Object) Local $hText = 'var temp_h1 = document.body.clientHeight;' & _ 'var temp_h2 = document.documentElement.clientHeight;' & _ 'var isXhtml = (temp_h2<=temp_h1&&temp_h2!=0)?true:false;' & _ 'var htmlbody = isXhtml?document.documentElement:document.body;' & _ 'htmlbody.style.overflow = "hidden";' $Temp_Object.document.parentwindow.execscript($hText, "javascript") EndFunc ;==>_HideScroll Volatile Func Event_onclick($oEvtObj) If IsObj($oEvtObj) Then Local $oElem = $oEvtObj.srcElement If Not IsObj($oElem) Then Return Local $nId = $oElem.id Switch $nId Case "Notepad" Run("notepad.exe") Case "Hesapmakinası" Run("calc.exe") Case "hakkında" $oIE.document.parentwindow.execScript('$.fn.jAlert({ "title": "Hakkında", "message": "Mesale0077 tarafından yapılmıştır.!", "theme":"dark" });') Case "çıkış" RegDelete('HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION', _ProcessGetName(@AutoItPID)) Exit EndSwitch EndIf EndFunc ;==>Event_onclick Volatile Func Event_oncontextmenu($oEvtObj) If IsObj($oEvtObj) Then $oEvtObj.returnValue = False EndFunc ;==>Event_oncontextmenu Func _API_SetLayeredWindowAttributes($hwnd, $i_transcolor, $Transparency = 255, $isColorRef = False) Local Const $AC_SRC_ALPHA = 1 Local Const $ULW_ALPHA = 2 Local Const $LWA_ALPHA = 0x2 Local Const $LWA_COLORKEY = 0x1 If Not $isColorRef Then $i_transcolor = Hex(String($i_transcolor), 6) $i_transcolor = Execute('0x00' & StringMid($i_transcolor, 5, 2) & StringMid($i_transcolor, 3, 2) & StringMid($i_transcolor, 1, 2)) EndIf Local $Ret = DllCall("user32.dll", "int", "SetLayeredWindowAttributes", "hwnd", $hwnd, "long", $i_transcolor, "byte", $Transparency, "long", $LWA_COLORKEY + $LWA_ALPHA) Select Case @error Return SetError(@error, 0, 0) Case $Ret[0] = 0 Return SetError(4, 0, 0) Case Else Return 1 EndSelect EndFunc ;==>_API_SetLayeredWindowAttributes Func _IE_Embedded_unregistry() RegDelete('HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION', _ProcessGetName(@AutoItPID)) EndFunc ;==>_IE_Embedded_unregistry Br, UEZ1 point -
SMTP Mailer UDF
argumentum reacted to mLipok for a topic
you can try this one: inside Func _INetSmtpMailCom(.... change this: $objEmail.Send to this: _SaveMessageToFile($objEmail,@ScriptFullPath & '_BeforeSend.eml') $objEmail.Send _SaveMessageToFile($objEmail,@ScriptFullPath & '_AfterSend.eml') and of course here is _SaveMessageToFile ; #FUNCTION# ==================================================================================================================== ; Name ..........: _SaveMessageToFile ; Description ...: ; Syntax ........: _SaveMessageToFile($oMsg, $sFileFullPath) ; Parameters ....: $oMsg - An unknown value. ; $sFileFullPath - A string value. ; Return values .: None ; Author ........: mLipok ; Modified ......: ; Remarks .......: ; Related .......: ; Link ..........: https://msdn.microsoft.com/en-us/library/aa488396(v=exchg.65).aspx ; Example .......: No ; =============================================================================================================================== Func _SaveMessageToFile($oMsg, $sFileFullPath) Local $oStm = ObjCreate("ADODB.Stream") $oStm.Open $oStm.Type = 2 ; adTypeText $oStm.Charset = "US-ASCII" $oMsg.DataSource.SaveToObject($oStm, "_Stream") ; https://msdn.microsoft.com/en-us/library/windows/desktop/ms676152(v=vs.85).aspx ; adSaveCreateOverWrite = 2 $oStm.SaveToFile($sFileFullPath, 2) ; CleanUp $oDsrc ='' $oStm ='' EndFunc If this is exactly what you want then I will submit new version of this UDF.1 point