Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 10/15/2023 in all areas

  1. Nine

    Printer Manager

    In this topic, it was mentioned by @mLipok that it could be doable to manage printers with winspool.drv DLL. It was enough to get my attention on it. I do not remember seeing any UDF gathering all those functions. Func _PRNT_GetDefaultPrinter() Func _PRNT_SetDefaultPrinter($sPrinter) Func _PRNT_OpenPrinter($sName) Func _PRNT_ClosePrinter($hPrinter) Func _PRNT_GetPrinterInfo($hPrinter, $bGlobal, $bRAW = False) Func _PRNT_SetPrinterInfo($hPrinter, $iProp, $iValue, $bGlobal) Func _PRNT_EnumPrinters() Func _PRNT_IsValidDevmode($tDevMode) Func _PRNT_EnumJobs($hPrinter) Version 2023-10-17 *added new functions _PRNT_IsValidDevmode and _PRNT_EnumJobs Version 2023-10-15 * solved a problem where garbage collector would destroy $tDevMode after a while on return of _PRNT_GetPrinterInfo There is a multitude of other functions that could be part of this UDF, but I have decided to stop here and see how you like it. If you have comments or suggestions, they are always welcome. Printer_UDF.zip
    1 point
  2. Revisiting secure solutions to send attachments in gmail. As per anyone else that might be using this with gmail, they might receive the following error: Error Code:2 Description:The message could not be sent to the SMTP server. The transport error code was 0x80040217. The server response was not available This message goes away when you visit google secure account settings and turn it OFF: https://myaccount.google.com/lesssecureapps?pli=1 Some apps and devices use less secure sign-in technology, which makes your account vulnerable. You can turn off access for these apps, which we recommend, or turn it on if you want to use them despite the risks. Google will automatically turn this setting OFF if it’s not being used. Allow less secure apps: OFF Does anyone have any references to why it's not bad to turn off this secure access since as the summary explains, it seems like not a great thing to do.
    1 point
  3. I made a few changes to the code @Andreik provided! #define AUT_MANUALSTEP 0 #define AUT_AUTOSTEP 1 bool PixelSearch(LPRECT lpRect, int nCol, int nVar, int nStep, LPPOINT pPointResult, int stepMode = AUT_MANUALSTEP, int nCoordPixelMode = AUT_COORDMODE_SCREEN) { int q, r; int col; BYTE red, green, blue; BYTE red_low, red_high, green_low, green_high, blue_low, blue_high; HDC hdc; RECT relrect; POINT ptOrigin; bool m_bColorModeBGR = false; relrect.left = lpRect->left; relrect.top = lpRect->top; relrect.right = lpRect->right; relrect.bottom = lpRect->bottom; ConvertCoords(nCoordPixelMode, ptOrigin); relrect.left += ptOrigin.x; relrect.top += ptOrigin.y; relrect.right += ptOrigin.x; relrect.bottom += ptOrigin.y; col = nCol; if (m_bColorModeBGR == false) Util_RGBtoBGR(col); red = GetRValue(col); green = GetGValue(col); blue = GetBValue(col); if (nVar < 0) nVar = 0; else if (nVar > 0xff) nVar = 0xff; if (nVar == 0) { red_low = red_high = red; green_low = green_high = green; blue_low = blue_high = blue; } else { red_low = (nVar > red) ? 0 : red - nVar; green_low = (nVar > green) ? 0 : green - nVar; blue_low = (nVar > blue) ? 0 : blue - nVar; red_high = (nVar > 0xFF - red) ? 0xFF : red + nVar; green_high = (nVar > 0xFF - green) ? 0xFF : green + nVar; blue_high = (nVar > 0xFF - blue) ? 0xFF : blue + nVar; } hdc = GetDC(NULL); if (stepMode == AUT_MANUALSTEP) { for (q = relrect.left; q <= relrect.right; q = q + nStep) { for (r = relrect.top; r <= relrect.bottom; r = r + nStep) { col = GetPixel(hdc, q, r); red = GetRValue(col); green = GetGValue(col); blue = GetBValue(col); if (red >= red_low && red <= red_high && green >= green_low && green <= green_high && blue >= blue_low && blue <= blue_high) { q -= ptOrigin.x; r -= ptOrigin.y; pPointResult->x = q; pPointResult->y = r; ReleaseDC(NULL, hdc); return 0; } } } } else if (stepMode == AUT_AUTOSTEP) { nStep = lpRect->right - lpRect->left; for (int i = nStep; i > 0; i -= (i / 2)) { for (q = relrect.left; q <= relrect.right; q = q + i) { for (r = relrect.top; r <= relrect.bottom; r = r + i) { col = GetPixel(hdc, q, r); red = GetRValue(col); green = GetGValue(col); blue = GetBValue(col); if (red >= red_low && red <= red_high && green >= green_low && green <= green_high && blue >= blue_low && blue <= blue_high) { q -= ptOrigin.x; r -= ptOrigin.y; pPointResult->x = q; pPointResult->y = r; ReleaseDC(NULL, hdc); return 0; } } } } } ReleaseDC(NULL, hdc); return 1; } Changed the return type of the PixelSearch function to return a bool. If it finds the color it returns 0, if not it returns 1. I also added a parameter stepMode, its default is AUT_MANUALSTEP or 0. The AUT_AUTOSTEP basically just takes the difference of lpRect->right - lpRect->left and uses that as the step amount. It divides the difference by 2 each time it cycles through those for loops. If anyone can add to this or make this even better that would be awesome!
    1 point
  4. water

    Advanced.Help

    Version 1.5.0.1

    943 downloads

    The F1 key in SciTE displays the documentation for the word on which the cursor is located. Up to now this was only available for AutoIt. But times change and we change with them Now with Advanced.Help ANY CHM help file (Compressed HTML Help) can be called with the F1 key. The only prerequisite: All function names have to start with the same identifier (like _AD_, _OL_ etc.). This tool, created by BugFix from the german forum and the help of Musashi, allows custom CHM help files to be included in SciTE. The existing help key is used to call either the AutoIt help or the corresponding custom help. Depending on which keyword the cursor is currently on. For unknown keywords the AutoIt help is called. For AutoIt a separate window is opened and for the user-defined UDFs another window is opened, so you can work with both helps at the same time. The ZIP file contains an installation guide in German (Install_Deutsch.txt) and English (Install_English.txt) in which the installation and configuration is described in detail. Most CHM help files come with UDFs you can download from this forum section (AD, OutlookEX, TaskScheduler). In addition we have added the preliminary release of the WebDriver help file. The most current CHM help file is now only distributed with the WebDriver UDF. BTW: If you like this UDF please click the "I like this" button. This tells me where to next put my development effort Known Bugs: (last changed: 2022-07-20) None
    1 point
  5. Version 0.1.0

    809 downloads

    ATTENTION! THIS IS STILL WORK IN PROGRESS! This is the modified version of MrCreatoR's "Simple Library Docs Generator". It allows to create CHM help files that look like the AutoIt help file. In additon this CHM files can then be used with Advanced.Help. This a very early alpha version - so it is miles away from being perfect. It's just something for you to play with. The documentation is in the making and will be published as soon as possible. BTW: If you like this UDF please click the "I like this" button. This tells me where to next put my development effort
    1 point
×
×
  • Create New...