How to create a new desktop? C++ - c++

How would I create a new desktop in C++?
I know the CreateDesktop() API but it does not load memus or explorer.exe for the matter.
If not to much trouble would love an example to make a desktop with menus.

Take a look at Window Stations, this may be what your looking for.
However, this also is different from a session (UAC).
The source code for how to programtically do this is included as part of this project (JobObjectWrapper).
Hey actually, I'm wrong, JobObjectWrapper only secure's that interface, the other answerer here was correct, another question had the same answer, virtuawin is open soure too.

Take a look at virtuawin (Open source)
(source: sourceforge.net)
VirtuaWin is a virtual desktop manager
for the Windows operating system
(Win9x/ME/NT/Win2K/XP/Win2003/Vista).
A virtual desktop manager lets you
organize applications over several
virtual desktops (also called
'workspaces'). Virtual desktops are
very common in Unix/Linux, and once
you get accustomed to using them, they
become an essential part of a
productive workflow.

Related

Calling methods from DSDT in Windows (ACPI)

I have recently discovered how wonderful modifying the DSDT table in Windows is. I already remapped some Fn keys to do some other things, but those things were located in the actual DSDT (like turn LEDs off, turn fan on/off).
Now, I would like to step up the game and control the things from the OS. Like, define some custom methods in the DSDT, and then using software from Windows, call those things. That would open the door to an entire new level of posibilities.
So, what are the steps to do to acomplish this under Windows, using C++ for example? And, is there an app that can call generic methods from the DSDT already? Because that would be so awesome.
Thanks!

Replicating dexpot functionality

I am developing a virtual desktop application and have been an avid dexpot user for some time. I've been reading the Win32 documentation, specifically the CreateDesktop and SwitchDesktop functions. From what I understand, only one desktop can be viewed at a time, yet dexpot manages to show a real time view of all active desktops in its full screen preview mode. Does anyone know a way of possibly implementing this? My first idea is to rapidly switch desktops, but this would use up far too much processing power.
The most difficult part about what you want to do is application switching. You cannot move an application instance from one Desktop object to another. I would base my implementation off of remote desktop applications. There's plenty of open source clients you can look into for some ideas. I would look into the desktop duplication api as well. One idea that comes to mind is making one large desktop, locking the mouse and view to one particular region, and using desktop duplication to show all the split up regions as separate desktops. That's assuming desktop duplication works as I think it does. I'm not sure as I don't use windows.

How to shell to another app and have it appear in a Borland VCL form (c++)

I'm actually in charge of a FIP networking c++ application, working for the first time with Embarcadero C++ Builder XE5.
The app is nearly finished, but I can't find how to implement the last feature...
I wanted to open an external Windows HyperTerminal in order to see what happen on a given COM port, for this purpose I'm using ShellExecute() to launch it from my application but it's a bit ugly since there is 2 different windows.
I was wondering if it was possible to integrate this newly opened HyperTerminal into an existing form (Panel for instance). I couldn't find nothing related excepted this =>
Delphi style, but i don't understand a byte of #mghie answer since it's delphi.
If anyone have a clue I'm really interested, even the most basic clue!
For almost all of my projects where COM port interaction is needed I use AsyncPro. The project is very well documented with a ~1000 page reference manual.
Reference Manual
Developer's Guide
For this case, the package provides a VCL terminal that simply drops onto a form. It's quite flexible with a lot of options to configure its behaviour.
I wanted something similar in past but with no success.
1.The only thing I was able to do is the exact opposite.
dock my VCL window inside another (not VCL app) but that solved my problems
If you terminal is console window then I doubt even this can be done.
anyway find handle of desired window
find handle to a dockable subcomponent
set the parent of your subwindow to it / or use manual dock
2.maybe you can do some funny stuff
like hide terminal somewhere
and continuoslly copy its graphics to your window
newer done that hide thing
but copy the contents is doable (although on windows a little unstable sometimes)
done it once to feed my App with IR-camera feed from different App
while 'focus' stays on hidden terminal it should work
also you can try to post messages to it somehow if you need the focus ...
Sorry for a vague answer but at least you see some approaches of mine
maybe someone has a better way to do this

What is the best way to use IE webBrowser control without requiring MS/Visual studio run times?

What I am trying to do is create an exe (not .hta) that can be programmed to open a local html file and have it work just like it was in IE (handle styles, scripts and etc), only without actually loading IE. The exe must also be run without installation requirements, and no dependencies (other than recent IE obviously), needed on the host machine.
The purpose is to create an interactive e-book type document, that can be edited without recompile, and also be run from cd/usb on the fly.
I can't just open IE, because it will look unprofessional with the big E, the toolbar and tabs all at the top. know what I mean?
I have experience with HTA, and this was my first suggestion, however I would like to take advantage of the auto run from cd, and also to make the form border a little different, less plain.
I also have experience in VB. Which I could accomplish the look and functionality, however those vbruntimes are not installed on some machines :(
Is it possible to use the IE webBrowser control from c++ or even assembly?
Thanks in advance!
It appears, Lucian Wischik's Webform can be a good starting point to meet your minimalistic project requirements. Alternatively, you could host WebBrowser ActiveX control directly using ATL AxHost. ATL can be linked statically and adds a very low size overhead to the final EXE. Here is a sample project of WebBrowser host app which only depends on ATL.
Yes, you can use the browser component from C++.
C++ however will again need runtime libraries, similar to VB. The good news is, you can statically link those runtime libraries with the executable.
You will not be able to statically link the browser component with your executable, but that wont be an issue unless you try to support ancient Windows versions (pre NT 4.0). For all more recent Windows versions, you can pretty much assume that this component is available.
For more details on that component, you may refer to the CHtmlView class reference - that is the MFC wrapped version of that WebBrowser activeX component.
Using that component from assembler certainly is possible as well, but unless you are deeeeeeep into system programming on the windows platform, you will fail.

Dim screen on Windows with C++

I've been looking into dimming a screen on a Windows platform from my program. I know that there's a SetMonitorBrightness API that allows this, but the issue for me is that it would be nice to be able to dim the screen on Windows XP as well (which that API does not support) and also dim screens on desktop computers.
So I did some research and found this utility that seems to dim my screen on a Windows XP desktop without a problem. I tried to contact the author to find out how they implemented the dimmer but I did not hear back from them.
So I was curious to hear from developers on this site, how do you think they managed to dim the screen when the SetMonitorBrightness API is not supported?
PS. I am a newbie developer myself trying to write an energy saving program for our small business. It is a nonprofit organization and we don't have funds to hire a Windows developer to do this for us. Most of our computers are Windows XP desktops, so as you can see I can't use SetMonitorBrightness API as it is widely documented on the web.
Thanks in advance.
In the case that you cite, have a look at the screensaver with Dependancy Walker. My guess is that they create a full screen window and use SetLayeredWindowAttributes() to set a semi-opaque setting for the window, thus making the screen appear dimmed. I doubt it would save you much money.
You might want to look into the DDC protocol which allows you to control aspects of some monitors. The MS API that allows you to do this can be found roundabout here: http://msdn.microsoft.com/en-us/library/windows/hardware/ff570290%28v=vs.85%29.aspx and you should look at the I2C functions too.
Alternatively you could look for a ready made library to do the DDC stuff for you, such as http://www.nicomsoft.com/products/i2c/. They too have a dimmer application that is free for personal use and non-free for commercial use. They may even allow you to use it for free if you contact them and explain it's for a non-profit organisation.
If you are trying to do this as an energy saving program why not use a screensaver setting that turns the monitor off after a certain period of idleness? In any case
Forgive me if this information is outdated, but I have done this in the past using SetDeviceGammaRamp. The 'Get' version is available too for state saving and restore. I have seen it used in C# programs through, so it might still be relevant albeit not too common anymore.