Leaderboard
Popular Content
Showing content with the highest reputation on 03/17/2024 in all areas
-
AutoItHelp v3.3.16.1 with external CSS loading
Nine and one other reacted to argumentum for a topic
Added the ability to load a custom CSS file where you can change the look of help pages as you would with any html file displaying in Internet Explorer. Also, all external links open in your default browser. This area is to share your CSS coloring or report a problem with the file. Examples of how it could look are: Buuf: Dark: Light ( default ) or just forego all themes and use High Contrast in the OS The general idea is that is your PC. Make it look as you wish The file is in the file downloads area. Replace the v3.3.16.1 CHM with the one in the ZIP along with the CSS file of your choosing to the same folder the CHM is at.2 points -
Hi @TheSaint Here a fast hack how to rotate the image by drawing a line on the edge of the CD cover to give you more flexibility. ;Coded by UEZ 2024-03-16 #include <GDIPlus.au3> #include <GUIConstantsEx.au3> #include <WinAPI.au3> #include <WindowsConstants.au3> Global $sFile = "cover.jpg" ;FileOpenDialog("Select an image", "", "Images (*.jpg;*.png;*.gif;*.bmp)") If @error Then Exit Const $fPI = ACos(-1) _GDIPlus_Startup() Global $hImage = _GDIPlus_ImageLoadFromFile($sFile), $hImage_rotated Global $aDim = _GDIPlus_ImageGetDimension($hImage) Global Const $hGUI = GUICreate("Image Rotate", $aDim[0], $aDim[1]) Global Const $hDC = _WinAPI_GetDC($hGUI) Global Const $hHBitmap = _WinAPI_CreateCompatibleBitmap($hDC, $aDim[0], $aDim[1]) Global Const $hDC_backbuffer = _WinAPI_CreateCompatibleDC($hDC) Global Const $DC_obj = _WinAPI_SelectObject($hDC_backbuffer, $hHBitmap) Global Const $hCanvas = _GDIPlus_GraphicsCreateFromHDC($hDC_backbuffer) Global Const $hPen = _GDIPlus_PenCreate(0xFFFFFFFF) _GDIPlus_GraphicsSetSmoothingMode($hCanvas, 4) _GDIPlus_GraphicsDrawImageRect($hCanvas, $hImage, 0, 0, $aDim[0], $aDim[1]) GUISetCursor(3, 0, $hGUI) GUISetState() Global $aCI, $c = 0, $x1, $y1, $x2, $y2 Do _GDIPlus_GraphicsDrawImageRect($hCanvas, $hImage, 0, 0, $aDim[0], $aDim[1]) $aCI = GUIGetCursorInfo($hGUI) If $aCI[2] Then While GUIGetCursorInfo($hGUI)[2] Sleep(1) WEnd $c += 1 Switch $c Case 1 $x1 = $aCI[0] $y1 = $aCI[1] Case 2 $x2 = $aCI[0] $y2 = $aCI[1] EndSwitch EndIf Switch $c Case 1 _GDIPlus_GraphicsDrawLine($hCanvas, $x1, $y1, $aCI[0], $aCI[1], $hPen) Case 2 _GDIPlus_GraphicsDrawLine($hCanvas, $x1, $y1, $x2, $y2, $hPen) EndSwitch _WinAPI_BitBlt($hDC, 0, 0, $aDim[0], $aDim[1], $hDC_backbuffer, 0, 0, $SRCCOPY) If $aCI[3] Then ExitLoop Sleep(10) Until False _GDIPlus_GraphicsDrawImageRect($hCanvas, $hImage, 0, 0, $aDim[0], $aDim[1]) _GDIPlus_ImageRotate($hImage, 360 - CalculateAngle($x1, $y1, $x2, $y2)) $hImage_rotated = _GDIPlus_BitmapCreateFromHBITMAP($hHBitmap) ;save result _GDIPlus_GraphicsClear($hCanvas) Do _GDIPlus_GraphicsDrawImageRect($hCanvas, $hImage_rotated, 0, 0, $aDim[0], $aDim[1]) _WinAPI_BitBlt($hDC, 0, 0, $aDim[0], $aDim[1], $hDC_backbuffer, 0, 0, $SRCCOPY) Until GUIGetMsg() = $GUI_EVENT_CLOSE _WinAPI_SelectObject($hDC_backbuffer, $DC_obj) _WinAPI_ReleaseDC($hGUI, $hDC) _WinAPI_DeleteDC($hDC_backbuffer) _WinAPI_DeleteObject($hHBitmap) _GDIPlus_PenDispose($hPen) _GDIPlus_ImageDispose($hImage) _GDIPlus_ImageDispose($hImage_rotated) _GDIPlus_Shutdown() Func CalculateAngle($x1, $y1, $x2, $y2) Return ATan(($y2 - $y1) / ($x2 - $x1)) * (180 / $fPi) + ($x1 > $x2 ? 180 : ($y1 > $y2 ? 360 : 0)) EndFunc Func _GDIPlus_ImageRotate($hImage, $fDegree) ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $fDegree = ' & $fDegree & @CRLF & '>Error code: ' & @error & @CRLF) ;### Debug Console Local $hMatrix = _GDIPlus_MatrixCreate() _GDIPlus_MatrixTranslate($hMatrix, $aDim[0] / 2, $aDim[1] / 2) _GDIPlus_MatrixRotate($hMatrix, $fDegree) _GDIPlus_MatrixTranslate($hMatrix, -$aDim[0] / 2, -$aDim[1] / 2) _GDIPlus_GraphicsSetTransform($hCanvas, $hMatrix) _GDIPlus_MatrixDispose($hMatrix) EndFunc After you have started the script and the image is displayed click (lmb) on the left upper corner of the CD cover move the move the mouse to the right upper corner of the CD cover and press click the lmb again press the right mouse button The image should be rotated according to the angle of x1, y1 and x2, y2. You may add a crop function to get only a desired area of the image. 😉2 points
-
AutoItHelp_v3.3.16.1_wExternalCss
Danyfirex reacted to argumentum for a file
Version 1.0.2
1,743 downloads
Added the ability to load a custom CSS file where you can change the look of help pages as you would with any html file displaying in Internet Explorer. Also, all external links open in your default browser. Replace the v3.3.16.1 CHM with the one in the ZIP along with the CSS file of your choosing to the same folder the CHM is at.1 point -
BIG THANKS to @UEZ for his code, which I adapted, plus adding some of my own. See his post here. I spent quite a while trying to come up with something simple to include in a program of mine. The examples in the Help file didn't quite do it for me, some very complex. Here's an image I needed to rotate by 1 degree right, and then trim and resize, for embedding into my FLAC and MP3 files for that album. The image was sourced from eBay, as alas Discogs let me down. Admittedly the album title wasn't very helpful, and there are two other volumes, though I only have the first one. Anyway, I have provided the image, so you can test and play around with it. #include <GDIPlus.au3> ; BIG THANKS to UEZ ; I modified his example from - https://www.autoitscript.com/forum/topic/155932-gdiplus-need-help-with-rotating-an-image/?do=findComment&comment=1127106 Global $hBackbuffer, $hBitmap, $hBitmap_Scaled, $hClone, $hCoverBitmap, $hCoverGC, $hCoverMatrix, $hCoverTexture, $hGraphic, $iH, $inifile, $iW, $newfile, $sCLSID $inifile = @ScriptDir & "\Settings.ini" $newfile = @ScriptDir & "\rotated.jpg" If FileExists($newfile) Then FileDelete($newfile) _GDIPlus_Startup() $hCoverTexture = _GDIPlus_BitmapCreateFromFile(@ScriptDir & "\cover.jpg") $iW = _GDIPlus_ImageGetWidth($hCoverTexture) $iH = _GDIPlus_ImageGetHeight($hCoverTexture) $iW = $iW / 2 $iH = $iH / 2 $hBitmap_Scaled = _GDIPlus_ImageResize($hCoverTexture, $iW, $iH, 5) Global $hGUI = GUICreate("", $iW, $iH) $hGraphic = _GDIPlus_GraphicsCreateFromHWND($hGUI) $hBitmap = _GDIPlus_BitmapCreateFromGraphics($iW, $iH, $hGraphic) $hBackbuffer = _GDIPlus_ImageGetGraphicsContext($hBitmap) $hCoverBitmap = _GDIPlus_BitmapCreateFromGraphics($iW, $iH, $hBackbuffer) $hCoverGC = _GDIPlus_ImageGetGraphicsContext($hCoverBitmap) $hCoverMatrix = _GDIPlus_MatrixCreate() Rotate() Sleep(1000) Local $crop = 1, $resize = 1, $trim If $crop = 1 Then Local $lft = IniRead($inifile, "Image Crop", "left", 0) Local $tp = IniRead($inifile, "Image Crop", "top", 0) Local $wd = IniRead($inifile, "Image Crop", "width", $iW) Local $ht = IniRead($inifile, "Image Crop", "height", $iH) Local $size = $lft & "_" & $tp & "_" & $wd & "_" & $ht ; $trim = InputBox("Crop Query", "Please set the desired values." & @LF & @LF & "Left_Top_Width_Height", $size, "", 200, 160, Default, Default) If @error = 0 Then $trim = StringSplit($trim, "_", 1) If $trim[0] = 4 Then $lft = $trim[1] $tp = $trim[2] $wd = $trim[3] $ht = $trim[4] IniWrite($inifile, "Image Crop", "left", $lft) IniWrite($inifile, "Image Crop", "top", $tp) IniWrite($inifile, "Image Crop", "width", $wd) IniWrite($inifile, "Image Crop", "height", $ht) If $wd < 1 Then $wd = $iW EndIf If $ht < 1 Then $ht = $iH EndIf If $lft < 1 Then $lft = 0 EndIf If $tp < 1 Then $tp = 0 EndIf $wd = $wd - $lft $ht = $ht - $tp ; 188_55_630_496 $hClone = _GDIPlus_BitmapCloneArea($hBitmap, $lft, $tp, $wd, $ht, $GDIP_PXF24RGB) Else MsgBox(262192, "Crop Error", "Wrong number of values specified. 4 required.", 0, $DropboxGUI) EndIf EndIf Else $hClone = "none" EndIf If $resize = 1 Then If $hClone = "none" Then $hClone_Scaled = _GDIPlus_ImageResize($hBitmap, 600, 600, 5) Else $hClone_Scaled = _GDIPlus_ImageResize($hClone, 600, 600, 5) EndIf Else $hClone_Scaled = $hBitmap EndIf $sCLSID = _GDIPlus_EncodersGetCLSID("JPG") _GDIPlus_ImageSaveToFileEx($hClone_Scaled, $newfile, $sCLSID) If FileExists($newfile) Then ShellExecute($newfile) GUIDelete($hGUI) _GDIPlus_BitmapDispose($hBitmap_Scaled) _GDIPlus_BitmapDispose($hClone_Scaled) If $hClone <> "none" Then _GDIPlus_ImageDispose($hClone) _GDIPlus_MatrixDispose($hCoverMatrix) _GDIPlus_GraphicsDispose($hGraphic) _GDIPlus_GraphicsDispose($hCoverGC) _GDIPlus_BitmapDispose($hBitmap) _GDIPlus_BitmapDispose($hCoverBitmap) _GDIPlus_BitmapDispose($hCoverTexture) _GDIPlus_ImageDispose($hBackbuffer) _GDIPlus_Shutdown() Exit Func Rotate() _GDIPlus_GraphicsClear($hBackbuffer, 0xFF6495ED) _GDIPlus_MatrixTranslate($hCoverMatrix, 0, 0) ; move it back to 0, 0 since (112 / 2) and (37 / 2) are it's middle origin point _GDIPlus_MatrixRotate($hCoverMatrix, 1) ; rotate it around it's middle origin point (minus to rotate left) _GDIPlus_GraphicsSetTransform($hCoverGC, $hCoverMatrix) _GDIPlus_MatrixTranslate($hCoverMatrix, 0, 0) _GDIPlus_GraphicsClear($hCoverGC, 0xFFFFFFFF) ; show the GC _GDIPlus_GraphicsDrawImageRect($hCoverGC, $hCoverTexture, 0, 0, $iW, $iH) ; place the arrow at the center of it's GC _GDIPlus_GraphicsDrawImage($hBackbuffer, $hCoverBitmap, 0, 0) ; move it's GC by an offset so the image is at the correct XY using it's origin _GDIPlus_GraphicsDrawImageRect($hGraphic, $hBitmap, 0, 0, $iW, $iH) EndFunc Resulting image. Enjoy! P.S. I should have probably removed the comments by UEZ in the Rotate function, especially as I changed it to not rotate around the center. Some of the code in that function is likely redundant too, because of that change.1 point
-
UDF : BlockInput without UAC
argumentum reacted to Nine for a topic
This function can be use to block all inputs coming from mouse and keyboard, without having an UAC warning displayed. Version 2024-04-17 * Added new parameter to allow injection or not * Allow Send and Mouse* functions (injection) to work when inputs are blocked Version 2021-02-06 * Allows blocking either Mouse or Keyboard independently * Removed @error if already disable / enable * Checks for rightful parameters Example 1 : basic usage of blocking inputs Example 2 : usage of Control* while inputs are blocked Example 3 : injection of both mouse and keyboard BlockInputUDF.zip1 point -
This is a basic UDF to create nice slideshows. There are a lot of customizable options so it might be useful in some projects. Here is an example: #AutoIt3Wrapper_AU3Check_Parameters=-d -w 1 -w 2 -w 4 -w 5 -w 6 -w 7 #Au3Stripper_Parameters=/sf /sv /mo /rm /rsln #include "Slideshow.au3" Global $avImage[4] = [ _ 'https://lh5.googleusercontent.com/p/AF1QipM3jIOsqrISfcKwgYLYF8-9DyAzQiUyWmB35nBj=w540-h312-n-k-no', _ 'https://lh5.googleusercontent.com/p/AF1QipMPb5fGtzZz2ZJFd20CV2trNzmxNOYLv4abJSfi=w540-h312-n-k-no', _ 'https://lh5.googleusercontent.com/p/AF1QipPLOXRwTpKbFxNNLTmiLrIJlG_H3h4VU6HShLwf=w540-h312-n-k-no', _ 'https://lh5.googleusercontent.com/p/AF1QipPNiwx1lGPxcHJzKTMRl5Cyr1SOjS05yHbif8BE=w540-h312-n-k-no' _ ] Global $asCaptions[4] = ['Pico do Fogo', 'Praia da Chave', 'Buracona - Blue Eye Cave', 'Deserto de Viana'] Global $mOptions[] $mOptions['ImageType'] = 'URL' $mOptions['Captions'] = $asCaptions $mOptions['ShowCaptions'] = True Global $sTitle = 'Cape Verde' Global $sText = 'Cape Verde or Cabo Verde, officially the Republic of Cabo Verde, is an archipelago and island country of West Africa in the central Atlantic Ocean, ' & _ 'consisting of ten volcanic islands with a combined land area of about 4,033 square kilometres (1,557 sq mi). These islands lie between 600 and 850 kilometres ' & _ '(320 and 460 nautical miles) west of Cap-Vert, the westernmost point of continental Africa. The Cape Verde islands form part of the Macaronesia ecoregion, ' & _ 'along with the Azores, the Canary Islands, Madeira, and the Savage Isles.' Global $sExtraText = "Cape Verde's official language is Portuguese. The recognized national language is Cape Verdean Creole, which is spoken by the vast " & _ "majority of the population. As of the 2021 census the most populated islands were Santiago, where the capital Praia is located (269,370), São Vicente (74,016), " & _ "Santo Antão (36,632), Fogo (33,519) and Sal (33,347). The largest cities are Praia (137,868), Mindelo (69,013), Espargos (24,500) and Assomada (21,297)." Global $sCopyright = 'Sources for pictures and data are from google.com and wikipedia.com' Global $hGUI, $cTitle, $cText, $cExtra, $cCopyright, $mSlideshow _GDIPlus_Startup() $hGUI = GUICreate('Slideshow', 870, 450) $cTitle = GUICtrlCreateLabel($sTitle, 10, 10, 300, 60) $cText = GUICtrlCreateLabel($sText, 10, 90, 300, 240) $cExtra = GUICtrlCreateLabel($sExtraText, 10, 330, 850, 80) $cCopyright = GUICtrlCreateLabel($sCopyright, 10, 420, 850, 20) $mSlideshow = _GUICtrlSlideshow_Create($hGUI, 320, 10, 540, 312, $avImage, $mOptions) GUICtrlSetFont($cTitle, 35, 600, 0, 'Segoe UI') GUICtrlSetFont($cText, 11, 500, 0, 'Segoe UI') GUICtrlSetFont($cExtra, 11, 500, 0, 'Segoe UI') GUICtrlSetFont($cCopyright, 11, 500, 2, 'Segoe UI') GUICtrlSetColor($cTitle, 0x000060) GUICtrlSetColor($cCopyright, 0x800000) GUISetState(@SW_SHOW, $hGUI) While True If _GUICtrlSlideshow_ButtonEvent($mSlideshow, $SLIDESHOW_PREV_BTN) Then _GUICtrlSlideshow_ShowSlide($mSlideshow, $BTN_EVENT_PREV) If _GUICtrlSlideshow_ButtonEvent($mSlideshow, $SLIDESHOW_NEXT_BTN) Then _GUICtrlSlideshow_ShowSlide($mSlideshow, $BTN_EVENT_NEXT) Switch GUIGetMsg() Case -3 ExitLoop EndSwitch WEnd _GUICtrlSlideshow_Delete($mSlideshow) _GDIPlus_Shutdown() There might be some hidden bugs. If you encounter any just let me know. Tip: use SlideshowEx.au3 if you don't want to preload the images Slideshow.au3SlideshowEx.au31 point
-
@UEZ, nice. I've fiddled with the UEZ listing a bit you can now rotate the image visually with a slider you can also finely adjust the rotation with two buttons I also added 2 "rulers", one vertical and one horizontal, which you can move by clicking on them and dragging them, in order to have a reference to control the orientation of the image ;Coded by UEZ 2024-03-16 ; [few mods by Gianni :) ] #include <GDIPlus.au3> #include <GUIConstantsEx.au3> #include <WinAPI.au3> #include <WindowsConstants.au3> ; --- rulers ----- Global $iThickness = 4 Global $hGUI1 = GUICreate("", @DesktopWidth, $iThickness, 0, @DesktopHeight / 2, $WS_POPUP, $WS_EX_TOPMOST) GUICtrlCreateLabel("", 0, 0, @DesktopWidth, $iThickness, -1, $GUI_WS_EX_PARENTDRAG) GUISetBkColor(0x00ff00, $hGUI1) WinSetTrans($hGUI1, "", 127) GUISetState(@SW_SHOW, $hGUI1) Global $hGUI2 = GUICreate("", $iThickness, @DesktopHeight, @DesktopWidth / 2, 0, $WS_POPUP, $WS_EX_TOPMOST) GUICtrlCreateLabel("", 0, 0, $iThickness, @DesktopHeight, -1, $GUI_WS_EX_PARENTDRAG) GUISetBkColor(0x00ff00, $hGUI2) WinSetTrans($hGUI2, "", 127) GUISetState(@SW_SHOW, $hGUI2) ; ---------------- Global $sFile = "cover.jpg" ;FileOpenDialog("Select an image", "", "Images (*.jpg;*.png;*.gif;*.bmp)") If @error Then Exit Const $fPI = ACos(-1) _GDIPlus_Startup() Global $hImage = _GDIPlus_ImageLoadFromFile($sFile) Global $aDim = _GDIPlus_ImageGetDimension($hImage) Global Const $hGUI = GUICreate("Image Rotate", $aDim[0], $aDim[1] + 50) Global Const $hDC = _WinAPI_GetDC($hGUI) Global Const $hHBitmap = _WinAPI_CreateCompatibleBitmap($hDC, $aDim[0], $aDim[1]) Global Const $hDC_backbuffer = _WinAPI_CreateCompatibleDC($hDC) Global Const $DC_obj = _WinAPI_SelectObject($hDC_backbuffer, $hHBitmap) Global Const $hCanvas = _GDIPlus_GraphicsCreateFromHDC($hDC_backbuffer) Global Const $hPen = _GDIPlus_PenCreate(0xFFFFFFFF) _GDIPlus_GraphicsSetSmoothingMode($hCanvas, 4) _GDIPlus_GraphicsDrawImageRect($hCanvas, $hImage, 0, 0, $aDim[0], $aDim[1]) Global $hButton1 = GUICtrlCreateButton(' < ', 10, $aDim[1] + 10, 40) Global $Slider = GUICtrlCreateSlider(60, $aDim[1] + 10, 360, 25) GUICtrlSetLimit(-1, 360, 0) ; change min/max value Global $hButton2 = GUICtrlCreateButton(' > ', 430, $aDim[1] + 10, 40) Global $hSlider = GUICtrlGetHandle($Slider) Global $Dummy = GUICtrlCreateDummy() GUIRegisterMsg($WM_HSCROLL, "WM_HVSCROLL") ;horz slider GUISetState(@SW_SHOW, $hGUI) _ImageRefresh() ; Loop until the user exits. While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop Case $Dummy _GDIPlus_ImageRotate($hImage, GUICtrlRead($Slider)) _ImageRefresh() Case $hButton1 _FineTuning(1) Case $hButton2 _FineTuning(2) EndSwitch WEnd _WinAPI_SelectObject($hDC_backbuffer, $DC_obj) _WinAPI_ReleaseDC($hGUI, $hDC) _WinAPI_DeleteDC($hDC_backbuffer) _WinAPI_DeleteObject($hHBitmap) _GDIPlus_PenDispose($hPen) _GDIPlus_ImageDispose($hImage) _GDIPlus_Shutdown() Func _FineTuning($iDirection) Local Static $iAngle Local Static $iSliderPos = GUICtrlRead($Slider) If $iSliderPos <> GUICtrlRead($Slider) Then $iAngle = 0 $iSliderPos = GUICtrlRead($Slider) EndIf Switch $iDirection Case 1 $iAngle -= .1 If $iAngle < 0 Then $iAngle = .9 $iSliderPos -= 1 If $iSliderPos < 0 Then $iSliderPos = 359 GUICtrlSetData($Slider, $iSliderPos) EndIf Case 2 $iAngle += .1 If $iAngle > .9 Then $iAngle = 0 $iSliderPos += 1 If $iSliderPos > 359 Then $iSliderPos = 0 GUICtrlSetData($Slider, $iSliderPos) EndIf EndSwitch _GDIPlus_ImageRotate($hImage, $iSliderPos + $iAngle) _ImageRefresh() EndFunc ;==>_FineTuning Func _ImageRefresh() _GDIPlus_GraphicsClear($hCanvas) _GDIPlus_GraphicsDrawImageRect($hCanvas, $hImage, 0, 0, $aDim[0], $aDim[1]) _WinAPI_BitBlt($hDC, 0, 0, $aDim[0], $aDim[1], $hDC_backbuffer, 0, 0, $SRCCOPY) EndFunc ;==>_ImageRefresh Func _GDIPlus_ImageRotate($hImage, $fDegree) ; ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $fDegree = ' & $fDegree & @TAB & '>Error code: ' & @error & @CRLF) ;### Debug Console Local $hMatrix = _GDIPlus_MatrixCreate() _GDIPlus_MatrixTranslate($hMatrix, $aDim[0] / 2, $aDim[1] / 2) _GDIPlus_MatrixRotate($hMatrix, $fDegree) _GDIPlus_MatrixTranslate($hMatrix, -$aDim[0] / 2, -$aDim[1] / 2) _GDIPlus_GraphicsSetTransform($hCanvas, $hMatrix) _GDIPlus_MatrixDispose($hMatrix) EndFunc ;==>_GDIPlus_ImageRotate Func WM_HVSCROLL($hwnd, $iMsg, $wParam, $lParam) #forceref $hwnd, $iMsg, $wParam, $lParam Switch $iMsg Case $WM_HSCROLL Switch $lParam Case $hSlider GUICtrlSendToDummy($Dummy, GUICtrlRead($Slider)) EndSwitch Case $WM_VSCROLL EndSwitch Return $GUI_RUNDEFMSG EndFunc ;==>WM_HVSCROLL1 point
-
MongoDB Compass GUI Connector for CyberArk PSM
argumentum reacted to SmOke_N for a topic
#include <WinAPISysWin.au3> #include <Array.au3> ; $gvPID is for your integer Process ID or your exe name ;- Global $gvPID = StringRegExpReplace(@AutoItExe, "^(.*?\\)*(.+?$)", "$2") Global $gvPID = "MongoDBCompass.exe" Global $gaWinInfo = _WinGetByPID($gvPID) _ArrayDisplay($gaWinInfo) Func _WinGetByPID($vPID) $vPID = ProcessExists($vPID) If $vPID = 0 Then Return SetError(1, 0, 0) EndIf Local $aWList = WinList() ; [n][0] = Title ; [n][1] = Window Handle ; [n][2] = Class ; [n][3] = State ; [n][4] = Parent ; [n][5] = PID Local $aRet[UBound($aWList)][6] Local $iEnum = 0 For $i = 1 To UBound($aWList) - 1 If WinGetProcess($aWList[$i][1]) = $vPID Then $aRet[$iEnum][0] = $aWList[$i][0] $aRet[$iEnum][1] = $aWList[$i][1] $aRet[$iEnum][2] = _WinAPI_GetClassName($aWList[$i][1]) $aRet[$iEnum][3] = WinGetState($aWList[$i][1]) $aRet[$iEnum][4] = _WinAPI_GetParent($aWList[$i][1]) $aRet[$iEnum][5] = $vPID $iEnum += 1 EndIf Next If $iEnum = 0 Then Return SetError(2, 0, 0) EndIf ReDim $aRet[$iEnum][6] Return $aRet EndFunc 😑1 point -
This is the stripped down function code as I think it should look like: ; #FUNCTION# ==================================================================================================================== ; Name...........: _OL_Wrapper_CreateAppointment ; Description ...: Creates an appointment (wrapper function). ; Syntax.........: _OL_Wrapper_CreateAppointment($oOL, $sSubject, $sStartDate[, $vEndDate = 30[, $sLocation = ""[, $bAllDayEvent = False[, $sBody = ""[, $iReminder = 15[, $iShowTimeAs = $olBusy[, $iImportance = $olImportanceNormal[, $iSensitivity = ""]]]]]]]) ; Parameters ....: $oOL - Outlook object returned by a preceding call to _OL_Open() ; $sSubject - The Subject of the Appointment. ; $sStartDate - Start date & time of the Appointment, format YYYY-MM-DD HH:MM - or what is set locally. ; $vEndDate - [optional] End date & time of the Appointment, format YYYY-MM-DD HH:MM - or what is set locally OR ; Number of minutes (default = 30 minutes). ; $sLocation - [optional] The location where the meeting is going to take place (default = ""). ; $bAllDayEvent - [optional] True or False(default). If set to True and the appointment is lasting for more than one day, ; $vEndDate must be one day higher than the actual end Date. ; $sBody - [optional] The Body of the Appointment (default = ""). ; $iReminder - [optional] Reminder in Minutes before $sStartDate, 0 for no reminder (default = 15). ; $iShowTimeAs - [optional] One of this constants: $olBusy (default), $olFree, $olOutOfOffice or $olTentative. ; $iImportance - [optional] One of this constants: $olImportanceNormal (default), $olImportanceHigh or $olImportanceLow. ; $iSensitivity - [optional] One of this constants: $olNormal (default), $olPersonal, $olPrivate or $olConfidential. ; Return values .: Success - Object of the appointment ; Failure - Returns 0 and sets @error: ; |1 - $sStartDate is invalid ; |2 - $sBody is missing ; |4 - $sTo, $sCc and $sBCc are missing ; |1xxx - 1000 + error returned by function _OL_FolderAccess ; |2xxx - 2000 + error returned by function _OL_ItemCreate ; |3xxx - 3000 + error returned by function _OL_ItemModify ; Author ........: water ; Modified.......: ; Remarks .......: This is a wrapper function to simplify creating an appointment. If you have to set more properties etc. you have to do all steps yourself ; Related .......: ; Link ..........: ; Example .......: Yes ; =============================================================================================================================== Func _OL_Wrapper_CreateAppointment($oOL, $sSubject, $sStartDate, $vEndDate = 30, $sLocation = "", $bAllDayEvent = False, $sBody = "", $iReminder = 15, $iShowTimeAs = $olBusy, $iImportance = $olImportanceNormal, $iSensitivity = $olNormal) If $vEndDate = Default Then $vEndDate = 30 If $sLocation = Default Then $sLocation = "" If $bAllDayEvent = Default Then $bAllDayEvent = False If $sBody = Default Then $sBody = "" If $iReminder = Default Then $iReminder = 15 If $iShowTimeAs = Default Then $iShowTimeAs = $olBusy If $iImportance = Default Then $iImportance = $olImportanceNormal If $iSensitivity = Default Then $iSensitivity = $olNormal If Not _DateIsValid($sStartDate) Then Return SetError(1, 0, 0) Local $sEnd, $oItem ; Access the default calendar Local $aFolder = _OL_FolderAccess($oOL, "", $olFolderCalendar) If @error Then Return SetError(@error + 1000, @extended, 0) ; Create an appointment item in the default calendar and set properties If _DateIsValid($vEndDate) Then $sEnd = "End=" & $vEndDate Else $sEnd = "Duration=" & Number($vEndDate) EndIf $oItem = _OL_ItemCreate($oOL, $olAppointmentItem, $aFolder[1], "", "Subject=" & $sSubject, "Location=" & $sLocation, "AllDayEvent=" & $bAllDayEvent, _ "Start=" & $sStartDate, "Body=" & $sBody, "Importance=" & $iImportance, "BusyStatus=" & $iShowTimeAs, $sEnd, "Sensitivity=" & $iSensitivity) If @error Then Return SetError(@error + 2000, @extended, 0) ; Set reminder properties If $iReminder <> 0 Then $oItem = _OL_ItemModify($oOL, $oItem, Default, "ReminderSet=True", "ReminderMinutesBeforeStart=" & $iReminder) If @error Then Return SetError(@error + 3000, @extended, 0) Else $oItem = _OL_ItemModify($oOL, $oItem, Default, "ReminderSet=False") If @error Then Return SetError(@error + 3000, @extended, 0) EndIf Return $oItem EndFunc ;==>_OL_Wrapper_CreateAppointment1 point
-
Hey @SmOke_N, I understand your question, could you please elaborate on where shall I run this command? The issue I'm facing is with Mongodb Compass GUI windows client. I fixed my mouse click coordinates but it messes up due to resolution.. can we schedule a 30 mins virtual meet for better understanding?0 points