Can I create Windows screen saver with Adobe AIR? - air

Is it technically possible to create a screen saver for Windows using Adobe AIR?

A work around is to host a .swf within a Windows form exe. I currently do this with C#/.Net 4.0. First you need to configure the .exe to behave as a screensaver. When you are done, you need to rename your .exe to .scr. Within the windows form, you need to embed a Flash Active X Object, then set the windows form to borderless etc.
If needed, the .swf can communicate to the .scr via the fscommand call. I for example, listen for the mouseMove event, within the .swf, then tell the .scr to close via fscommand.
There is a free utility that converts .swf files to screensavers called InstantStorm, but I personally prefer the Windows form method, as it allows more control.
Embedding the flash object
Windows form to screensaver

Yes it is.
What you can do is compile your AIR project with -captive-runtime OR -target bundle (Makes it a standalone .exe instead of .air file).
For windows, simply rename your .exe to .scr, right click and choose install or test.
If you want to set it up for configuration and preview modes, you can listen for the application invoke event:
//put this in your app main constructor
NativeApplication.nativeApplication.addEventListener(InvokeEvent.INVOKE, invokEventHandler, false, 0, true);
protected function invokEventHandler(e:InvokeEvent):void {
//you don't actually have to loop as it will always be the first argument
for each(var a:String in e.arguments) {
//p - Show the screensaver in the screensaver selection dialog box
if (a.indexOf("/p")) {
//do something different for preview mode
break;
}
//s - Show the screensaver full-screen
if (a.indexOf("/s")) {
//the main full screen mode
break;
}
//c - Show the screensaver configuration dialog box
if (a.indexOf("/c")) {
//show a configuration window
break;
}
}
}

Related

FullScreen window is not working properly

I have a MainWindow supposed to be always on full screen mode. A Dialog pops up when button "Open Dialog" is clicked. On a desktop system, Ubuntu 20.04, the application works correctly.
When a Dialog pops up, the MainWindow remains at full screen mode. However, on JetsonNano Ubuntu 18.04, the Task bar pops up and the MainWindow is not at full screen mode when the Dialog is opened. Has anyone get the same problem? Why is the difference?
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);
this->showFullScreen();
}
void MainWindow::on_btn_dialog_clicked()
{
Dialog *dialog = new Dialog();
dialog->show();
}
Documentation says:
Full-screen mode works fine under Windows, but has certain problems under X. These problems are due to limitations of the ICCCM protocol that specifies the communication between X11 clients and the window manager. ICCCM simply does not understand the concept of non-decorated full-screen windows. Therefore, the best we can do is to request a borderless window and place and resize it to fill the entire screen. Depending on the window manager, this may or may not work. The borderless window is requested using MOTIF hints, which are at least partially supported by virtually all modern window managers.
An alternative would be to bypass the window manager entirely and create a window with the Qt::X11BypassWindowManagerHint flag. This has other severe problems though, like totally broken keyboard focus and very strange effects on desktop changes or when the user raises other windows.
X11 window managers that follow modern post-ICCCM specifications support full-screen mode properly.

How can i keep focus on my own application or regain it when lost in delphi? [duplicate]

I need to create a simple Delphi application, kiosk style.
It is a very simple thing, a single form where the user writes some personal info to register to an event. 4 TEdit and a TButton.
What I want to achieve is to avoid the user does any action different then typing in TEdit or clicking on the TButton. For example I don't want he does ALT TAB (switchin applications), pressing windows key on keyboard, doing ctrl-alt-canc, etc...
I can add a passowrd protected Button that enables/disables this "Kiosk mode", in this way as I need to exit the kiosk mode I simply press that button and exit.
How to achieve this "kiosk mode" in Delphi without intercepting all the keystrokes manually? Or did anyone already develop this so it can be shared?
I think you'd better create a new desktop, and run your app in there. When your app is done, you can bring back user's desktop. That is how Windows login screen works. Of course Windows login screen uses a special secure desktop. Your app in a separate desktop would be isolated. You will have a desktop background with no start menu, taskbar, or desktop icons because explorer.exe is not running there automatically. Of course a can start a new process, using Task Manager, but desktops in Windows are securable objects; therefore, you can make restrictions if you want. Of course if your app has sufficient permissions.
To create a new desktop, you can use CreateDesktop Windows API, and to switch to the newly created desktop, you can use OpenDesktop function.
You can try Change the Windows Shell.
When you start windows, you don't execute the default shell (explorer.exe), you can execute your application.
Al internet you can find alternative Shell (more attractive) to default windows like:
BlueBox or
SharpE
This option is used for purposes similars at the application that you are developing. Kiosks or TPV.
For change the default applicacion you must modify a registry key:
In Win3.x and Win9x, SYSTEM.INI file:
[boot]
shell=MiAplicacion.exe
In Win2k and WinXP, use Registry:
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon]
Shell=MiAplicacion.exe
If you test this option, think the mode to turn the configuration to the original value (button or option). You must reboot to test changes.
ADDED: In addition, if you search on the web some similar at this "Delphi Change default windows shell", you can find more code, samples and information about this.
Regards
P.D: Excuse me for mistakes with english.
Well but if someone can open the taskmgr he could just create a new task and run explorer.exe from there so its not really secure though...
Ok Taskmgr can be stopped with policies...
Well and for disabling the cad sequence you can use saslibex which Remko Weijnen had created you can find it here: SASLibEx
kindest regrads,
s!

How to prevent displaying window on application startup osx

I am learning Objective-C and programming applications for OS X. I want to write myself a simple notifier, which should work this way:
connect to website and check, if there is new content (I have that covered)
display window with action buttons like "ignore", "visit website" (this is also easy)
I thought, that I will add my app to startup and if there are no changes on the website - just terminate it. But the window with action buttons will pop up before application checks, if there is a new content and window will flash quickly. How do I prevent that?
Is there a better way to create something like this? For example instead of running my application during startup - running a daemon, that will check the website every 24 hours and then display the window? How can I do that?
Recently, I read Start Developing Mac Apps Today, so I might be still missing something obvious.
Select NSWindow and just turn off Visible At Launch.
If you want to show the window, do it manually as follows.
- (void)applicationWillFinishLaunching:(NSNotification *)notification {
/* Do whatever necessary before the window appears */
[window setIsVisible:YES];
}
Personally, I never have the Visible-At-Launch switch on.

Open a PDF file from a WinJS Application

I've got an application in which the user clicks a button, and should be presented a PDF that is stored in the application.
They can view the PDF internally in the app, or launch the native windows PDF viewer, either way is fine.
How can I provide a link / event handler for the button click to launch a view of a PDF file?
Use the LaunchFileAsync function of the Launcher class,
description: Starts the default app associated with the specified file, using the specified options.
example code:
Windows.System.Launcher.launchFileAsync(file, options).done( /* Your success and error handlers */ );

Hiding a Mac application from the dock

I am trying to create an application with the only purpose to implement a Applescript dictionary, and extend Applescript.
I have read of faceless applications (agents), but my application allows Applescript scripts to show some dialog boxes.
What can I do to avoid my application icon appears in the dock when it is invoked by Applescript?
Agent applications can show dialog boxes if they want to.
The Agent overview here mentions this.
To set it specify LSUIElement as 1 in your info.plist file.