How to save current windows state using Delphi and JEDI Docking? - windows

I'm using Delphi 6 and JEDI Docking visual components. I realise drag and drop between windows of my propgramm. I need to save current state of windows. For example, in first run I have separate one server window and two client windows, then I remove client windows into server window using DragandDrop. Then I close my programm and in second run I expect to see last state of windows (two client windows inside server window). How to realize this?

I have found solution. There are two methods for saving and loading windows state in JvDockControlForm module.
SaveDockTreeToFile('MyFile');
LoadDockTreeFromFile('MyFile');
Also there are another ways to save state by components in JvPersistence tab.
Anyway you need to put JvDockServer component from Jv Docking tab to your main form to use these methods above.

Related

GUI adapter for old DOS application

I have an old DOS application which accepts some files as input, does some calculations and saves results into file system. This app uses terminal as sort of GUI, where you can choose input files, types of calculations to perform and choose where to save the result. I don't know the logics behind calculations and am not able to reuse them in a new project.
The problem is that the users of this app want a modern looking GUI which will be easier to work with.
That is why, I have an idea to create an adapter which will translate button clicks into commands in DOS and grab text output to show in modern GUI.
Is it possible and where should I start from?
It is possible. How to start from depends on your programming Tools. If you use a RAD tool like Delphi or Lazarus or Visual Besic or ... then make your GUI design first and define Events after. For a Button click it is ButtonXClick(); In the RAD tool you will find a object inspector with properties and ther values and Events and their values. Go to Events page there, look for onClick-event. Double click there in the value line and you will get an empty Event handler, wehre you can write your Code for your application.
If you dont have or use such RAD tool, take a GUI Framework for DOS. Create your frontend and write your Code which is to call in Dependance of your button clicks.

Determining if currently renaming a file in Windows Explorer

I am trying to check a Windows Explorer view to see if a file name is currently being renamed / edited when typing.
I have a system hook installed that monitors the keyboard for specific keystrokes and fires certain events. This is done in this manner:
If the keyboard hook sees the key pressed it fires a message to another thread and continue processing other system hooks.
Other thread receives the message and checks to see if an Explorer window is active and gets the interface to the IFolderView2.
Call IFolderView2::GetFocusedItem() to get the focused item in the folder view.
Check if the focused item is being renamed / is in edit mode (SVSI_EDIT) using IFolderView2:: GetSelectionState() - this is the part that fails
If not in rename mode perform an action on that file.
I've tried everything on Windows 7 but the SVSI_EDIT flag (0x00000002 specifically) is never returned. It's always (SVSI_FOCUSED | SVSI_SELECT) regardless of if the file is being renamed. Setting the SVSI_EDIT flag with works with IFolderView::SelectItem with the flag puts it into rename mode but I want to determine if it's in this mode already.
This has only been tested on Windows 7 x64 so far.
Does anyone know a way to determine if Explorer / the IFolderView etc. is currently in the rename file state? Any sneaky method will do if it's not possible through these interfaces.
If one file in in renaming mode, Windows will create a EDIT control at the position of the item. So things got straight:
Find the currently-focused control.
Get the CLASS of the control.
Check whether it's CLASS is an EDIT.
On CodeProject there is a great example about how to find the focused control. To get the CLASS name of that control, use GetClassName API.

How to connect multiple windows in gtk+?

I have created a window in gtk+ .in this window i am displaying some text and have button"next" through which i want to move to next window and my previous window should disappear.my new window should display something say,text.
Can someone tell me how to implement this?
I am new to gtk+.
It seems you want to use GtkAssistant, which is a widget precisely for the kind of interaction you are looking for. Run gtk-demo in your system to check the example with the code. It is likely you have it installed.
Also, you can check the code online in Gtk+ repository. (Check the version you want to view, either for GTK+2 or GTK+3).

Tool for capturing screenshots in TFS2010 Web Access

I need a tool to capture and attach screenshots in TFS team web access. Instead of having some thrid party tool that captures and saves images on disk and then you have to attach that image to a bug like bugshooting. I want something integrated within TFS.
In VS11 it is possible to copy and paste your screen shots in the description field of the work item. You can check out the VS11 Beta version yourself.
There's nothing integrated in VS, but there are a couple of easy options:
use the standard Windows screenshot function. Alt-PrtScrn will capture the current window, and then you can paste into your work item's Attachments pane. It'll create a generic filename and attach as a PNG.
if you're using Win7, try the "Snipping tool" (just press Start and type "snip" to find it). That will capture a specified area and can then copy it to the clipboard or save to a file. If you copy & paste you still have the problem of generic filenames, though, so personally I still tend to save it myself.
As #Hofman said, you can do it with VS 11 beta, so you can use MS Paint or even SnagIt, for how to do it just see the following link:
http://mohamedradwan.wordpress.com/2012/02/29/new-enhancement-in-mtm-11-preview/
You may want to check the Capture Custom Control - you can use it to embed a "Capture" button in your work items. It automatically attaches the screenshot to your work item.
Check it out at http://witcustomcontrols.codeplex.com/wikipage?title=Screenshot%20controls&ProjectName=witcustomcontrols
there are a very powerful tool which comes with Windows Server 2008 (Actually I'm not sure if it comes with windows 8 or 7)
never-mine.., the tool called "Record Steps To Reproduce the Problems" , this tool built for Taking screenshots of doing any thing in your machine step by step... WOW
You just need to open the start panel and then write "record steps to reproduce a problem". starting record, and make you job that you want, then when you finish stop recording and save the zip file in your machine.
the zip file will expose a word document contains every single click that you make and every page you've open with some description.

Active windows in Windows and QWidget::activateWindow()

The Qt documentation for QWidget::activateWindow() states:
On Windows, if you are calling this
when the application is not currently
the active one then it will not make
it the active window. It will change
the color of the taskbar entry to
indicate that the window has changed
in some way. This is because Microsoft
does not allow an application to
interrupt what the user is currently
doing in another application.
However, Skype appears to defy this rule. If Skype is running but is not the active application, I can launch it from the start menu and it brings the existing instance to the foreground, activates it and grabs input focus.
And how can I do this?
(NOTE: This is specific to how QtSingleApplication works)
The solution is stupidly simple for my issue. Simply call AllowSetForegroundWindow(ASF_ANY); at the beginning of the application, and the original process will thus be allowed to bring itself to the foreground by use of SetForegroundWindow(). No strange hacks, just one line of code to add and no need to modify QtSingleApplication either.
I don't think you can do it reliably with the Qt API alone.
There are multiple solutions for windows. E.g. here, and here, and here.
The method I've used before is to declare a shared memory section, and write the application's window handle there. Later, when a second instance of your program is started, you can find the window handle of the first and activate it.
I don't think you have the issue of windows preventing you from doing this in this case, because your second instance is the active application, so it is allowed to 'pass focus' to other windows.
Use Single Application in Qt Solutions
For some applications it is useful or
even critical that they are started
only once by any user. Future attempts
to start the application should
activate any already running instance,
and possibly perform requested
actions, e.g. loading a file, in that
instance.
you can set the setWindowOpacity from 0 to 1 .the only thing is you may open it all the time

Resources