=sinister= Posted August 13, 2008 Share Posted August 13, 2008 I'm trying to use skincrafter to skin a label with the default color, however this won't work: DllCall("./SkincrafterDLL.dll", "int:cdecl", "SetCustomSkinWnd", "long", $GUI, "bstr", $test, "bool", "false") Here is the syntax etc.. expandcollapse popupDescription Applies a custom skin for the proper window/control. Syntax void SetCustomSkinWnd( long hWnd, BSTR skinName, BOOL isFrame, ) Parameters hWnd Handle to the window the custom skin will be applied to. skinName The string identifier of the proper custom skin isFrame The boolean value used to indicate whether the window specified by hWnd should use a custom skinning for its frame (TRUE) or apply custom skin to the window itself (FALSE) Remarks If the custom skin specified by skinName does not exist in a loaded .skf file, the default skinning is applied. Example public DMSoft.SkinCrafter SkinOb; public System.Windows.Forms.Button Button1; public System.Windows.Forms.Button Button2; public System.Windows.Forms.Form Form1; //Button1 will be skinned with Default button skin applied //Button2 will be skinned with "MyButtonGreen" button skin applied SkinOb.SetCustomSkinWnd(Button2.Handle.ToInt32() , "MyButtonGreen", false); //Form1 frame will be skinned with "MyDialogFrame" frame skin applied //Note: the third parameter is set to true, otherwise the Dialog background is applied; SkinOb.SetCustomSkinWnd(Form1.Handle.ToInt32(), "MyDialogFrame", true); Link to comment Share on other sites More sharing options...
weaponx Posted August 13, 2008 Share Posted August 13, 2008 "bstr" and "bool" are not valid datatypes for dllcall, use "str" and "int". Link to comment Share on other sites More sharing options...
=sinister= Posted August 13, 2008 Author Share Posted August 13, 2008 Alight I looked at the datatypes for the DllCall function, and I can't quite figure out the return types for the last 2 functions in the dllcall. This isn't working: DllCall("./SkincrafterDLL.dll", "int:cdecl", "SetCustomSkinWnd", "hwnd", $GUI, "str", $test, "str", "false") The first function is the Handle, of course the return type will be hwnd, right? Second function is the label I am skinning using GUICtrlCreateLabel() Third is a boolean, true or false. Link to comment Share on other sites More sharing options...
weaponx Posted August 13, 2008 Share Posted August 13, 2008 DllCall("./SkincrafterDLL.dll", "int:cdecl", "SetCustomSkinWnd", "long", $GUI, "str", $test, "int", 0) Link to comment Share on other sites More sharing options...
=sinister= Posted August 14, 2008 Author Share Posted August 14, 2008 Hrm still doesn't do anything, Why did you set the return type for the $GUI as long instead of hwnd? Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted August 14, 2008 Moderators Share Posted August 14, 2008 All this time using skincrafter, and you can't use your old resources?http://www.autoitscript.com/forum/index.ph...st&p=342206BSTR is a Visual Basic string.Why he used "long"void SetCustomSkinWnd( long hWnd, BSTR skinName, BOOL isFrame,)So you probably have to open the dll and initiate the license first, then set the skin. You'd use the BSTR function for BSTR, and we use "int" for Bool (1 = True, 0 = False)."long", hwnd, "int", BSTR("Skin Name/Would be in the skin directory"), "int", 0 Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
=sinister= Posted August 14, 2008 Author Share Posted August 14, 2008 Thanks for the summary Smoke_N, I have not used skincrafter in a long time, and a lot in skincrafter has changed since that code you posted. (Plus I did not write that code) Anyways, I am confused on how to specify what label to not skin. Notice in the example, it specifies the button in which to not skin, how would this be in autoit since there is only a parameter for the window handle, and not the control handle. Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted August 14, 2008 Moderators Share Posted August 14, 2008 Thanks for the summary Smoke_N, I have not used skincrafter in a long time, and a lot in skincrafter has changed since that code you posted. (Plus I did not write that code) Anyways, I am confused on how to specify what label to not skin. Notice in the example, it specifies the button in which to not skin, how would this be in autoit since there is only a parameter for the window handle, and not the control handle.Do you see this in the summary you postedButton2.Handle.ToInt32()? That would tell you that it's not the hwnd of the window it wants, the hwnd (handle) of the button it wants. Next question from you I'm sure: "How do I get the handle to the button?" << Is that right? You undoubtedly gave your button a variable name, which when using the native GUICtrlCreateButton() function will return a control ID and not a HWND. So I would probably do something like:$hWnd = ControlGetHandle($hGUI, "", $i_MyButtonICreated)Then use the $hWnd as the handle/Long to pass. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
=sinister= Posted August 14, 2008 Author Share Posted August 14, 2008 Thanks for the reply, you guess on my next question was exactly right! So far I have this: Func _SkinGUI($SkincrafterDll, $SkincrafterSkin, $Handle) $Dll = DllOpen($SkincrafterDll) DllCall($Dll, "int:cdecl", "InitLicenKeys", "wstr", "SKINCRAFTER", "wstr", "SKINCRAFTER.COM", "wstr", "support@skincrafter.com", "wstr", "DEMOSKINCRAFTERLICENCE") DllCall($Dll, "int:cdecl", "InitDecoration", "int", 1) DllCall($Dll, "int:cdecl", "LoadSkinFromFile", "wstr", $SkincrafterSkin) DllCall($Dll, "int:cdecl", "DecorateAs", "int", $GUI, "int", 25) DllCall($Dll, "int:cdecl", "ApplySkin") EndFunc ;==>_SkinGUI Func BSTR($str) $len = StringLen($str) $buff = DllCall("oleaut32.dll", "int", "SysAllocStringLen", "int", 0, "int", $len) DllCall("kernel32.dll", "int", "MultiByteToWideChar", "int", 0, "int", 0, "str", $str, "int", $len, "ptr", $buff[0], "int", $len) Return $buff[0] EndFunc #Include <GUIConstants.au3> $GUI = GUICreate("") _SkinGUI("./SkinCrafterDll.dll", "./Skin.skf", $GUI) $Marker7 = GUICtrlCreateLabel("?", 50, 50, 53, 33) GUICtrlSetFont(-1, 18, 800, 0, "MS Sans Serif") GUICtrlSetColor($Marker7, 0x00FF00) $Handle = ControlGetHandle($GUI, "", $Marker7) DllCall("./SkinCrafterDLL.dll", "int:cdecl", "SetCustomSkinWnd", "long", $Handle, "int", BSTR("./Skin.skf"), "int", 0) GUISetState(@SW_Show) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case -3 Exit EndSwitch WEnd However, nothing seems to happen to $Marker7, the skin remains the same. My goal is to try to get it back to the windows default, so it will be green. Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted August 14, 2008 Moderators Share Posted August 14, 2008 (edited) Thanks for the reply, you guess on my next question was exactly right! So far I have this: Func _SkinGUI($SkincrafterDll, $SkincrafterSkin, $Handle) $Dll = DllOpen($SkincrafterDll) DllCall($Dll, "int:cdecl", "InitLicenKeys", "wstr", "SKINCRAFTER", "wstr", "SKINCRAFTER.COM", "wstr", "support@skincrafter.com", "wstr", "DEMOSKINCRAFTERLICENCE") DllCall($Dll, "int:cdecl", "InitDecoration", "int", 1) DllCall($Dll, "int:cdecl", "LoadSkinFromFile", "wstr", $SkincrafterSkin) DllCall($Dll, "int:cdecl", "DecorateAs", "int", $GUI, "int", 25) DllCall($Dll, "int:cdecl", "ApplySkin") EndFunc;==>_SkinGUI Func BSTR($str) $len = StringLen($str) $buff = DllCall("oleaut32.dll", "int", "SysAllocStringLen", "int", 0, "int", $len) DllCall("kernel32.dll", "int", "MultiByteToWideChar", "int", 0, "int", 0, "str", $str, "int", $len, "ptr", $buff[0], "int", $len) Return $buff[0] EndFunc #Include <GUIConstants.au3> $GUI = GUICreate("") _SkinGUI("./SkinCrafterDll.dll", "./Skin.skf", $GUI) $Marker7 = GUICtrlCreateLabel("?", 50, 50, 53, 33) GUICtrlSetFont(-1, 18, 800, 0, "MS Sans Serif") GUICtrlSetColor($Marker7, 0x00FF00) $Handle = ControlGetHandle($GUI, "", $Marker7) DllCall("./SkinCrafterDLL.dll", "int:cdecl", "SetCustomSkinWnd", "long", $Handle, "int", BSTR("./Skin.skf"), "int", 0) GUISetState(@SW_Show) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case -3 Exit EndSwitch WEnd However, nothing seems to happen to $Marker7, the skin remains the same. My goal is to try to get it back to the windows default, so it will be green.I'm not exactly sure what this function does for you. You assume it removes the skin, but I'm reading it as it sets a skin and will not skin something if you so request it. I would use it after my initialization of my license (while the dll is open), as I stated before. And you seem to assume the "./Skin.skf" is acceptable, are you sure it doesn't need the full path? After all, that dll is not made in autoit, so you can't assume the same rules apply. Edit: P.S. That sets a skin, if you are using the same skin, you're like a fly hitting a window. I don't think this function prevents any hwnd from "not" being skinned, because if it's false, then it reverts to default skin (which the skin you initialized to begin with). Edited August 14, 2008 by SmOke_N Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
=sinister= Posted August 14, 2008 Author Share Posted August 14, 2008 (edited) I asked in the skincrafter support forum on how to change the color of a skinned label, and Paul (Admin) told me to use that function. Edited August 14, 2008 by =sinister= Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted August 14, 2008 Moderators Share Posted August 14, 2008 I asked in the skincrafter support forum on how to change the color of a skinned label, and Paul (Admin) told me to use that function.Yeah, but he's assuming you are going to use your own skin to do it I would think. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
=sinister= Posted August 14, 2008 Author Share Posted August 14, 2008 (edited) I think you are right, seeing as how the DoNotDecorate function works fine, however, the background of the label is not transparent, which is most likely a autoit problem. Do you how to set a label's background transparent. --edit-- making the labels background transparent will not show the background of the skinned GUI, instead it just shows white. strange. Edited August 14, 2008 by =sinister= Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted August 14, 2008 Moderators Share Posted August 14, 2008 I think you are right, seeing as how the DoNotDecorate function works fine, however, the background of the label is not transparent, which is most likely a autoit problem. Do you how to set a label's background transparent.--edit--making the labels background transparent will not show the background of the skinned GUI, instead it just shows white. strange.And now you know what your task is. To create a custom skin for each thing you want to change.BTW, what version of skf are you using? Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
=sinister= Posted August 14, 2008 Author Share Posted August 14, 2008 Thanks, I now know whats needed to do. Using version 3.1.0.0 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