I'm currently working on a project consisting of one program which tracks faces (which we got from https://github.com/Microsoft/Windows-universal-samples/tree/master/Samples/BasicFaceTracking), which is a Windows Universal App and our program, which is supposed to get the number of faces recognized and reacting appropriately.
I thought about copying the number of faces detected by the facetracking program to the clipboard and just reading it from the program.
The problem I have (which might actually be really simple) is that I can't seem to get to the Clipboard Class from within the UWP app.
Using OpenClipboard(NULL) or similar but I always get the error that the IDentifier is not found, no mater which header I include or not...
Can anyone give me a clue what to do? Or maybe a better alternative to transfer that one tiny int from one program to the other?
Thanks in advance.
janine
For UWP applications you should use Clipboard class.
OpenClipboard is an old Win32 API that is only available to desktop applications as mentioned at corresponding MSDN page:
Minimum supported client Windows 2000 Professional [desktop apps only]
Related
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
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.
I'm currently working on a cross-platform application (Win/OSX/iOS) which has a C++ (with Boost) back end. On iOS and OSX I'm using the Cocoa Net Service Browser Delegate functions to discover an embedded device via mDNS, then pass the information to the back end to create the objects it needs to communicate with it.
I wanted to take a similar approach with my Windows MFC front end and I found this article which seemed to do exactly what I want. However, it seems that using the Bonjour SDK has some really nasty side effects - forcing you to static link to MFC and in my case the only way I can get it to link properly is to not use debug DLLs at all, which is not ideal.
So, the Bonjour SDK isn't really any good for me because it imposes too many restrictions on my project. With Cocoa I'm actually using very little of the functionality - just didFindService and netServiceDidResolveAddress really. All I want to do is find the devices of a given type and get their IP addresses.
Can anyone suggest another way around this that will work with an MFC front end on Windows?
From what I have been able to gather from researching this topic just goto http://www.opensource.apple.com/source/mDNSResponder/mDNSResponder-333.10/ and grab the source. There is a VC project file which will let you build the dll how you want.
I am just wondering is there a way to get
the value of a textfield from another
application?
Windows OS
For example in window a textbox2 has a value of 1.
How would i get the value of textbox2 from another application then?
Read up on IPC. You should be able to find a solution on that webpage that suits your needs.
In general, if you want to send information between to applications there are a number of ways to do it. Depends entirely on you circumstances. Why don't you try a search here on SO? There are many related questions:
Passing information between two seperate programs
Elaborate your question or search for yourself.
You can use Windows APIs to get the handle of the target window and get its text. Look for
FindWindowEx or EnumWindows Win32 APIs for this purpose.
Remember that this solution only works for Windows you can not port it to Linux!
If you are looking for a generalized solution that will work between two applications across different platforms and machines (i.e. Window 1 is on a Windows PC, Window 2 is on a Linux PC), check out libQxt and it's IPC classes. Specifically, you might want to look at QxtRPCPeer.
I maintain a large C++ application using Win32 and i want to use some of the new controls introduced in Vista/Windows 7 (New ballon help, command links, status bar notofications.
I have downloaded the Windows User Experience Interaction Guidelines, but i dont find a corresponding API Reference. I know that some of these controls will be not available from core Win32 - so i am looking as well for some source about which controls need which API (WPF or whatever).
Any Links?
The Windows 7 SDK site has a number of downloads and guidance pages which should help point you in the right direction: http://msdn.microsoft.com/en-us/windows/bb980924.aspx
The taskbar/notification API is further documented here: http://msdn.microsoft.com/en-us/library/dd378460(VS.85).aspx
Following Wolfs link and browsing for quite a while, i came up with the following entry point (on microsoft.com), that looks quite valuable to me:
Windows User Interface
and more specifically:
Windows Controls
As far as i can see there is nothing that can NOT be done using core Win32.