crop screen maximized resolution - actionscript-3

i would like to create some Flex Desktop Application that will be always in front of other applications (appWindow.alwaysInFront = true). It should looks like tiny bar at the top of the screen (eg. width = screenWidth, height = 50px). I know how to do that. But I have problem with other applications - when i maximize them, they are under my application. Is there any way how to say to the system, that maximized resolution for other apps is other than default?
Thanks for your answer.

You cannot do this with flash code, because you're interfering with external applications. At best, you could write some native code in another language and use AIR to execute that code but I can't really see that working out well, or at least being anything less than a massive undertaking.
If you do want to attempt this however, you can find some info about executing native code from AIR here: How can i on button press execute a command in the command prompt and get back the output in ActionScript?

Related

Make JVM dialog a child window of native top-level window

I have a legacy, X/Motif, C++ application for which new windows have been added using Java/JNI.
New Java windows have been either top level windows or dialogs with no parent.
Is there any reasonable way to get a child window created by the JVM, such as a JDialog, to have as its parent a window created on the native side using X/Motif, and if yes then how? This would still be useful even if Java AWT/Swing is not aware of the parenting structure and the window manager just kept the dialog on top of the top-level window (of course, having all the normal control over windows in Java would be preferable, just not strictly necessary for all uses of my question).
I am thinking the answer might be "No, not in any reasonable way. You would have to do epic surgery on both your native side and within the JVM." If that is the answer, then so be it. But I am hoping someone has an answer along the lines of "If you make this X call or that window manager call, you can get the window manager to supply certain dialog properties with the argument top-level window as the parent."
Essentially, I am looking to increase the integration between the C++ and Java user interfaces as much as possible. Right now, they are run as one application by using JNI, but the GUI windows/components are essentially separate, despite sharing data.
One benefit of this, already mentioned, is having dialogs not show up behind what the user perceives as the top level window.
Another thing I have considered, though I probably will not do (tell me how crazy you think it is), is to make it appear as though Java components are in the C++ window by getting the screen coordinates of a component on the C++ side, displaying a borderless window on the Java side at that screen location, so it looks like it's part of the C++ application. I can think of so many negative side effects of this, though, that I would not do it unless there was a simple way to negate them (focus issues, a window displaying between this dummy window and the real top level window, and other things would affect user experience). Even avoiding this, though, there are still benefits to an affirmative answer to my question.
If you're using the XToolkit (Java 1.7+), you can proceed as follows:
Get the numeric id of the native peer of a java.awt.Window instance (see this answer).
Find the corresponding X11 Window struct by its id by iterating the clients of the X server (see the sources of xwininfo and xlsclients utilities, also Select_Window_Args(int*, char**)).
Use XReparentWindow().

Pop-up message when site it accessed on mobile device

Is there a way to alert a user if he accesses my webpage on his mobile device ?
The reason for this is because this particular webpage is not coded in a way to be looked at on a mobile device (at least not yet)
So, if any would access the webpage on his mobile a pop-up will appear saying something like: "This webpage is currently not supported by mobile devices".
Would this be hard to do ?
Yes it is possible, you need mobile detection script, have a look at following project on github. I have used it myself for similar requirements. This solution is for PHP (you haven't mention which technologies you been using).
https://github.com/serbanghita/Mobile-Detect
You can easily do this with Javascript as well, just google for Javascript Device Detection and you'll find enough. Another possibility is using CSS Media Queries; create a pop up, set it to display: none, and in your query make it visible again.

How to programmatically know if tablet is orizontal or vertical in windows 8 app

I'm developing a win8 / winrt xaml app. In my app I need to know if the orientation of the tablet is vertical or horizzontal..
Where can I find this information? I tried to use ActualWidth and ActualHeight properties but without any success.
I try to take a look at:
Frame
Application
Window
But I can't find what I'm looking for!
Any suggestion?
static property Windows.UI.ViewManagement.ApplicationView.Value will return the following values.
FullScreenLandscape
Filled
Snapped
FullScreenPortrait
Actually, since the ApplicationView.Value is deprecated in Windows 8.1, I'd recommend not using that for your app now. DisplayProperties provides some data here in their API. Also, depending on your scenario you may not want to think only about the device orientation but the Window size itself that your app is in. In Win8.1 since you can have 50/50 split, your app may be in a "taller than wider" viewport which effectively is a portrait view as well.
If your app relies on knowing portrait to make assumptions about edges of the physical device, then that is different, but consider looking at Window size and determining if "taller than wider" is a good indication for your app and use that to trigger any changes.

Improve touchscreen handling on Chrome

I am working on a web app that will be run off a local server on Windows 8 on Chrome. Unfortunately, Chrome doesn't seem to handle touch events very well. For example, often instead of clicking on a button, it will select it instead. Is there any way I can make it behave more like native touchscreen apps do?
I can't make it a metro app because I need to talk to a Python service.
I've done some testing in Chrome with a touch screen and don't seem to run into this issue (of course not doubting you are though!). If you have a site I'd be more than happy to check it out.
One option is to try scaling the content larger, I'm wondering if your touch surface is very sensitive to tiny movements upon touch and treating it as a touch/scroll ie select. Try a simple test in the browser to start by increasing the size before trying any css scaling transforms (which I'm not sure how in this how well that approach would even work)
What type of hardware is it being tested on?
Can you elaborate a bit more on the python service? What part of the service makes it so you can't interact with it? Is it just an http service object or something else?

what is full screen mode

I know you can fake full screen by expanding a window and eliminating the title bar , status bar , and other stuff, I'm not interested in this, I want to know about "real" full screen mode (I don't know how to call it else) , like in games.
what exactly is full screen mode?
what win-api should I use to achieve this?
can this be used to play movies in full screen ? I know windows media player uses a fake full screen because I can "cut" thru it and see the desktop (using regions win-api).
can I "cut" thru "real" full screen like I thru a window (using regions win-api) ore is this directly writing to video memory and there is nothing "under" it?
Thanks!
If you want to make games on Windows in full-screen, the best option is XNA. This uses DirectX underneath, but hides a lot of the implementation details and plumbing to make it easy for the developer to start working on his game.
XNA is freely downloadable, and has good documentation.
XNA Game Studio 4.0 can be downloaded here.
...and you might want to support the "fake" fullscreen mode in addition to "real" fullscreen - it's very nice for those of us that run multi-monitor systems.
If you don't want to use DirectX, create window and call ChangeDisplaySettings with CDS_FULLSCREEN flag. OpenGL applications use this way to go fullscreen.
As far as a user is concerned, full screen is just when a window takes up the entire screen such that they no longer see any window borders or other desktop stuff.
As you know, not all full screens are created equal.
'proper' full screen is where the program takes control of the screen. When a game uses this mode, it can change the resolution of you screen. If you have ever played an old game and existed to see your icons all messed up, this is; for the duration of playing the game, your desktop was at a lower resolution.
with 'borderless full screen' the program window is striped of any borders, the title bar and frame etc., and is just a rectangle of pure rendering. If you then set this rendering context to be the same size as your desktop, you get the effect of full screen.
Doing border-less is usually the more user friendly way these days, as it is easier to 'tab out' as the other programs are still graphically around. 'proper' full screen gives you full control of the hardware, so in theory you have more power for your program, but it means you have to wait for things to reinitialise when you tab out.
what you do with your rendering context is up to you, so yes, you can use it play videos. It would not matter if you are in 'proper' full screen or not, the rendering code would be the same.
As for cutting through proper full screen windows, I am not sure, but I think there would be nothing else to see, there is only your program.
as for what win-api, there is only one windows api, but I think you mean, what windowing library; as this is getting to be a long answer already, I shall just say it depends a lot on what you want from it.
Please feel free to leave comments if you need me to clarify or expand on any points.