bleh Posted June 26, 2013 Share Posted June 26, 2013 Hello I know how to make a GUI with GUIcreate, GUIctrlcreatelist, etc. But is there a way to skin them? I could remove borders, menus and so on from the GUIcreate form but then i won't be able to drag the window anymore and the buttons, editboxes etc would still have the windows look. So, is there an easy way to make a custom gui? Link to comment Share on other sites More sharing options...
FireFox Posted June 26, 2013 Share Posted June 26, 2013 Hi, Welcome to the autoit forum A simple search with the keyword "skin" would have lead you to >this topic. Br, FireFox. Link to comment Share on other sites More sharing options...
bleh Posted June 26, 2013 Author Share Posted June 26, 2013 Thanks. Yeah i found EzSkin... but i thought there might be another way. Link to comment Share on other sites More sharing options...
FireFox Posted June 26, 2013 Share Posted June 26, 2013 Or >this topic. You can create your own skin with pngs and a layered child GUI. Br, FireFox. Link to comment Share on other sites More sharing options...
bleh Posted June 26, 2013 Author Share Posted June 26, 2013 Okay. I rephrase my question. Is there a way to make a custom UI without having to use a 3d party DLL/script and without having to pay hundreds of dollars for skincrafter? If so.. how? Are there any tutorials or examples? Link to comment Share on other sites More sharing options...
BrewManNH Posted June 27, 2013 Share Posted June 27, 2013 Okay. I rephrase my question. Is there a way to make a custom UI without having to use a 3d party DLL/script and without having to pay hundreds of dollars for skincrafter? If so.. how? Are there any tutorials or examples? I'm not sure what you mean by 3rd party script, but without some type of external elements such as png/jpg/bmp files, you're in for a lot of effort for little gain. I'd use something like XSkin or USkin for easy skinning. If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator Link to comment Share on other sites More sharing options...
FireFox Posted June 27, 2013 Share Posted June 27, 2013 (edited) Try this :expandcollapse popup#include <WindowsConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <Constants.au3> #include <GDIPlus.au3> #include <WinAPIEx.au3> Local $aFile[3] = ["5qa.png", "15u.jpg", "ag5.jpg"], $hGet = 0 For $i = 0 To UBound($aFile) -1 $hGet = InetGet("http://img.myzupics.com/ab/" & $aFile[$i], @TempDir & "\" & $aFile[$i]) InetClose($hGet) Next Local $hBmp = 0, $hHBmp = 0, $tSize = 0, $iWidth = 0, $iHeight = 0 Local $hGUI = 0, $hGUILayered = 0, $iLabelBtnCustom = 0, $iBtnOK = 0 _GDIPlus_Startup() $hBmp = _GDIPlus_BitmapCreateFromFile(@TempDir & "\" & $aFile[0]) $hHBmp = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBmp) _GDIPlus_ImageDispose($hBmp) $tSize = _WinAPI_GetBitmapDimension($hHBmp) $iWidth = DllStructGetData($tSize, 1) $iHeight = DllStructGetData($tSize, 2) #region GUI $hGUI = GUICreate("MyGUI", $iWidth, $iHeight, -1, -1, $WS_POPUP, BitOR($WS_EX_LAYERED, $WS_EX_TOPMOST)) $hGUILayered = GUICreate("", $iWidth, $iHeight, -1, -1, $WS_POPUP, BitOR($WS_EX_LAYERED, $WS_EX_MDICHILD), $hGUI) GUISetBkColor(0x2B5280, $hGUILayered) $iPicBtnCustom = GUICtrlCreatePic(@TempDir & "\" & $aFile[1], 20, 20, 101, 24) GUICtrlSetState($iPicBtnCustom, $GUI_DISABLE) $iLabelBtnCustom = GUICtrlCreateLabel("Click me", 20, 20, 101, 24, BitOR($SS_CENTER, $SS_CENTERIMAGE)) GUICtrlSetBkColor($iLabelBtnCustom, $GUI_BKCOLOR_TRANSPARENT) GUICtrlSetCursor($iLabelBtnCustom, 0) $iBtnOK = GUICtrlCreateButton("OK", ($iWidth - 70) / 2, $iHeight - 45, 70, 22) GUICtrlSetState($iBtnOK, $GUI_FOCUS) _WinAPI_SetLayeredWindowAttributes($hGUILayered, 0x2B5280, 0, $LWA_COLORKEY) _WinAPI_UpdateLayeredWindowEx($hGUI, -1, -1, $hHBmp) GUISetState(@SW_SHOW, $hGUILayered) GUISetState(@SW_SHOW, $hGUI) #endregion Local $aCi = 0, $blBtnCustomHovered = False While 1 Sleep(10) Switch GUIGetMsg() Case $GUI_EVENT_CLOSE, $iBtnOK ExitLoop Case $iLabelBtnCustom MsgBox($MB_SYSTEMMODAL, Default, "It works !", 0, $hGUILayered) EndSwitch $aCi = GUIGetCursorInfo($hGUILayered) If IsArray($aCi) = 0 Then ContinueLoop If $aCi[4] = $iLabelBtnCustom _ And Not $blBtnCustomHovered Then GUICtrlSetImage($iPicBtnCustom, @TempDir & "\" & $aFile[2]) $blBtnCustomHovered = True ElseIf $aCi[4] <> $iLabelBtnCustom _ And $blBtnCustomHovered Then GUICtrlSetImage($iPicBtnCustom, @TempDir & "\" & $aFile[1]) $blBtnCustomHovered = False EndIf WEnd GUIDelete($hGUI) _WinAPI_DeleteObject($hBMP) _GDIPlus_Shutdown() For $i = 0 To UBound($aFile) -1 FileDelete(@TempDir & "\" & $aFile[$i]) NextEdit: Added indents.Note: The WinAPIEx library is only needed for the _WinAPI_GetBitmapDimension function, you can use instead _GDIPlus_ImageGetWidth/Height.Br, FireFox. Edited June 27, 2013 by FireFox Link to comment Share on other sites More sharing options...
bleh Posted June 27, 2013 Author Share Posted June 27, 2013 Thanks guys. I'm not sure what you mean by 3rd party script, but without some type of external elements such as png/jpg/bmp files, you're in for a lot of effort for little gain. I'd use something like XSkin or USkin for easy skinning. What i meant by that is that i was looking for a way to skin without having to use a DLL file or a second .au3. Of course i would have to save the images somewhere. So that i end up in the end with something like this: appdirapp.exe appdirfilesskinfile1.png appdirfilesskinfile2.png Anyways, i don't have time to test around right now, but a quick look at USkin, XSkin and what FireFox posted, seemed good. I'll test around with that later. Thanks Link to comment Share on other sites More sharing options...
Zedna Posted June 28, 2013 Share Posted June 28, 2013 Maybe this will help you too Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
Draygoes Posted July 4, 2013 Share Posted July 4, 2013 One of the ways that I like to handle this is to create a GUI with no boarder. Then you are free to create the boarder for yourself. If you are looking for somthing more custom than that, you arnt likely to find it. This is not only a solution for autoit, but any programming language that deals with interfaces. Spoiler "If a vegetarian eats vegetables,What the heck does a humanitarian eat?" "I hear voices in my head, but I ignore them and continue on killing." "You have forced me to raise the indifference warning to beige, it's a beige alert people. As with all beige alerts please prepare to think about the possibility of caring." An optimist says that giving someone power DOESN'T immediately turn them into a sadist. A pessimist says that giving someone power doesn't IMMEDIATELY turn them into a sadist. Link to comment Share on other sites More sharing options...
funkey Posted July 4, 2013 Share Posted July 4, 2013 Skin without DLL? Why do this? You could use a DLL and run it from memory.But if you don't want to do this, then this is the hard way to go for you: It's by far not complete, just a start. A lot of work, only to see that AutoIt is a bit to slow for things like this. Programming today is a race between software engineers striving tobuild bigger and better idiot-proof programs, and the Universetrying to produce bigger and better idiots.So far, the Universe is winning. Link to comment Share on other sites More sharing options...
bleh Posted July 5, 2013 Author Share Posted July 5, 2013 Thanks, but i found a way without using much extra stuff now, which suits my simple needs. Link to comment Share on other sites More sharing options...
Zedna Posted July 5, 2013 Share Posted July 5, 2013 Then share it with us! That's how this community works. Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
bleh Posted July 5, 2013 Author Share Posted July 5, 2013 (edited) It's really simple and not that useful in the grand scheme of things but it works for the tiny little prog i'm doing. I'm new to AutoIt and i'm not sure yet what is 'elegant' coding and what the do's and do not's are, so i'm kind of shy posting my scripts. But i will quickly make an example of how i did it and post it in a few mins. Edit: Here it is, if anyone cares (don't laugh ): simple.rar Credit goes to the script from this post by melba23: Edited July 5, 2013 by bleh Link to comment Share on other sites More sharing options...
BrewManNH Posted July 5, 2013 Share Posted July 5, 2013 I once made a GUI for a project of mine, in AutoIt, that looked like a CD, complete with the hole in the middle, and it was round. I accomplished this by using an image of a CD as the background of my GUI. If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator Link to comment Share on other sites More sharing options...
funkey Posted July 5, 2013 Share Posted July 5, 2013 Programming today is a race between software engineers striving tobuild bigger and better idiot-proof programs, and the Universetrying to produce bigger and better idiots.So far, the Universe is winning. Link to comment Share on other sites More sharing options...
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