App that is not showing on projector - c#

Is there a way to create an app on .NET that will be used when connected with projector/external PC but will be shown only on main screen?
Thanks.

I don't think this is possible. Powerpoint has the functionality of showing notes just on the primary display. But this is only possible when the desktop gets extended and not mirrored to the beamer.
So you shold have to extend the desktop to the beamer and then place the App window on the main screen manually.
System.Windows.Forms.Screen.AllScreens gives you access to monitor information in C#. The PrimaryScreen Property tells you, which screen is the main Screen. You may move the window from one screen to another by respecting the screen widths.

Related

C# Embedd A Non-Winforms Application into a Winform Application

I want to embedd an application (Hikvision iVMS-4200) into my winform .net application. The application appears to use custom rendering for its GUI, and a loading screen appears before the main window is launched.
In more detail, I want the window of this app to be confined within the window area of my application in a locked position (user can't move the embedded window), and display other things in the same parent window (for example a picture).
I have tried solutions such as this. It worked perfectly, but only with notepad. This solution doesn't work with the application I want (the process is opened successfuly but it is in a completely independant window).
My guess is that the app (again, Hikvision iVMS-4200) uses OpenGL for a custom GUI or another type of non-native GUI library. As a though, shouldn't any application on windows have atleast a single main window? could I access and edit its position and parenting properties? Any solution would be highly appreciated.

WP8 - How to disable the app Splash Screen for certain pages?

I have an app that uses a Splash Screen when it opens up, and it works fine.
The problem is that I've added a couple of pages that can be accessed via two live tiles, and the point is to let the user istantly load a certain section of the app without having to load the whole MainPage.xaml page, which is quite heavy to load.
These two pages are really simple and load almost istantly, but the app loads the Splash Screen anyways, and I don't like that.
Is there a way to "disable" the splash screen for a specific page?
Via C# or directly from the XAML, I don't know.
I enabled the Splash Screens simply by adding the SplashScreenImage.screen-WXGA.jpg (720p and 1080p as well) to the project main directory.
Thanks! :)
Sergio
No. You can't disable the splash screen. What you can do is to minimize all initialization work your app has to do so that the splash screen is shown for a minimum of time.
Sergio,
You can simulate a splash screen and decide based on how you were activated to show it or not. This sample shows one way to do it: https://code.msdn.microsoft.com/windowsapps/Splash-screen-sample-89c1dc78/
I would show it for the main xaml and others that take a long time to load and dismiss it in code.

Hosting WPF/Surface application within WPF/Surface application

I am trying to create a parent WPF/surface application which will host multiple WPF/surface applications. I am looking for some pointers of how to implement such functionality. Was reading http://msdn.microsoft.com/en-us/library/ms742522.aspx but it talks about hosting Win32 content in WPF and vice versa.
My idea is to have something similar to MDI forms where you have a main form and you can instantiate multiple child forms.
In my case, these would be different applications which will be launched using a config file and loaded within the main application.
Also, since is there a way to ensure that the main window's process memory is not hogged by the child process initiated.
Edit:
The host application will launch different applications based on what user selects. One can say its like an application launcher which are build on WPF/Surface touch SDK. Now once the application is launched the launcher goes in the background(except showing small button to bring it forward again at some point later) and when the user ends the current application launcher comes back again in foreground. The only interaction i feel which is necessary is knowing the launched application is terminated or invoking applications in a limited screen area. If someone has seen the Microsoft surface application launcher, even when the application is launched there are corner buttons which bring the app launcher to foreground.
I would first look at using Microsoft Prism, specifically the Modularity namespace.
Except for the "different applications" part, it sounds like a classic case for MVVM. Are these "different applications" actually separate applications, or could they simply be separate projects within the same application? That may simplify the choice of presentation.
I suppose you could still have a View called "Host" that presents a different app.
Of course, WPF doesn't have the concept of MDI, but you can open multiple, non-modal windows.
It really depends on what you mean by "hosting". Does the main window need to somehow handle and/or interact with the other applications, or is it just a launching pad for other applications?
I followed this approach to solve this problem. The launcher was not hosting the application within itself but would launch a new application and hide itself.
Steps I followed:
The main launcher application will run in Kiosk mode i.e always on top/no option to close by capturing the close event/No instance shown in taskbar/no title bar/killing the explorer.exe/hiding the taskbar.
The launcher populates a horizontal listbox (data templated for UI) which lets occupied main center area of screen and can be scrolled either ways.
When user selected an item on listbox, click/tap event a separate process is launched with launcher window's visibility set to hidden and a small button(basically a window with just a button inside and size set to height/width of button) created on the either corner of the screen with always on top option.
The functionality of button is to minimize the current working application and set visibility of launcher back to visible and setting the focus to this window.
Since the process is launched by launcher, i trap the close event for the launched window to know user ended the application and then again pop up the launcher back.

How to put a C# programm (ex WPF or WF or with Mono) under desctop Icons (like a wallpaper)?

How to put a C# programm (ex WPF or WF) under desctop Icons (like a wallpaper)?
I want my Old Good XP Active Desktop made by a some open source C# programm on my Win 7!)
Something like this - Fences .
They have there "windows" appearing underneath icons. I do not want to manage Icons - just put my window under them... BTW any one knows about such operations in other OS’s (Mac etc)?
And I DO NOT WANT TO MANAGE ALL THE ICONS ON MY OWN LIKE bumptop
I think it is quite possible, try this:
Find handle to window with the class "Progman".
Create some window in your application (or, perhaps, in some separate application, you will see the purpose later) and turn off its borders.
Set the parent of the newly created window to desktop handle.
Set the parent of "Progman" window you have found previousely to the window you created.
Desktop will be put on a window owned by your application and it will be possible to manipulate it in the way you want (namely, put something under it).
Also, do not forget to restore desktop's parent when application owning it is closed.
Look for FindWindow, GetClassName and SetParent at http://www.pinvoke.net/
Short answer is you can't really do it (in managed C# anyway). If it's possible, you would need to use Interop, and you'd likely be calling something that Windows doesn't offer as an API.
... although... as Ole Jak mentioned, Stardock looks to be doing it somehow...
The desktop is its own contained item. The same process handles the icons and the wallpaper "behind" those icons.
You are allowed to change the wallpaper to a different image, and you used to be able to create an Active Desktop where HTML content would be displayed, but this was discontinued in Vista.
What are you actually trying to do? Maybe there's another way to achieve a similar result?
There was DreamScene for vista. You could put a video as explorer background. I dont know if you could run a C# program to output the background video.

Setting location of the form using c#

I have a form which has only tab control in it. I want to fix the location of the form on windows desktop according to the screen size of the users pc.
The form looks like windows task bar and it should be docked on top of windows desktop.
For this i set dock = top property in my form. But still it is not perfectly on top.
How to over come these melodramatically.
You can use the
Form.DesktopLocation Property
you can use the SHAppBarMessage API (C# definition) to register your form as an application bar. This would properly change the desktop workspace size to ensure other programs don't obscure your app. This approach though requires a bit more work to implement it properly.
If you just want to position yourself at the top, you can also use the Form.DesktopLocation property (as #phoenix also mentioned). You will also have to calculate your size based on the primary monitor size. And if you don't want to be at the primary monitor you will have to do some additional calculations. For these, you will need to use the proper Multiple Display Monitor functions.

Categories

Resources