Is it possible to keep the SFX progress bar longer until the main window pop up? - window

I am making a self extract and running installer. It works, but there is a time gap between the exit of the progress bar of the extraction and the appearance of the main window. The process of the executable has already started, it just the GUI hasn't popped up yet.
I guess I can make another loading screen for my program, but since we already have a loading box from 7z I want to make use of it. Is there a way to tell 7z that the finish line is when the window pop up?

Related

Program behaves differently when run from C:\Program Files vs outside of that folder?

Have a strange issue using Win10 x64 Pro. My program main window hides itself, opens another window for an action, then closes that and the main window shows itself again and set as the foreground Window. All that works fine, but when the program is run from C:\Program Files the behavior of Windows is not as expected.
If I click on a window of a different process that is behind the main window, it gets the focus but is still visually behind my programs main window. I can click on another window then things start working as expected. I can also just click back on my main window then the one in the background and works (but only if I first click on the background window then my main window then the background window again). However, if I move the same .exe to say d:\test and run it, the problem doesn't occur (I can click on the background window and it shows over the top of my main window like expected).
I tried disabling norton auto-protect, it didn't make any difference.
What could this be, is there some trick I could use get Windows to give the expected results?
Thanks.

How do I preserve PDcurses output in a Windows Console window after executable completes?

I'm writing an application for Windows 10 to display and update text at specific locations in a Windows console window. The program is launched by a command in the console window. Upon launch, it erases the window's previous contents, then displays its output, updating as it goes, until completion. Upon exit, it should leave the displayed output in place, and a new command prompt should appear below. Launch, display, and subsequent command prompt all occur in the same console window. (Old school, I know, but that's the requirement.) The program is written in C and uses calls to the PDcurses library to control cursor placement and to output display text to the screen. The application is built with GCC/MinGW on a Windows 10 platform.
Everything works until the application exits, but then the display output disappears and the previous window contents (from before the app was launched) reappear. From what I can tell, this seems to be the default behavior for curses, possibly due to the way it handles screen buffering.
I'm looking for ways to override this behavior, but I'm not sure how to approach it. Can I direct PDcurses to write to the standard screen buffer rather than the alternate screen buffer (if that's what's going on)? If so, how? Should I copy the contents of the screen buffer before I call endwin(), then copy those contents back to the screen buffer afterward? Again, how? I'm sure this problem has already been solved, probably many times, but I haven't found any solutions that seem to apply to a C executable running in a Windows console, and I have only limited experience with PDcurses and the Windows API library. Any help would be appreciated.
The official way to do it is to set an environment variable: set PDC_RESTORE_SCREEN=0. You can combine this with set PDC_PRESERVE_SCREEN=Y to prevent PDCurses from clearing the screen at startup.

Closing window rather than withdraw TCL

I am using a graphic user interface builder for Tcl/Tk called "GUI Builder (Komodo Pro)". I have built three different windows that will each be opened after the respective button is clicked. I have managed to get the windows to open and "withdraw", but the process remains open in the background. If the user opens enough windows the program will crash due to the large number of windows.
My question is how can I get the window to fully close, instead of withdraw, thereby save some of the computers memory and process power?
When you click on the window manager close button for a window (which varies a bit in style, but is often a red “X”) Tk ends up receiving a WM_DELETE_WINDOW protocol event (non-X11 platforms are translated to this inside the lower levels of Tk). Tk then responds to this for that window in “the appropriate way”.
By default, windows are destroyed when a WM_DELETE_WINDOW is sent to them; this is the right thing to do in the simple case. You can also explicitly enable this by doing:
wm protocol $toplevel WM_DELETE_WINDOW [list destroy $toplevel]
You wouldn't normally bother with that; the default (which is what happens when you've got an empty handler) has the same effect.
Alternatively, you can make the window withdraw (wm withdraw $toplevel instead of destroy $toplevel) or iconify (wm iconify $toplevel) or even pop up a dialog to check whether the user is really sure about that.
Tk-enabled applications normally exit once they enter the main event loop with all toplevel windows are closed. In the simplest case (only one Tcl interpreter with Tk loaded) this is the same as saying that the application stops once the . window is destroyed. However, I'm not entirely sure if this is true if you run the Tk application in tclsh by doing package require Tk (there's magic in the code to integrate Tcl and Tk). The best way to find out whether things go away right is to test for yourself; it should only take a moment…

Program window not viewable during debug pause

When my program is paused in Visual Studios 2010 during debugging, like from reaching a break point and me doing a manual step through, the program window becomes impossible to view.
It is a GUI window not a console window, which I run simultaneously with my program and am still able to view. The window seems to be open it's just that when I click its icon on the taskbar it doesn't come to the front of all the other windows. When I minimize all the windows in front of it, I see the outline of the window but it is either blacked out or showing the remnants of previously expanded windows.
I've noticed this with using Visual Studio's before (various versions of it), and after trying other IDE's that didn't have this behavior I notice it more. It would be really helpful to view the program's change's as I step through the program. Anyone know how I can do this?
I searched a long while and couldn't find a single reference to this matter.
The reason the window doesn't display is that the window paint message won't be processed if the main thread has been paused. Which other IDEs let you do this? I haven't come across any native code debuggers that do this on Windows.
If you are stepping through code that is run by the main thread, then the main thread can't simultaniously poll the message pump, which is needed for the GUI to work.
If you debug a different thread, the GUI will work while you are debugging.

REALBasic: How to make code run after the window has fully loaded

I am doing a REALBasic project. I want to make code run after the window has loaded automatically.
If I put the code in the Open event handler, the code runs when the window opens, but the window doesn't appear until the code has finished executing.
So I would like to have the Window open and be on the screen, and then the code run automatically without having to click anything.
Is this possible?
Thanks.
Place your code in a Timer with its Mode set to ModeSingle and a short Period (say 10 milliseconds). The Timer will fire once the GUI finishes loading.
Or you can put your code in a thread and start the thread in the Window.Open event. That way if the code takes a while your entire application doesn't 'freeze' on you.
More info on threads in Real Studio at http://docs.realsoftware.com/index.php/Thread
One word of caution though with Threads. Directly updating GUI controls can be a bad thing - especially with Cocoa built applications.

Resources