08-19-2019 02:30 PM - edited 08-19-2019 02:32 PM
Hi!
We have some problems with lvinput.dll if it's used in .exe which is installed as Windows service (Win7SP1/Win10b1809).
Simple .exe with keyboard/mouse access works ok.
Same .exe with administrator rights works too.
When .exe is loaded as service during Windows startup it does not work.
First of all "Query Input Devices VI" cannot find mouse device at all.
Then "Initialize Keyboard VI" and "Acquire Input Data VI" return no errors, but gets always nothing.
Does any limitation of lvinput.dll usage exist ?
Is there any workaround of this issue ?
Thanks a lot!
Solved! Go to Solution.
08-19-2019 03:36 PM
Windows service not suppose to have a user interface.
You will have to create a separate GUI for user input.
08-20-2019 12:59 AM
Just tried such scheme: main .exe as a service which calls second .exe with user input.
Actually I got same result(
Looks like "service" environment is very specific and even call second .exe does not help.
What kind of instruments are used under hood of "lvinput.dll" ?WinAPI events or DirectX or what ?
08-20-2019 01:35 AM - edited 08-20-2019 01:40 AM
A service works in a different session that has since Windows 7 no access to most UI subsystems in Windows. That includes screen and everything else (actually keyboard and mouse might have been inaccessible before since it simply doesn’t make sense for a service and even poses security risks).
If you start another exe from your service it executes in the same session with the same limitations. What Goerge meant is to create a separate exe that runs in the normal user session (when you are logged in) or one of the other. 3 possible workstation sessions (which are almost never used in Windows 😀) but equally require a logged in user. Then have them communicate with each other through TCP/IP or some other IPC (inter process communication) mechanism.
If you really want to create a piece of software that needs access to the hardware while nobody is logged in you won’t get around writing a Windows device driver and that can only be done in C(++).
08-22-2019 01:57 AM - edited 08-22-2019 01:58 AM
Thank you for the detailed explanation!