Hi there...
i need to turn off the display (monitor) of a pc programmatically...
Well the code in C++ is the following:
..tried to use jna...
but as always (just a hole in the water) - i am not much java guy...
as far... but nothing at all... :-(
Can anyone help on that conversion of code..?
i need to turn off the display (monitor) of a pc programmatically...
Well the code in C++ is the following:
B4X:
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
// Turn off monitor
SendMessage(HWND_BROADCAST, WM_SYSCOMMAND, SC_MONITORPOWER, (LPARAM) 2);
..tried to use jna...
but as always (just a hole in the water) - i am not much java guy...
as far... but nothing at all... :-(
B4X:
Dim user32 As JavaObject
user32 = user32.InitializeStatic("com.sun.jna.platform.win32.User32").GetField("INSTANCE")
Dim ahwnd As JavaObject
ahwnd=ahwnd.InitializeNewInstance("com.sun.jna.platform.win32.WinDef.HWND","0xffff")
Dim awmsys As JavaObject
awmsys=awmsys.InitializeNewInstance("com.sun.jna.platform.win32.WinDef.WPARAM","0xf170")
Dim scmon As JavaObject
scmon=scmon.InitializeNewInstance("com.sun.jna.platform.win32.WinDef.LPARAM","0x112S")
user32.RunMethod("SendMessage",Array(ahwnd,scmon,awmsys,2))
Can anyone help on that conversion of code..?