Hello Arnaud, > Maybe easiest is to run an applescript for this. > I haven't found a function for that. Sleeping the whole computer is easy, but > just the screen seems to be deeply implemented in some IOKit… Not an actual answer, rather an idea... As you know, Mac OS is able to deal with activ coins, where the user can set up a screen sleep. So, it should be, somewhere in frameworks, some code doing that. Unfortunately, I don't know where...
Another possibility, based on that, is to set up a coin for screen sleeping, and then to move the cursor in this coin in order to turn the screen in sleeping mode. HTH Jean-Luc Arnaud Le 20/11/2015 10:23, Marnaud a écrit : > Le 19 nov. 2015 à 13:40, Christian Schmitz <[email protected]> a > écrit: > >> Well, QueryStandby is older event (Windows XP maybe). >> QuerySuspend is newer event, I think. > Thanks. So it's reasonable to think I can rely on the QuerySuspend event > alone. > My early tests suggests I don't get such an event. Should I get one when the > user chooses “Sleep” or when the computer idles so long that it sleeps by > itself (or both)? > >>> I'm also wondering whether it's possible to get the Win32 and Linux mouse >>> cursor shape (the Mac one is already doable with the NSCursor class). >> see here for Windows: >> https://msdn.microsoft.com/en-us/library/windows/desktop/ms648388(v=vs.85).aspx >> and >> https://msdn.microsoft.com/en-us/library/windows/desktop/ms648389(v=vs.85).aspx >> >> Maybe those help? > The first is of no help (only for owning app, which never shows an UI). The > second one, I'm having troubles with; in particular, I don't understand this > sentence: “Note that you must set the cbSize member to sizeof(CURSORINFO) > before calling this function.”. This is my test code: > > dim b as Boolean > dim m as new MemoryBlock(1000) 'Hoping it's big enough to hold all the data > so I can later resize it down > > Declare Function GetCursorInfo lib "User32.dll" (pic as ptr) as Boolean > > b=GetCursorInfo(m) > > b is false and m is filled with zeroes. > What's wrong? > >>> Any news about a function to directly return a screenshot of any monitor >>> directly as a string? >> Sorry, no. > Ok, I can wait. I'm hoping you still consider it :-) > >> Sorry. The plugin can do a lot, but not everything. > No problem. I'm just giving my questions as a “stack” and then include what's > doable. > >>> Is it possible to turn a Mac screen to sleep? The declares I found are hard >>> to translate in Xojo code. >> Maybe easiest is to run an applescript for this. > I haven't found a function for that. Sleeping the whole computer is easy, but > just the screen seems to be deeply implemented in some IOKit… > > Thank you for your answers. > _______________________________________________ > Mbsplugins_monkeybreadsoftware.info mailing list > [email protected] > https://ml01.ispgateway.de/mailman/listinfo/mbsplugins_monkeybreadsoftware.info > _______________________________________________ Mbsplugins_monkeybreadsoftware.info mailing list [email protected] https://ml01.ispgateway.de/mailman/listinfo/mbsplugins_monkeybreadsoftware.info
