randeep Posted June 17, 2009 Posted June 17, 2009 (edited) hello all pls see this. is there any possibility to place the an icon just before heading of the second window through AutoIt (Just like the Styled AutoIt "A" icon (Blue) at the address bar)????? (not able to upload the images) thanx in advance Edited June 17, 2009 by randeep [font="Palatino Linotype"]Randeep Singh[/font][sub][/sub]
somdcomputerguy Posted June 17, 2009 Posted June 17, 2009 I'm not sure if I can understand correctly, but perhaps this helps? See GUICtrlCreateIcon. - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change.
ProgAndy Posted June 17, 2009 Posted June 17, 2009 Or do you want GUISetIcon? *GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes
randeep Posted June 18, 2009 Author Posted June 18, 2009 actually i am trying to place icons of '.ico' format, just before the heading of the GUI at the blue strip(created with GuiCreate).E.G. when you click C:\ on you computer, then C:\ drive window opens, just see the leftmost top of the window, a harddisk icon is there, just before heading in the blue strip. (i think i am not able to explain better then this. )http://images.google.co.in/imgres?imgurl=h...sa%3DN%26um%3D1pls follow the link to see '.ico' format.thanx [font="Palatino Linotype"]Randeep Singh[/font][sub][/sub]
DjDeep00 Posted June 18, 2009 Posted June 18, 2009 @randeep... ProgAndy is correct you need to use Guiseticon() like this... #include <GUIConstantsEx.au3> Opt('MustDeclareVars', 1) Example() Func Example() Local $msg GUICreate("My GUI new icon") ; will create a dialog box that when displayed is centered GUISetIcon("shell32.dll",-20) ; will change icon GUISetState(); will display an empty dialog box ; Run the GUI until the dialog is closed While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then ExitLoop WEnd EndFunc ;==>Example
trancexx Posted June 18, 2009 Posted June 18, 2009 You can even complicate that and do it this way:expandcollapse popup#include <GUIConstantsEx.au3> Opt('MustDeclareVars', 1) Example() Func Example() Local $msg Local $hGui = GUICreate("My GUI new icon"); will create a dialog box that when displayed is centered ;GUISetIcon("shell32.dll", -20); will change icon _GUISetIcon($hGui, "shell32.dll", 20); name and not ordinal value GUISetState(); will display an empty dialog box ; Run the GUI until the dialog is closed While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then ExitLoop WEnd EndFunc ;==>Example Func _GUISetIcon($hGui, $sModule, $iName); this for loaded modules in this shape Local $a_hCall = DllCall("kernel32.dll", "hwnd", "GetModuleHandleW", "wstr", $sModule) Local $hModule = $a_hCall[0] $a_hCall = DllCall("user32.dll", "hwnd", "LoadImageW", _ "hwnd", $hModule, _ "int", $iName, _ "dword", 1, _; IMAGE_ICON "int", 32, _ "int", 32, _ "dword", 0); LR_DEFAULTCOLOR Local $hIcon = $a_hCall[0] DllCall("user32.dll", "hwnd", "SendMessageW", _ "hwnd", $hGui, _ "dword", 0x0080, _; WM_SETICON "dword", 1, _; 1 = ICON_BIG, 0 = ICON_SMALL "hwnd", $hIcon) EndFunc ;==>_GUISetIconWhy would you do that? Because it will change ALT-TAB icon as well (built-in function forgets that)Btw, DjDeep00 advices randeep... that's deep, Muad'Dib ♡♡♡ . eMyvnE
ProgAndy Posted June 18, 2009 Posted June 18, 2009 There is also an other way to to it Set with GUISetIcon and then set "small" icon to "large" icon with Sendmessage. expandcollapse popup#include <GUIConstantsEx.au3> Opt('MustDeclareVars', 1) Example() Func Example() Local $msg Local $hGui = GUICreate("My GUI new icon"); will create a dialog box that when displayed is centered ;GUISetIcon("shell32.dll", -20); will change icon _GUISetIcon($hGui, "shell32.dll", 20); name and not ordinal value GUISetState(); will display an empty dialog box ; Run the GUI until the dialog is closed While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then ExitLoop WEnd EndFunc ;==>Example Func _GUISetIcon($hGui, $sModule, $iName); this for loaded modules in this shape GUISetIcon($sModule, $iName, $hGui) Local $a_hCall = DllCall("user32.dll", "lresult", "SendMessageW", _ "hwnd", $hGui, _ "dword", 0x007F, _; WM_GETICON "wparam", 0, _; 1 = ICON_BIG, 0 = ICON_SMALL "lparam", 0) DllCall("user32.dll", "lresult", "SendMessageW", _ "hwnd", $hGui, _ "dword", 0x0080, _; WM_SETICON "wparam", 1, _; 1 = ICON_BIG, 0 = ICON_SMALL "lparam", $a_hCall[0]) EndFunc ;==>_GUISetIcon *GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes
trancexx Posted June 18, 2009 Posted June 18, 2009 There is also an other way to to it Set with GUISetIcon and then set "small" icon to "large" icon with Sendmessage. expandcollapse popup#include <GUIConstantsEx.au3> Opt('MustDeclareVars', 1) Example() Func Example() Local $msg Local $hGui = GUICreate("My GUI new icon"); will create a dialog box that when displayed is centered ;GUISetIcon("shell32.dll", -20); will change icon _GUISetIcon($hGui, "shell32.dll", 20); name and not ordinal value GUISetState(); will display an empty dialog box ; Run the GUI until the dialog is closed While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then ExitLoop WEnd EndFunc ;==>Example Func _GUISetIcon($hGui, $sModule, $iName); this for loaded modules in this shape GUISetIcon($sModule, $iName, $hGui) Local $a_hCall = DllCall("user32.dll", "lresult", "SendMessageW", _ "hwnd", $hGui, _ "dword", 0x007F, _; WM_GETICON "wparam", 0, _; 1 = ICON_BIG, 0 = ICON_SMALL "lparam", 0) DllCall("user32.dll", "lresult", "SendMessageW", _ "hwnd", $hGui, _ "dword", 0x0080, _; WM_SETICON "wparam", 1, _; 1 = ICON_BIG, 0 = ICON_SMALL "lparam", $a_hCall[0]) EndFunc ;==>_GUISetIconYes, yes. That way is having problem with ALT-TAB icon size/resolution though. It's enlarged 16x16 with all that comes with that. ♡♡♡ . eMyvnE
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now