
IgImAx
Active Members-
Posts
28 -
Joined
-
Last visited
Everything posted by IgImAx
-
Capturing screenshots while computer is locked
IgImAx replied to ammaul's topic in AutoIt General Help and Support
Hi guys @ioa747 Thanks for your suggestion, but I already tried that! It only takes a screenshot of the desktop background and not the elements in it. @Nine Sure, I will complete those steps when I have time and then update you. Thanks again & Happy Coding IgImAx- 24 replies
-
- screenshot
- locked
-
(and 1 more)
Tagged with:
-
Capturing screenshots while computer is locked
IgImAx replied to ammaul's topic in AutoIt General Help and Support
Hi again guys I prefer to keep my Windows computer in lock mode for security reasons, instead of blocking inputs. I have an idea for a solution and would appreciate your guidance to help me get started. I will handle the coding aspect of it myself. I would like to schedule a full desktop screenshot of my computer while it is locked and have it sent to my email every n minutes. However, the _ScreenCapture_CaptureWnd_mod() function only works when a window handler is provided. I would like to take a screenshot of the entire desktop to ensure that any pop-up windows from any application are captured. To achieve that, I have these steps in mind: Find a list of all open and active windows, excluding minimized or hidden. [I can achieve this.] Sort them based on z-order, from back to front window. [I can achieve this.] In a loop, send each window handler to the _ScreenCapture_CaptureWnd_mod() function, but store each image in memory. [I need guidance here.] Mix each image based on their back-to-front order and their positions in memory, and save the result in a file. [I need guidance here.] What do you think, guys? FYI: I'm familiar with Python too! Cheers IgImAx- 24 replies
-
- screenshot
- locked
-
(and 1 more)
Tagged with:
-
Capturing screenshots while computer is locked
IgImAx replied to ammaul's topic in AutoIt General Help and Support
Hi guys Thanks to both of you for and quick replies. This ' Block all input without UAC It looks promising. Thank you.- 24 replies
-
- screenshot
- locked
-
(and 1 more)
Tagged with:
-
Capturing screenshots while computer is locked
IgImAx replied to ammaul's topic in AutoIt General Help and Support
Hi everyone I have been using the _ScreenCapture_CaptureWnd_mod for years and I want to thank the developer for creating it.💖🙏 However, I now need to take a screenshot of the entire desktop, not just a window. (Whatever windows are open + taskbar) I have tried researching and experimenting with different methods, but have not had any success. ⁉️ Can anyone guide how to use this function, or suggest another method to take a screenshot of the entire desktop while Windows is in lock mode? Cheers IgImAx- 24 replies
-
- screenshot
- locked
-
(and 1 more)
Tagged with:
-
How to get IDM Download Panel HWND?
IgImAx replied to IgImAx's topic in AutoIt General Help and Support
Hi Everyone I just found the better answer right now!! I was so wrong since I didn't know below things! I hope these help someone else too: Detect Hidden Control: Idm Toolbar handler can easily retrieve via this code: (now its is easy!! after 2 years!!) AutoItSetOption("WinDetectHiddenText", 1) ;~ 1 = Detect hidden text Local $IdmClass = "[CLASS:IDM Download Button class]" Local $IdmHwnd = ControlGetHandle("", "", $IdmClass ) The key missing line in my entire years was line one! (set WinDetectHiddenText to 1) Detect Odd Context Menu Items: All credits goes to "Nine" at here. Here how to get the list of all Idm Toolbar menu: Local $hMenuWnd = WinGetHandle ("[CLASS:#32768]") Local $hMenu = _SendMessage($hMenuWnd, $MN_GETHMENU) If Not _GUICtrlMenu_IsMenu($hMenu) Then Exit MsgBox ($MB_SYSTEMMODAL,"","Unable to retrieve context menu handle") Local $iCount = _GUICtrlMenu_GetItemCount ($hMenu) For $i = 0 to $iCount-1 ConsoleWrite (_GUICtrlMenu_GetItemText ($hMenu, $i) & @CRLF) Next Thanks and Happy Codding IgImAx -
How to get IDM Download Panel HWND?
IgImAx replied to IgImAx's topic in AutoIt General Help and Support
it is worth mentioning that I found a small code at this post too: https://www.autohotkey.com/board/topic/77303-acc-library-ahk-l-updated-09272012/?p=493839 it can be helpful in case of detecting text under mouse pointer: f1:: MsgBox % GetTextUnderMouse() GetTextUnderMouse() { Acc := Acc_ObjectFromPoint(child) try value := Acc.accValue(child) if Not value try value := Acc.accName(child) return value } after run above code if hover mouse over any element in screen and press F1 it will show the how text under it. I can use that trick to search and select between the IDM toolbar menu items. Do we have something similar over here!? -
Hi all For a long time, I am trying to find a way to get the IDM (Internet Download Manager) toolbar HWND, which it called "IDM Download Panel" but no luck! Also I want to find a way to get the text of Listbox it show so I can select desire item from it. I mean this button with red text "Download this video" on it: IDM has an extension for all browsers, this extension will display a toolbar over any embedded media (Audi/video) in browsers. By click on it then it let us to download that media in different qualities. Problem is, "AutoIt Window Info" cannot detect it. But, WinSpy tool can detect this toolbar and give me the HWND & Class name & etc. But yet, I could not get its HWND by using those information with any AutoIt functions!! I found this old post handy: Now, I can use _Mouse_Control_GetInfo() function and set IDM toolbar position (X, y) to find its HWND and with the same way I am able to get HWND of Listbox of this button too. But yet! this is not the right way to find an object Handler by its position, also still I cannot get the text of each item in list too. In my search I found this tool: https://www.autohotkey.com/boards/viewtopic.php?t=26201 With this app: AccViewer.ahk I can get the text of each list, but I have no idea how to convert and use it in AutoIt. Beside that it is using hover over Object trick! I want to use a function like: ControlGetHandle($IdmToolbarTitle, "", $IdmToolbarClassNN) to get its HWND and ... . Source of ACC functions: https://github.com/Drugoy/Autohotkey-scripts-.ahk/blob/master/Libraries/Acc.ahk Thanks in advance IgImAx
-
Using AutoIT with our registering the DLL
IgImAx replied to SilentSnake's topic in AutoItX Help and Support
Hi SilentSnake I know this it old topic, but I was searching for same question in last week and I found my answer in some stackoverflow posts and one old topic on here. So for others that seeking for the same question, I hope this will help you: You do not need to register AutoItX3.DLL or AutoitX3_64.DLL files in the target computers. In this old topic show how to use methods inside those two dll's directly: C# use of the dll, some idears for you. and I use same way in my simple app in C# and test it on other computers without registering any dll. using System; using System.Runtime.InteropServices; using AutoIt; namespace SendKeyCommand { internal static class Program { [DllImport("AutoItX3.dll", SetLastError = true, CharSet = CharSet.Auto)] private static extern int AU3_WinMenuSelectItemByHandle(IntPtr intPtr , string item1 , string item2 = "" , string item3 = "" , string item4 = "" , string item5 = "" , string item6 = "" , string item7 = "" , string item8 = ""); [DllImport("AutoItX3.dll", SetLastError = true, CharSet = CharSet.Auto)] private static extern int AU3_WinMenuSelectItem(string title , string text , string item1 , string item2 = "" , string item3 = "" , string item4 = "" , string item5 = "" , string item6 = "" , string item7 = "" , string item8 = ""); private static void Main() { var intPtr = AutoItX.WinGetHandle("μTorrent"); if (intPtr != IntPtr.Zero) { AU3_WinMenuSelectItemByHandle(intPtr, "&File", "E&xit"); // Or: // AU3_WinMenuSelectItem("μTorrent", "", "&File", "E&xit"); } } } } All methods in these two libraries "AutoItX3.DLL or AutoitX3_64.DLL" listed inside of AutoItX3_DLL.h file under Autoit\AutoitX3 folder. Note this: There are some methods with postfix "...ByHandle" they are overloaded methods that we do not use them with that name in Autoit but you have to specify them in C# just like I did in above sample on "AU3_WinMenuSelectItemByHandle" method. Still, you can add a reference to this "AutoItX3.Assembly.dll" file without any problem. This file does not need any registration on target computers. [I think] You can do the same thing for any *.dll by using DllImportAttribute [DllImport("DllFilename")]. For more info :MSDN DllImportAttribute. For more info please check my solved problem: "[SOLVED] WinMenuSelectItem method cannot find in C#" Happy Coding! IgImAx -
[SOLVED] WinMenuSelectItem method cannot find in C#
IgImAx replied to IgImAx's topic in AutoItX Help and Support
Hi everyone First, I like to thank you all for all help and specially Fernando_Marinho for his solution. I found my answer on this topic: C# use of the dll, some idears for you. about how to use those overloaded methods with "...ByHandle" postfix that doesn't exist in AutoitX3 lib in C#. (If we add it via COM to project reference) using System; using System.Runtime.InteropServices; using AutoIt; namespace SendKeyCommand { internal static class Program { [DllImport("AutoItX3.dll", SetLastError = true, CharSet = CharSet.Auto)] private static extern int AU3_WinMenuSelectItemByHandle(IntPtr intPtr , string item1 , string item2 = "" , string item3 = "" , string item4 = "" , string item5 = "" , string item6 = "" , string item7 = "" , string item8 = ""); [DllImport("AutoItX3.dll", SetLastError = true, CharSet = CharSet.Auto)] private static extern int AU3_WinMenuSelectItem(string title , string text , string item1 , string item2 = "" , string item3 = "" , string item4 = "" , string item5 = "" , string item6 = "" , string item7 = "" , string item8 = ""); private static void Main() { var intPtr = AutoItX.WinGetHandle("μTorrent"); if (intPtr != IntPtr.Zero) { AU3_WinMenuSelectItemByHandle(intPtr, "&File", "E&xit"); // Or: // AU3_WinMenuSelectItem("μTorrent", "", "&File", "E&xit"); } } } } Two important things: Omit all "[MarshalAs(UnmanagedType.LPStr)]" parts. No need to Register AutoItX3.DLL or AutoitX3_64.DLL files in the target computers. (Tested in VMware) No need to Reference AutoItX3 1.0 Type Library in C# (unless you do not want to use above method!) Just adds AutoItX.Dotnet in Manage NuGet Packages or Reference AutoItX3.Assembly.dll manually from AutoitX folder under the audit installation folder. Thanks again everyone. Managers can kindly tag this topic as [ANSWERED] .- 14 replies
-
- winmenuselectitem
- c#
-
(and 1 more)
Tagged with:
-
[SOLVED] WinMenuSelectItem method cannot find in C#
IgImAx replied to IgImAx's topic in AutoItX Help and Support
It does not accept intPtr as first parameter, won't compile! please check the image: I found these two lines in AutoitX3_DLL.h file: AU3_API int WINAPI AU3_WinMenuSelectItem(LPCWSTR szTitle, /*[in,defaultvalue("")]*/LPCWSTR szText, LPCWSTR szItem1, LPCWSTR szItem2, LPCWSTR szItem3, LPCWSTR szItem4, LPCWSTR szItem5, LPCWSTR szItem6, LPCWSTR szItem7, LPCWSTR szItem8); AU3_API int WINAPI AU3_WinMenuSelectItemByHandle(HWND hWnd, LPCWSTR szItem1, LPCWSTR szItem2, LPCWSTR szItem3, LPCWSTR szItem4, LPCWSTR szItem5, LPCWSTR szItem6, LPCWSTR szItem7, LPCWSTR szItem8); Is it possible to use/access WinMenuSelectItemByHandle method!?- 14 replies
-
- winmenuselectitem
- c#
-
(and 1 more)
Tagged with:
-
[SOLVED] WinMenuSelectItem method cannot find in C#
IgImAx replied to IgImAx's topic in AutoItX Help and Support
Hi Fernando_Marinho Thanks! That is working But now I found another problem! Please look at bellow Code: using System; using AutoIt; using AutoItX3Lib; namespace SendKeyCommand { internal static class Program { private static void Main() { var au = new AutoItX3(); var intPtr = AutoItX.WinGetHandle("μTorrent"); if (intPtr != IntPtr.Zero) { // intPtrString will be equal to intPtr in Hex var intPtrString = "0x" + intPtr.ToString("X8"); // Bellow line, Doesn't Work!!? Why!? au.WinMenuSelectItem(intPtrString, "", "&Options", "&Auto Shutdown", "Shutdown when Downloads Complete"); // Bellow line, Will work au.WinMenuSelectItem("μTorrent", "", "&Options", "&Auto Shutdown", "Shutdown when Downloads Complete"); } } } } This line with a window handle as first parameter will not work: au.WinMenuSelectItem(intPtrString, ... While the next line with a title will work! I checked this line: var intPtr = AutoItX.WinGetHandle("μTorrent"); and it finds the right handle, and when I convert it to string it is in the right format. (I checked to make sure it converts it to string in right way, for instance, if intPtr is 0x0008074a its string will be the same "0x0008074a") So why is that line with window handle is not working!?- 14 replies
-
- winmenuselectitem
- c#
-
(and 1 more)
Tagged with:
-
[SOLVED] WinMenuSelectItem method cannot find in C#
IgImAx replied to IgImAx's topic in AutoItX Help and Support
ProcessClose() do the same thing that Process.kill do! Beside that I want to do other stuff I mention too! lol don't get me wrong. I like to use AutoIt inside the VS not only the VS/C# to do automation. Autoit have many many many useful methods that if I want to write them with pure C# it's look like to inventing the bicycle again! And again!!! lol- 14 replies
-
- winmenuselectitem
- c#
-
(and 1 more)
Tagged with:
-
[SOLVED] WinMenuSelectItem method cannot find in C#
IgImAx replied to IgImAx's topic in AutoItX Help and Support
Thanks Earthshine Well! This was my first intention! To make sure that I added Autoit library in the right way! Thanks to you now I know that I did it right! So now I would like to report it ['WinMenuSelectItem' method does not exists in AutoItX] so developers team put its fix in their To Do list. I even try to copy all dll's manually fromlatest Autoit directory too! Still no hope! It's not the right way to close some apps by killing their process! They may have some unsaved data and sometimes they do not need that a user save them first, they will do it automatically when the user chooses the Exit option. In this case (µtorrent) if you kill its process, at next startup, it will start checking all files in its download list and it will make hug disk usage. But still there are some other issues that force me to use 'WinMenuSelectItem' method. I have to send some key commands to µTorrent window, while the workstation is in Lock mode. In that case and based on this article 'Why doesn't my script work on a locked workstation?' only these commands will work: ControlSend() ControlSetText() ControlClick() WinWait() WinExists() WinMenuSelectItem() That's why I need to use 'WinMenuSelectItem' method to send menu commands to µTorrent, not only to close it in the right way, but also to set other options in its menu too like this one: $hWin = WinGetHandle("μTorrent") $result = WinMenuSelectItem($hWin, "", "&Options", "&Auto Shutdown", "Shutdown when Downloads Complete") At the end you may ask why you are not using AutoIt itself (To write the code and compile)!? I prefer C# and VS environment! Anyway. Thanks for your help and I hope this method add to AutoitX.DotNet library in near future updates or bug fixes. Cheers- 14 replies
-
- winmenuselectitem
- c#
-
(and 1 more)
Tagged with:
-
[SOLVED] WinMenuSelectItem method cannot find in C#
IgImAx replied to IgImAx's topic in AutoItX Help and Support
Hi Earthshine Thanks for your fast reply! I already posted code! (But in the image! ) Here it is my code in VS2017: using System; using AutoIt; namespace Send_key_commant_to_a_Window { class Program { static void Main() { IntPtr intPtr = AutoItX.WinGetHandle("µtorrent"); if (intPtr != IntPtr.Zero) { // This line wont compile! This is error message: // 'AutoitX' does not contain a definition of 'WinMenuSelectItem' AutoItX.WinMenuSelectItem(intPtr, "", "&File", "E&xit"); } } } } And here is my AutoIt Code(this working without any problem): $hWin = WinGetHandle("μTorrent") $result = WinMenuSelectItem($hWin, "", "&File", "E&xit") Thanks, I check it, there were two Autoitx and Autoitx.DotNet the first one gives me this error: PM> install-Package AutoItX Attempting to gather dependency information for package 'AutoItX.3.3.12' with respect to project 'Send key commant to a Window', targeting '.NETFramework,Version=v4.5' Gathering dependency information took 0.36 ms Attempting to resolve dependencies for package 'AutoItX.3.3.12' with DependencyBehavior 'Lowest' Resolving dependency information took 0 ms Resolving actions to install package 'AutoItX.3.3.12' Resolved actions to install package 'AutoItX.3.3.12' Retrieving package 'AutoItX 3.3.12' from 'nuget.org'. Adding package 'AutoItX.3.3.12' to folder 'D:\Worx\VC\Send key commant to a Window\packages' Added package 'AutoItX.3.3.12' to folder 'D:\Worx\VC\Send key commant to a Window\packages' Install failed. Rolling back... Package 'AutoItX.3.3.12' does not exist in project 'Send key commant to a Window' Removing package 'AutoItX.3.3.12' from folder 'D:\Worx\VC\Send key commant to a Window\packages' Removed package 'AutoItX.3.3.12' from folder 'D:\Worx\VC\Send key commant to a Window\packages' Executing nuget actions took 534.33 ms install-Package : Failed to add reference to 'AutoItX3'. Could not load file or assembly 'AutoItX3.dll' or one of its dependencies. The module was expected to contain an assembly manifest. At line:1 char:1 + install-Package AutoItX + ~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [Install-Package], Exception + FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PackageManagement.PowerShellCmdlets.InstallPackageCommand Time Elapsed: 00:00:02.6606769 But second one, installed without any problem. But still it cannot find 'WinMenuSelectItem' method!- 14 replies
-
- winmenuselectitem
- c#
-
(and 1 more)
Tagged with:
-
Hi UPDATED Notes: =============================================================================== UPDATED: My main and second questions answered. Here the answers: To add/access WinMenuSelectItem you need to [Thanks to Fernando_Marinho]: Add AutoItX.Dotnet in Manage NuGet Packages Right Click in your Project -> Add -> Reference... -> COM ( Type Libraries )than, check the option AutoItX3 1.0 Type Library using AutoItX3Lib; AutoItX3 au3 = new AutoItX3(); au3.WinMenuSelectItem("", ...) My full source code in C# exists in 11 posts in below. How to access those overloaded methods in AutoitX3 that are not accessible via above method!? Or how to fix AutoitX3 DLL Registration need in target computers without Autoit pre-installed on them!? Please check my post at 14 posts below! =============================================================================== Original Post: I was writing a small app in Autoit to close µTorrent app. It was working. Then I try to import AutoItX into C#, but unfortunately this method WinMenuSelectItem Couldn't find by IntelliSense and If I typed completely it still give me this message: Please check the image. I Google it and I found this QA at stackoverflow: Autoit error within C# application I saw they use this line: au = new AutoItX3Lib.AutoItX3Class(); I figure it how to add 'AutoItX3Lib' to project (by adding 'AutoItX3.dll' to reference) but again! When I use this line: var au = new AutoItX3Class(); I got this error message: Interop type 'AutoItX3Class' cannot be embedded. Use the applicable interface instead. My system info: Visual Studio 2017 Enterprise - v15.5.4 X64 Windows 10 Enterprise 1607 Thanks in advanced IgImAx
- 14 replies
-
- winmenuselectitem
- c#
-
(and 1 more)
Tagged with:
-
@Emiel Wieldraaijer Thanks for your Link, Well! I do not know what make that problem exactly!? @BrewManNH I do not know about that!? cause I have VB.2008 and made a RTL form inside it then test this code on it: Public Class Form1 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim myBrush As New System.Drawing.SolidBrush(System.Drawing.Color.White) Dim formGraphics As System.Drawing.Graphics formGraphics = Me.CreateGraphics() formGraphics.FillRectangle(myBrush, New Rectangle(0, 100, 300, 199)) myBrush.Dispose() formGraphics.Dispose() End Sub End Class The result was this without any problem: Picture 1 I can set all buttons and labels and ... to proper positions based on my RTL language. But there will be at least two problem!: 1) How to place Menus at right side and all theirs sub-menus open base on RTL!? The only way I know (base on my searches!) is that use '$WS_EX_LAYOUTRTL' at GUI level! 2) How to position Close button on left side of GUI and Title bar text place at right side!?
-
Hi all I'm creating simple customized dialog box for my script and It should have Right-to-Left layout so I use $WS_EX_LAYOUTRTL parameter at my GUICreate function. please look at my code(I made it simple by omit all unnecessary lines!): #include <GUIConstantsEx.au3> #include <GDIPlus.au3> #include <WindowsConstants.au3> MsgOkey() Func MsgOkey() Local $win_Okey, $msg Local $img_hGraphic $win_Okey = GUICreate("Test", 386, 131, -1, -1, BitXOR($GUI_SS_DEFAULT_GUI, $WS_MINIMIZEBOX),$WS_EX_LAYOUTRTL) GUISetBkColor(0xFFFFFF) GUISetState() _GDIPlus_Startup() $img_hGraphic = _GDIPlus_GraphicsCreateFromHWND($win_Okey) _GDIPlus_GraphicsFillRect($img_hGraphic, 0, 85, 386, 70,_GDIPlus_BrushCreateSolid(0xF0F0F0F0)) While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE _GDIPlus_Shutdown() GUIDelete() ExitLoop EndSelect WEnd EndFunc After I run it my dialog box will look like this: Picture 1 As you can see at above picture, Why is that "White" part creating!! while it should be fill with Gray Rectangle? (which I specify it by Red-Arrows) If I just remove '$WS_EX_LAYOUTRTL' parameter at the end of GUICreate function, like this: $win_Okey = GUICreate("Test", 386, 131, -1, -1, BitXOR($GUI_SS_DEFAULT_GUI, $WS_MINIMIZEBOX))It will be show that gray rectangle correctly: Picture 2 Why _GDIPlus_GraphicsFillRect function do not work correctly when I use '$WS_EX_LAYOUTRTL' parameter ? Even I make $iWidth parameter of _GDIPlus_GraphicsFillRect function larger than GUI width (more than 386) and it did not work! PS.: (I know about great UDF by others but I just want to create my own simple dialog box, so please do not refer my to others codes, just please solve my problem! Thanks) Best regards
-
Hi all I found a better method for creating MASK file! Therefor, I updated my Post#10 with new method. (Win XP show it too!) But, Still, I like to know how can I solve the problem of GUIImageList function as I describe its problem at Post#1... Cause using and Icon without need to convert it to anything is much easier/better quality results/Less Time Consumer .... Thanks Again
-
Hi Lazycat WooooW! great work! I always think that Autoit need some utility like this one inside it! But this one is more than I expected! I like the fact It can Import au3 files that did not build with it! I'm new at Autoit world and I will start to use your great utility and I will inform you If I did find any bugs or ...! Thanks again for great job
-
Hi AZJIO Thanks for image. Thanks for links, I did check both of them and test them . second link is not complete code while first link is so much better and it think about windows XP and others to separate functions for each OS. But I do not know how to use "__GUICtrlMenuEx_CreateBitmapFromIcon_XP" at my sample code!??! unfurtunetlay all samples over there are for how to use GUICtrlMenuEx for creating Menus and not Buttons! (Update: Please saw better way to use Mask at the bottom of this post) While I try to figure out how to use GUICtrlMenuEx UDF, suddenly I saw $sMask="" parameter at : _GUIImageList_AddBitmap($hWnd, $sImage [, $sMask=""]) Then I try it, and create a BMP file from Install-Win.ico and with Corel PhotoPaint create a BMP Mask for it and the result at XP was like this: Picture 1 As you can see at above image, BMP+Mask showed as I like it on Button! I mean it has transparent border. That was the advantage of it but about disadvantage of it :Now, icons (They are bmp now!) do not have a sharp edges. (there are some bad pixels!) Need more work at Corel PhotoPaint to build smother Mask! I had to add two BMP files to my exe file for each Icon that have above problem!!! To solve both above disadvantages, I think we could use some features inside Autoit!? for example use an UDF to Create a BMP and MASK-BMP of an Icon!!? I found but I did not find out how can I use it!? Anyway, The code I use that make above output at Picture 1 was this one: ; Link: http://www.autoitscript.com/forum/topic/147794-problem-with-quality-of-icons-on-buttons-with-this-guiimagelist-and-disappear-at-xp/ #include <GUIButton.au3> #include <GUIConstantsEx.au3> #include <GUIImageList.au3> Local $hGUI = GUICreate("Autoit v" & @AutoItVersion & " OS: " & @OSVersion,300,130) Local $Filename = "install-win.bmp" Local $MaskFilename = "install-win-mask2.bmp" ;~ ---------------------------------------------------------------------- ;~ [Section 2] GUICtrlCreateButton('Install 2', 205, 10, 85, 105, $BS_BOTTOM) Local $hImageList = _GUIImageList_Create(72, 72, 5,1) _GUIImageList_AddBitmap($hImageList, $Filename,$MaskFilename) _GUICtrlButton_SetImageList(-1, $hImageList, 2,"",10) GUISetState(@SW_SHOW, $hGUI) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd GUIDelete($hGUI)For your Test I put both BMPs here: Icon converted To BMP: Install-Win.bmp Create BMP Mask for Icon: Install-Win-Mask2.bmp (Update) Well! I found a better way to creat a MASK for an Icon/PNG file with Transparent color. Usually a mask should have two color! White & Black. White color will be transparent part of your Icon/PNG and Black part will be Image(visible) part of those files! as you can see at above links I use that method too! but the resualt picture has not greate sharp border! So, I try to examine this way and It answer very well!!: Just use Only one BMP file as Original file and Mask file! The only trick is that you should make transparent part White and hope your image do not have White color in its visible parts!! (Pure! White = RGB (255,255,255) = 0xFFFFFF) here a full screen shot of my app and its new look for Icons that convert to one BMP MASK File: Picture 2 Those Buttons that have Text on them, are using this new MASK method Last Button create as usual with $BS_ICON option, cause it do not have Text on it! If you like to see what I mean in action! Just download bellow file which is like to "Install-Win.bmp" but I did these changes before make it:Convert ICON file to PNG by using 'Microangelo Toolset 6' then open PNG file into Corel PhotoPaint. (you can use Microangelo Toolset to do the rest process but for some shapes its harder to do so!)Deselect current Mask and Select better MASK for it by selection Smooth Border = 1 inside Corel settings and by this option Mask will go to near of first and very very dark visible pixels!Select Default Background Color to WhiteReverse Mask so visible part selecting now.Now, If I press Delete key, none-selected parts will be cleared and fill with White color.Please download and look this new "Install-Win-BetterMasked.bmp": Install-Win-BetterMasked.bmp and change these two lines at above sample to see how it get better borders: Local $Filename = "install-win.bmp" Local $MaskFilename = "install-win-mask2.bmp"With these lines (Both variables use the same file): Local $Filename = "Install-Win-BetterMasked.bmp" Local $MaskFilename = "Install-Win-BetterMasked.bmp" The rest lines are the same as before. Thanks again for your Helps
-
AZJIO Aha! you mean convert ICO file to a BMP file? or take a snapshot of a button while text and icon show on it in a good quality then use that snapshot as a bitmap and put it on the button!? Well that a good Idea and will work. But, Dose it not better that Autoit show Icons without problems in above situations!? Since when it dose show some Icons in proper ways and if they have MASK so they show all changes of windows Themes in right ways, but BMP (Still Images) do not have that capability! am I right? Anyway, that was a good idea and thank you again for keep try to help me and I will keep it that in my mind for the last moments, just in case If some how with some helps the _GUIImageList problem did solved! (cause I like capabilities of these functions) P.S.: Just two things: Showing Text on buttons and Icons(png) Mask capability are important for me too! as I mention before. Cheeeers