Jump to content
Sign in to follow this  
JScript

_UskinLibrary.au3 (UDF) - Skin with DLL free (no ads) and fully functional!

Recommended Posts

I'm still adding these functions commented on post #86, but you can use as the form below:


I use the program ?do=embed' frameborder='0' data-embedContent> to embed the skin, there you will have to use this case as follows:
;
#include "_UskinLibrary.au3"
#include ".SkinsOldSkool.au3"; <-- This is an skin ".msstyles" embedded in .au3.

_Uskin_LoadDLL()
_USkin_Init(_OldSkool(True)); <-- Call in this format!
;

See the program documentation ?do=embed' frameborder='0' data-embedContent> for more information about how to call files embedded!

Regards,

João Carlos.

Edited by JScript

http://forum.autoitbrasil.com/ (AutoIt v3 Brazil!!!)

Somewhere Out ThereJames Ingram

somewh10.png

dropbo10.pngDownload Dropbox - Simplify your life!
Your virtual HD wherever you go, anywhere!

Share this post


Link to post
Share on other sites

I know this but I don't want to it this way! I want to read it directly from the resource or memory without saving it to disk first and loading it afterwards. ;)

Br,

UEZ

Edited by UEZ

Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Share this post


Link to post
Share on other sites

Post the code you're using so that we can see what you're trying and what's not working.


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 Gude
How 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

Share this post


Link to post
Share on other sites

hello, thank you for your quick answer.

sorry, my bad it's _GuiCtrlButton_SetImageLIST that doesn't work ! the images dissapear. you can try with the example in the help file. What I need is a button with image and text.

_GuiCtrButton_SetImage works well.

Share this post


Link to post
Share on other sites

Are you compiling the exe as a 32 bit executable? How are you referencing the skin file in your script?

Also, if you're not using FileInstall on the DLL and the skin files, make sure that your script is point to where they are.


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 Gude
How 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

Share this post


Link to post
Share on other sites

@legend

Note:

Some skins have problems if the program is compiled using UPX compression, to circumvent this problem compile your program with the following options added to the top of the source code:

#AutoIt3Wrapper_Compression=0 ;Compression parameter 0-4 0=Low 2=normal 4=High. Default=2
#AutoIt3Wrapper_UseUpx=n ;(Y/N) Compress output program. Default=Y

JS


http://forum.autoitbrasil.com/ (AutoIt v3 Brazil!!!)

Somewhere Out ThereJames Ingram

somewh10.png

dropbo10.pngDownload Dropbox - Simplify your life!
Your virtual HD wherever you go, anywhere!

Share this post


Link to post
Share on other sites

Hello,

LarsJ helped me solve a problem in post. It works great but when I apply Uskin on this script, then it doesn't work anymore.

I found out that Uskin seems to not fire the WM_DRAWITEM message anymore. Following this post is a small example that demonstrate how the WM_DRAWITEM is not executed.

Does anyone have any idea on how to get WM_DRAWITEM work with Uskin?

#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_UseUpx=n
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <StructureConstants.au3>
#include <GuiTab.au3>
#include "_UskinLibrary.au3"
#include "_UskinLibrary.au3"


;---------------------------------
;Try to comment / uncomment these next lines and
;see how it affects WM_DRAWITEM. If WM_DRAWITEM
;is executed, then you should see a message in the
;Console and the text in the Tab should be "WM_DRAWITEM Tab 1":
_Uskin_LoadDLL()
_USkin_Init(@ScriptDir & "SkinsOldSkool.msstyles")
;---------------------------------


Global Const $ODT_TAB = 101
Global Const $ODA_DRAWENTIRE = 0x1
Global Const $ODS_SELECTED = 0x0001

Opt("MustDeclareVars", 1)

Global $hGui, $idTab, $hTab, $aPos

MainScript()


Func MainScript()

$hGui = GUICreate("Test", 500, 500)
$idTab = GUICtrlCreateTab(50, 50, 400, 296, $TCS_OWNERDRAWFIXED)
$hTab = GUICtrlGetHandle($idTab)

;Register WM_DRAWITEM
GUIRegisterMsg($WM_DRAWITEM, "WM_DRAWITEM")
GUISetState()

_GUICtrlTab_SetMinTabWidth($hTab, 150)
_GUICtrlTab_InsertItem($hTab, 0, "Tab 0")
_GUICtrlTab_InsertItem($hTab, 1, "Tab 1")
_GUICtrlTab_InsertItem($hTab, 2, "Tab 2")

; Loop until user exits
Do
Until GUIGetMsg() = $GUI_EVENT_CLOSE
GUIDelete()

EndFunc ;==>MainScript


Func WM_DRAWITEM($hWnd, $Msg, $wParam, $lParam)
;Display a console message when WM_DRAWITEM is executed
ConsoleWrite("+WM_DRAWITEM Fired!" & @CRLF)

Local $tDRAWITEMSTRUCT = DllStructCreate("uint cType;uint cID;uint itmID;uint itmAction;uint itmState;" & _
"hwnd hItm;hwnd hDC;dword itmRect[4];dword itmData", $lParam)

If DllStructGetData($tDRAWITEMSTRUCT, "cType") <> $ODT_TAB Then Return $GUI_RUNDEFMSG
If DllStructGetData($tDRAWITEMSTRUCT, "itmAction") <> $ODA_DRAWENTIRE Then Return $GUI_RUNDEFMSG

Local $itmID = DllStructGetData($tDRAWITEMSTRUCT, "itmID")

Local $tBuffer = DllStructCreate("char[256]")
;Also if WM_DRAWITEM is executed then the name should be something like "WM_DRAWITEM Tab 1"
DllStructSetData($tBuffer, 1, "WM_DRAWITEM Tab " & $itmID)
Local $itmText = DllStructGetData($tBuffer, 1)

DllStructSetData($tDRAWITEMSTRUCT, "itmRect", DllStructGetData($tDRAWITEMSTRUCT, "itmRect", 1) + 4, 1)
DllStructSetData($tDRAWITEMSTRUCT, "itmRect", DllStructGetData($tDRAWITEMSTRUCT, "itmRect", 2) + 4, 2)

Local $hDC = DllStructGetData($tDRAWITEMSTRUCT, "hDC")

If DllStructGetData($tDRAWITEMSTRUCT, "itmState") = $ODS_SELECTED Then
_WinAPI_SetTextColor($hDC, 0x0000FF) ; Red, BGR
Else
_WinAPI_SetTextColor($hDC, 0x000000)
EndIf

DllCall("user32.dll", "int", "DrawText", "hwnd", $hDC, "str", $itmText, "int", StringLen($itmText), _
"ptr", DllStructGetPtr($tDRAWITEMSTRUCT, "itmRect"), "int", $DT_LEFT)

Return $GUI_RUNDEFMSG
EndFunc ;==>WM_DRAWITEM

To see the example working, try to comment / uncomment the lines 17 and 18.

Thanks,

jmon

[EDIT]

I also want to point out that _GUICtrlTab_HighlightItem doesn't work with uskin either, maybe because of the WM_DRAWITEM issue.

Edited by jmon

Share this post


Link to post
Share on other sites

I believe it's a limitation of Windows that if it's skinned the Windows messages are changed. Doing a search on this, I've run across a couple of codeproject pages mentioning a problem like this.


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 Gude
How 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

Share this post


Link to post
Share on other sites

I believe it's a limitation of Windows that if it's skinned the Windows messages are changed. Doing a search on this, I've run across a couple of codeproject pages mentioning a problem like this.

That would be a pity, but seems like you may be right... :(

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...