Welcome to the forums!
Why can't you create a window. I think you will be able to create a window and use DirectInput or the joystick API (no guarantees!).
When you have a window, you need a message loop. You will also need to attach your thread to the interactive/input desktop. The code to do that should look something like this:
Code:
HWINSTA hwinstaSave;
HDESK hdeskSave;
HWINSTA hwinstaUser;
HDESK hdeskUser;
// Ensure connection to service window station and desktop, and save their handles.
GetDesktopWindow();
hwinstaSave = GetProcessWindowStation();
hdeskSave = GetThreadDesktop(dwThreadId);
// Connect to the interactive window station and desktop.
hwinstaUser = OpenWindowStation(TEXT("WinSta0"), FALSE, MAXIMUM_ALLOWED);
SetProcessWindowStation(hwinstaUser);
hdeskUser = OpenInputDesktop(0, FALSE, MAXIMUM_ALLOWED);
SetThreadDesktop(hdeskUser);
// Create window, receive input, etc here!
// Once you're done restore window station and desktop.
SetThreadDesktop(hdeskSave);
SetProcessWindowStation(hwinstaSave);
CloseDesktop(hdeskUser);
CloseWindowStation(hwinstaUser);
However, I'm not sure whether you can attach to the WinLogon desktop, so you'll have to try it and see.