package com.sun.jna.platform.win32;

import java.awt.Frame;

import junit.framework.TestCase;
import sun.awt.windows.WComponentPeer;

import com.sun.jna.Pointer;
import com.sun.jna.platform.win32.WinDef.HWND;

public class Wtsapi32Test extends TestCase {

	private long peer = 0;

	private HWND hwnd;

	public static void main(String[] args) {
		junit.textui.TestRunner.run(Wtsapi32Test.class);
	}

	public Wtsapi32Test() {
		Frame frame = new Frame();
		frame.setVisible(true);
		this.peer = ((WComponentPeer) frame.getPeer()).getHWnd();
		this.hwnd = new HWND(new Pointer(peer));
	}

	public void testWTSRegisterSessionNotification() {
		boolean result = Wtsapi32.INSTANCE.WTSRegisterSessionNotification(hwnd,
				Wtsapi32.NOTIFY_FOR_ALL_SESSIONS);
		assertEquals(true, result);
	}

	public void testWTSUnRegisterSessionNotification() {
		// needed to register before you can unregister!
		testWTSRegisterSessionNotification();
		boolean result = Wtsapi32.INSTANCE
				.WTSUnRegisterSessionNotification(hwnd);

		assertEquals(true, result);
	}
}

@@ -69,31 +69,25 @@
 ort 
-junit.framework.TestCas
+com.sun.jna.Nativ
 e;%0D%0A
@@ -97,38 +97,32 @@
 ort 
-sun.awt.windows.WComponentPeer
+junit.framework.TestCase
 ;%0D%0A%0D
@@ -258,16 +258,22 @@
 private 
+final 
 long pee
@@ -277,12 +277,8 @@
 peer
- = 0
 ;%0D%0A%0D
@@ -287,16 +287,22 @@
 private 
+final 
 HWND hwn
@@ -509,51 +509,32 @@
 r = 
-((WComponentPeer) frame.getPeer()).getHWnd(
+Native.getWindowID(frame
 );%0D%0A

allow platform project to compile on non-windows jvm.