Transparent shell.. [message #448150] |
Tue, 04 January 2005 00:17 |
Eclipse User |
|
|
|
I found a message in this newsgroup before and I couldnt get the DLL working
I always got UnSatisifedLinkError and I'm not good at C++ so here is my C++
source code for DLL, could anyone tell me whats wrong and which steps should
I take after compile the DLL file properly? should I register it? by the way
I put the dll file under system32, thanks..
#include <stdafx.h>
#include <jni.h>
#include "resource.h"
typedef DWORD (WINAPI *PSLWA)(HWND, DWORD, BYTE, DWORD);
static PSLWA pSetLayeredWindowAttributes = NULL;
static BOOL initialized = FALSE;
#define WS_EX_LAYERED 0x00080000
HINSTANCE g_hInstance = NULL;
#define LWA_COLORKEY 0x00000001
#define LWA_ALPHA 0x00000002
JNIEXPORT jboolean JNICALL Java_OSEx_SetLayeredWindowAttributes(JNIEnv *env,
jclass theClass, jint windowHandle, jobject crKey, jint alpha,jint flags) {
printf( "%d\n", GetLastError() ); // error catching
if (!initialized)
{
HMODULE hDLL = LoadLibrary ("user32");
printf( "%d\n", GetLastError() ); // error catching
pSetLayeredWindowAttributes =
(PSLWA) GetProcAddress(hDLL, "SetLayeredWindowAttributes");
initialized = TRUE;
}
pSetLayeredWindowAttributes((HWND)windowHandle, (COLORREF)RGB(255,255,255),
(BYTE)alpha, (DWORD)flags );
return( 0 );
}
|
|
|
Powered by
FUDForum. Page generated in 0.06367 seconds