Commit 3bc30c37 authored by Rémi Bernon's avatar Rémi Bernon Committed by Alexandre Julliard

joy.cpl: Draw xinput controller state with gdi32.

parent 3f4a7990
MODULE = joy.cpl
IMPORTS = dxguid dinput dinput8 ole32 comctl32 user32 advapi32 xinput
IMPORTS = dxguid dinput dinput8 ole32 comctl32 user32 gdi32 advapi32 xinput
EXTRADLLFLAGS = -Wb,--prefer-native
......
......@@ -29,5 +29,6 @@
#include "resource.h"
extern INT_PTR CALLBACK test_xi_dialog_proc( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam );
extern LRESULT CALLBACK test_xi_window_proc( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam );
#endif /* __JOY_PRIVATE_H */
......@@ -1015,6 +1015,23 @@ static void display_cpl_sheets( HWND parent, struct JoystickData *data )
OleUninitialize();
}
static void register_window_class(void)
{
WNDCLASSW xi_class =
{
.hInstance = hcpl,
.lpfnWndProc = &test_xi_window_proc,
.lpszClassName = L"JoyCplXInput",
};
RegisterClassW( &xi_class );
}
static void unregister_window_class(void)
{
UnregisterClassW( L"JoyCplXInput", hcpl );
}
/*********************************************************************
* CPlApplet (joy.cpl.@)
*
......@@ -1041,6 +1058,7 @@ LONG CALLBACK CPlApplet(HWND hwnd, UINT command, LPARAM lParam1, LPARAM lParam2)
{
HRESULT hr;
register_window_class();
device_state_event = CreateEventW( NULL, FALSE, FALSE, NULL );
/* Initialize dinput */
......@@ -1082,6 +1100,7 @@ LONG CALLBACK CPlApplet(HWND hwnd, UINT command, LPARAM lParam1, LPARAM lParam2)
IDirectInput8_Release(data.di);
CloseHandle( device_state_event );
unregister_window_class();
break;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment