Crash Posted November 13, 2009 Posted November 13, 2009 Hi, I am curious how other software have an UAC logo in their GUI. ESET Smart Security and Avira have it. I don't think they go around and insert a picture for that, but uses some sort of scripts. Because in Vista, it appears as the default 4 colours while in Win7, it appears as the 2-coloured logo, or to be simple, the logo is not the same as in Vista. You can see that they uses scripts, but not by inserting pictures. Is there any scripts in AutoIt to do this? JPGRAR | Mouse Lock | My website | Thanks so much for your help! ❤️
Tomb Posted November 13, 2009 Posted November 13, 2009 Maybe you can GUICtrlSetImage and add a picture to the button.The help file saysA Button control can display an icon or image by using the $BS_ICON or $BS_BITMAP style. Use GUICtrlSetImage to specify the picture to use.I kept pressing cancel on your picture and was wondering why it wouldn't close.
Vadersapien Posted November 13, 2009 Posted November 13, 2009 I think those UAC shields are placed there by Windows Vista/7 automatically when it detects an action the requires elevation...not sure if this works with AutoIt though(Probably not)... Anyway, you can use the actual UAC icon from imagres.dll like this: $UACButton = GUICtrlCreateButton("OK", 0, 0, 75, -1, BitOr(-1, $BS_ICON)) If @OSVersion < "WIN_VISTA" Then GUICtrlSetImage(-1, "imageres.dll", 78, 0) EndIf Confirmed working on both Vista and 7...and the UAC logo won't appear on XP or lower. Hope that's what you wanted Try Pacfox, my Firefox theme.Try Power Eject, my windows gadget that allows you to eject most drives.Using AutoIt 3.3.4.0, Windows 7 Premium, Intel Core 2 Quad CPU @ 2.66ghz, 4gb RAM, Nvidia GeForce 9500GT Graphics Card & Samsung 22" Monitor.
Authenticity Posted November 13, 2009 Posted November 13, 2009 #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> GUICreate("Title", 100, 100) $Button = GUICtrlCreateButton("&Ok", 15, 38, 70, 24) GUICtrlSendMsg($Button, $BCM_SETSHIELD, 0, 1) GUISetState() While 1 Switch GUIGetMsg() Case $Button MsgBox(0x40, "Title", "Text") Case $GUI_EVENT_CLOSE GUIDelete() Exit EndSwitch WEnd
TurionAltec Posted November 13, 2009 Posted November 13, 2009 @Authenticity:Cool! Except for the fact that the window icon appears on top of the minimize button
Moderators Melba23 Posted November 13, 2009 Moderators Posted November 13, 2009 TurionAltec, So make the window a little wider! M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
BinaryBrother Posted November 13, 2009 Posted November 13, 2009 Hey... Now that's a nice find Auth! SIGNATURE_0X800007D NOT FOUND
GEOSoft Posted November 13, 2009 Posted November 13, 2009 I think those UAC shields are placed there by Windows Vista/7 automatically when it detects an action the requires elevation...not sure if this works with AutoIt though(Probably not)... Anyway, you can use the actual UAC icon from imagres.dll like this: $UACButton = GUICtrlCreateButton("OK", 0, 0, 75, -1, BitOr(-1, $BS_ICON)) If @OSVersion < "WIN_VISTA" Then GUICtrlSetImage(-1, "imageres.dll", 78, 0) EndIf Confirmed working on both Vista and 7...and the UAC logo won't appear on XP or lower. Hope that's what you wanted The If statement is syntacticly incorrect and yes it will work, even without the If statement because the file imageres.dll is not available in XP and lower. George Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number. Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else. "Old age and treachery will always overcome youth and skill!"
Kealper Posted November 13, 2009 Posted November 13, 2009 i've found that exact image they used, yea it is in imageres.dll, but i do like Auth's method alotGUICtrlSetImage($Button, "imageres.dll", -2, 0)this worked in windows 7, not sure if they changed that around at all compared to vista, so it might display a diff picture in vista
Crash Posted November 14, 2009 Author Posted November 14, 2009 (edited) Thanks to you all~! Especially for the scripts, tips and tiny screenshot! Edited November 14, 2009 by Crash JPGRAR | Mouse Lock | My website | Thanks so much for your help! ❤️
rajeshontheweb Posted November 14, 2009 Posted November 14, 2009 hmm, coming back to the original question, i dont know if Crash did want to mean this, but i would like to know if AutoIT's scripts can get the imageres icon automatically and not be programmed 1) as mentioned above, avira and other few products get this - and i have a feeling it should be the OS which assigns the image and not the programmers. 2) if we program it to show the image it might give a wrong impression that it is compatible with vista UAC and it is the OS which assigned it (of course, its not an issue, but the programmer will have to double check all the requisites for that button to appear so that the user doesnt get misleaded... for simple scripts it might be very easy solution to use the imageres.dll - i do like the solutions posted.. but my question is if AutoIT scripts can get the elevation assigned by Windows and not the programmer.. this is like with windows xp / above u have an update to be installed, u get an option with shutdwn button which indicates there is an update tbe installed before shutting down!! Started late is much better than having never started it!!!!Failure is another step towards success. I've been messing around with: Adding Entry to 'Hosts'File Information Lister (Logger)Yet Another AutoIT Error Handler Yet Another AutoIT Error Handler & Debugger Control your App's TaskBar Button YCurrency Ticker (Latest Release : 16 Apr 2009)_WinInetInternetCheckConnection UDF Symantec Definitions Lister UDF _GetLocalIPAddresses UDF UDF to get Special Folder Information WMI_NetworkAdapterConfiguration2Array WMI_CDRomDriveCapabilities _ScriptExists - Check if your au3 script is running!! Uninstaller UDF Get Version for your application (at script level or compiled stage) Uninstaller Pro - faster alternative to windows application removal applet
BinaryBrother Posted November 14, 2009 Posted November 14, 2009 (edited) Straight from the help file... An alternative... expandcollapse popup#AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 #include <GUIConstantsEx.au3> #include <GuiButton.au3> #include <WindowsConstants.au3> #include <GuiMenu.au3> Opt("MustDeclareVars", 1) Global $btn, $btn2 ; Note the controlId from these buttons can NOT be read with GuiCtrlRead _Main() Func _Main() Local $hGUI $hGUI = GUICreate("Buttons", 400, 400) $btn = _GUICtrlButton_Create($hGUI, "Button1", 10, 10, 90, 30) _GUICtrlButton_SetShield($btn) $btn2 = _GUICtrlButton_Create($hGUI, "Button2", 10, 60, 90, 30, $BS_SPLITBUTTON) _GUICtrlButton_SetShield($btn2) GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd Exit EndFunc ;==>_Main P.S. I just tested it on XP SP3, and the button works perfect with no shield. If your wanting to verify that UAC is enabled before displaying the shield, then do something like this... If RegRead("HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System", "EnableLUA") > 0 Then GUICtrlSetImage($ButtonHandle, "imageres.dll", -2, 0) EndIf 1) as mentioned above, avira and other few products get this - and i have a feeling it should be the OS which assigns the image and not the programmers.I believe this is incorrect. You must specify that the button being pressed is going to require permission elevation. Developer assigned. Edited November 14, 2009 by BinaryBrother SIGNATURE_0X800007D NOT FOUND
rajeshontheweb Posted November 14, 2009 Posted November 14, 2009 I believe this is incorrect. You must specify that the button being pressed is going to require permission elevation. Developer assigned.thanks for the clarification, i was under the impression it was OS assigned. if this was gonna be the case, i would have added the part you have just done (verify if UAC is turned on) Started late is much better than having never started it!!!!Failure is another step towards success. I've been messing around with: Adding Entry to 'Hosts'File Information Lister (Logger)Yet Another AutoIT Error Handler Yet Another AutoIT Error Handler & Debugger Control your App's TaskBar Button YCurrency Ticker (Latest Release : 16 Apr 2009)_WinInetInternetCheckConnection UDF Symantec Definitions Lister UDF _GetLocalIPAddresses UDF UDF to get Special Folder Information WMI_NetworkAdapterConfiguration2Array WMI_CDRomDriveCapabilities _ScriptExists - Check if your au3 script is running!! Uninstaller UDF Get Version for your application (at script level or compiled stage) Uninstaller Pro - faster alternative to windows application removal applet
BinaryBrother Posted November 14, 2009 Posted November 14, 2009 Well, I'm not 100% sure... But I'm fairly certain... Would be nice if GEO or Auth could back that up. SIGNATURE_0X800007D NOT FOUND
Vadersapien Posted November 14, 2009 Posted November 14, 2009 I'm sure I've used some pre-vista applications which have the UAC logo on particular buttons... Try Pacfox, my Firefox theme.Try Power Eject, my windows gadget that allows you to eject most drives.Using AutoIt 3.3.4.0, Windows 7 Premium, Intel Core 2 Quad CPU @ 2.66ghz, 4gb RAM, Nvidia GeForce 9500GT Graphics Card & Samsung 22" Monitor.
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