Patrice Terrier Posted April 29, 2004 Posted April 29, 2004 Hi I would like to try my WinLIFT Skin Engine with .NET I do have VB.NET and C# but I have never used them realy. Thus I don't know how to use my DLL(s) (unmanaged code) with them. Before I start learning .NET I would like to make sure I could use my WinLIFT Skin Engine DLL with it. Here is the PowerBASIC declaration I would like to translate to .NET '+--------------------------------------------------------------------------+ '| | '| SKSDKAPI.INC | '| | '| WinLIFT simplified API constants and declarations. | '| | '| Version 3.00 | '| | '+--------------------------------------------------------------------------+ '| | '| Author Patrice TERRIER | '| 8 Domaine de Rochagnon. 38800 Champagnier FRANCE | '| [url]http://www.zapsolution.com[/url] | '| E-mail: [email]pterrier@zapsolution.com[/email] | '| | '| copyright (c) 2003 Patrice TERRIER | '| | '+--------------------------------------------------------------------------+ '| Project started on : 02-24-2003 | '| Last revised : 04-15-2003 | '+--------------------------------------------------------------------------+ %SKEFF_SCREENSHOT = -1 ' Use standard screen shot (no WM_PRINT) %SKEFF_NOEFFECT = 0 ' Use standard display mode %SKEFF_FASTDISPLAY = 1 ' Use memory bitmap to speed up display %SKEFF_FADEOUT_ALPHABLENDING = 2 ' Translucent effect from background to window %SKEFF_SLIDE_FROM_TOP = 3 ' Slide effect from top to window location %SKEFF_SLIDE_FROM_BOTTOM = 4 ' Slide effect from bottom to window location %SKEFF_STRETCHBLT_IN_OUT = 5 ' StretchBlt from center ' The main function to skin a window DECLARE FUNCTION skSkinWindow LIB "skSDKapi.dll" ALIAS "skSkinWindow" (BYVAL hWnd&, OPTIONAL zSysButTip AS ASCIIZ, OPTIONAL BYVAL EffectType&) AS LONG '**************************************************************************** '* THESE MUST BE USED WITH WINLIFT's MENU * '**************************************************************************** ' Replace the standard DrawMenuBar API, must be used with WinLIFT's menu DECLARE SUB skDrawMenuBar LIB "skSDKapi.dll" ALIAS "skDrawMenuBar" (BYVAL hWnd&) ' Note: WinLIFT's menu are not standard menu thus do not use the standard API GetMenu ' to retrieve a menu handle but the specific skGetMenu below. ' Instead of using skGetMenu you can also save the menu handle in a global variable and then ' use this global variable in lieu of the GetMenu API. DECLARE FUNCTION skGetMenu LIB "skSDKapi.dll" ALIAS "skGetMenu" (BYVAL hWnd&) AS LONG ' Retrieve the handle of the WinLIFT's menu container DECLARE FUNCTION skMenuContainer LIB "skSDKapi.dll" ALIAS "skMenuContainer" (BYVAL hWnd&) AS LONG '**************************************************************************** '* END OF SKINNED MENU * '**************************************************************************** ' Disable skinning of a specific control DECLARE FUNCTION skSkinDisable LIB "skSDKapi.dll" ALIAS "skSkinDisable" (BYVAL hWnd&) AS LONG ' Enable skinning of a specific control (use it only after a previous call to skSkinDisable) DECLARE FUNCTION skSkinEnable LIB "skSDKapi.dll" ALIAS "skSkinEnable" (BYVAL hWnd&) AS LONG ' Compute X,Y offset to paint skin background behind a control DECLARE SUB skChildOffset LIB "skSDKapi.dll" ALIAS "skChildOffset" (BYVAL hWnd&, ofX&, ofY&) ' Perform window's snapshot, and returns WinLIFT's mem DC to internal memorybitmap DECLARE FUNCTION skSnapShotOn LIB "skSDKapi.dll" ALIAS "skSnapShotOn" (BYVAL hWnd&, OPTIONAL BYVAL Inactive&) AS LONG ' WinLIFT counterpart for DDT MsgBox and SDK MessageBox DECLARE FUNCTION skMessageBox LIB "skSDKapi.dll" ALIAS "skMessageBox" (lpText AS ASCIIZ, OPTIONAL BYVAL dwType AS DWORD, OPTIONAL lpCaption AS ASCIIZ) AS LONG ' Button text to display together with the skMessageBox above ' It must match exactly this: "Abort,Retry,Ignore,Ok,Cancel,Try again,Continue,Yes,No" ' When nothing specified, either English or French is used, based on GetLocaleInfo. DECLARE SUB skSetMsgString LIB "skSDKapi.dll" ALIAS "skSetMsgString" (lpText AS ASCIIZ) '---------------------------------------------------------------------------- %WM_SKNEWFRAMEDISPLAYED = &H400 + &H113 ' &H400 = %WM_USER, &H113 = %WM_TIMER %WM_SKGETMENUICON = &H400 + &H7F ' &H400 = %WM_USER, &H7F = %WM_GETICON ' wParam = menu ID, lParam = %NULL DECLARE FUNCTION skEngineInit LIB "skengine.dll" (BYVAL FilName$) AS LONG Here is a screen shot of the result I would like to get using WinLIFT and .NET together. Do you think it is something possible? http://www.zapsolution.com/zlitezdn.jpg Thank you for any help you could provide me on this. Quote
*Experts* Nerseus Posted April 30, 2004 *Experts* Posted April 30, 2004 I'm not sure what you're doing with the library, how it is planned to interact with .NET. But, in generally, I'd say you could definitely convert it, or at least re-use the library in .NET. Look for "DLLImport" on how to import the external DLL calls into your .NET application. The constants, as with Powerbasic, will have to be defined as normal constants in .NET. If your DLL just takes a handle to a window to handle things, then you can get that from a .NET window. For other issues, you'll need to ask more specific questions. -Nerseus Quote "I want to stand as close to the edge as I can without going over. Out on the edge you see all the kinds of things you can't see from the center." - Kurt Vonnegut
Patrice Terrier Posted April 30, 2004 Author Posted April 30, 2004 The DLL takes control on the flly of the underlaying application. It uses the EnumChildWindow API to subclass existing controls. But so far I found that .NET doesn't use anymore the standard SDK API classes but classes of its own (at least VB.NET) thus making hard for me to guess what each of the control realy does (I have used SPYXX to detect the class names and the style being used). Does C# and VB.NET uses the same classes when using the low level API CreateWindowEx? Quote
*Experts* Nerseus Posted April 30, 2004 *Experts* Posted April 30, 2004 I don't know that ClassName they use. I know in VB6 (and under) days all windows had the same classname, ThunderForm or something similar (hold over from VB1 days if I remember). A Spy tool should be able to show you the classname, to determine if it's a common name like "DotNet" or the class's name "frmMain". If the DLL is yours, why not change its interface to receive the handle to the window you want to hook into? -ner Quote "I want to stand as close to the edge as I can without going over. Out on the edge you see all the kinds of things you can't see from the center." - Kurt Vonnegut
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.