Can I detect if a (node-webkit) window is visible? - node-webkit

I would like the user to be able to click on the system tray icon to hide a window if it is visible, or show it if it isn't. However I can't see way to detect the show/hide state of the window.
I looked here but couldn't see anything that would give me what I need. The only way seems to be to keep track of if my last call was to show() or to hide(). Is there a better way?

I've needed this myself just recently, but as far as I know the best (only?) way is to set a boolean (e.g. var showing = true;) and then on every change (including the minimize and restore events) set the boolean to the correct value. Then you could simply make an if statement when clicking on the tray icon to see if the window is showing, and if it is hide the window, otherwise show it.
Hope I helped you a bit, I'm still looking for a better way myself but this is all I have found so far.

Related

Disabling Mouse Click From Changing Selected Index in ListBox

Background:
In my program, I have a list of commands that I am sending to a robot. Each command is numbered, and I display them in a list box. When my program finishes running each command, I want it to highlight the next line in the list box. Changing the SelectedIndex seems to give me what I want. However, I do not want the User to be able to change the SelectedIndex through mouse click.
What I have tried so far:
Disabling the list box doesn't work because it disables scrolling
WPF: Disable ListBox, but enable scrolling The solution here seems kind of a bit of a hack, and does not quite give me what I am looking for.
ListView - select index only programmatically Intended for C#, not very familiar with C#, so I'm not exactly sure if this solution will work if I try translating it over to vb.net. If this solution is indeed correct, could I get some guidance on how to translate this to vb.net?
I am kind of stuck at this point, it kind of seems like I should be looking for a better solution to this problem. What do you guys recommend? should I continue trying to look for a way to disable the user from changing selected index with mouse click or should I go a completely different route?

Prevent window from being captured

I'm solving this problem so long an i can't find solution.
I would like to capture a screen but i want to exclude a specific window.
Like capture whole screen but remove an window from it.
Or what i have to set to notepad like styles or something to being captured ?
Thanks
Regarding screen capture, you could hide window/capture/show window using windows api calls. Second question I did not understand.

Make Splash Screen optional in VB.Net

I may not be explaining myself the best with the question, I'm usually bad at that. But I'll try my best.
This to me seems like something that would be fairly simple, I'm builing a program in Visual Basic and it has a Splash Screen. While I like the clean splash screen, some users might not and I want to give them a simple way to disable it using a defined setting in the program.
This setting when false would disable the splash screen, when true the splash screen would show up (default).
The easiest way to do this is either on the splash screen itself, on the bottom left or right, put a checkbox that says "Don't show again" and if they check it, save the setting and next time you load the application check that and decide accordingly. Or alternatively, you can put it under the settings/options of the application too. Some do it in both areas to ensure that if the user ever wants it back, they can get it without manually editing the setting for it. Any further suggestions or examples, let me know and I can whip something up for you but this should be pretty self explanatory.

Check if software keyboard is open in Windows Phone 8?

I want to check if the software keyboard is open in Windows Phone 8. I have found some sparse information that this is possible using CoreWindow.IsKeyboardInputEnabled, but I can't find any way to implement this. I have found sample code only for C++, which I don't understand at all.
I use VB, however I can read C# enough to figure it out if I can get a C# example.
Whatever I do I always get a null/nothing value. The following code compiles and runs, but c is 'nothing' when the app crashes at the if c.IsKeyboarInputEnabled... line.
Dim c as CoreWindow
c = CoreWindow.GetForCurrentThread
if c.IsKeyboardInputEnabled then...
I know I need to give 'c' a value, but can't figure out how. I've also tried:
Dim c as CoreWindow = New CoreWindow
which the editor flags as an error and thus won't compile.
If it's relevant, what I am trying to do is ensure my navigation is consistent. Currently, a tap on a particular screen element should close that element. However, if the keyboard is open, I want that tap to simply close the keyboard and leave the tapped item open. I believe this is the more intuitive and consistent approach for the user.
I think the only way to achieve this functionality is to know if the keyboard is open before determining what to do with any open panels.
e.g.
[when screen tapped and a popup is expanded]
If [keyboard visible] then [close keyboard] else [close tapped item]
I don't think there is any official API to detect the opening and closing of the SIP but one workaround might be to check if any of your TextBoxes have focus.
You can do this by overriding GetFocus and LostFocus for each TextBox.
To close keyboard, just set the focus to the ContentPanel(or any other grid).
Let me know if this works.

How to fix a non responding ext.list?

I've got a problem with an Ext.List:
You press a button on the main menu and are shown the list. Everything on it works fine and it let's you choose, where to go deeper inside the app. No problems so far.
But if you then go back to the main menu by pressing a "back"-button and reenter the page, that shows this Ext.List, it doesn't work anymore: you can't select an entry of the list.
The "back"-button removes the list, if you return to the main menu this way:
setTimeout(function(){page.removeAll();},100);
What's my mistake? Do you know a better method than "page.removeAll()" that really kills this Ext.List to let it then be completely recreated when I choose to see it in my main menu?
Thanks in advance, you guys have the best tips and tricks.
It's hard to tell without seeing your code but I suspect that there is a javascript error somewhere in the program flow that you described. If you display the javascript console in either Chrome or Firefox it should show the error.
Depending upon how the function that creates the list is defined it would normally recreate the list upon page/function entry and there should be no need to 'kill' the list explicitly.