ALT+TAB and scroll MDI Application open forms - delphi

Goodevening everyone,
I've a question about a functionality i want to add on my Delphi MDI Application.
Often my users keep more than one forms open at the same time and these forms are almost always maximized. I need something like a the Alt+Tab that with a keyboard shortcut let the user scroll the already-open forms with a simple preview that helps to choose the right form.
The best option that i can imagine, is something that let me include every open forms into the "windows alt+tab" user interface and manage all the necessary windows messages on the main form of my MDI Application to bring to front the right forms.
Recently Firefox add something like that and i need to include the same thing my Application.
I've searched this thing on the web but i haven't found anything.
Any idea of how to do it?
Thanks,
Attilio

Related

Control Main Menu in another application

I'm creating a component that will make access to other applications and fill informations to them. Usually call up forms of other applications and will automate the filling informations in fields. The class of filling is ready. I did all access through the windows Handles. It's working perfectly.
What do I need to do now is access the main menu of this other application and browse in menu items. With this, Its possible access any form in application.
I did several tests but without success. Could anyone give a hint?
Thankful now.

SharePoint Item Edit Form (editform.aspx) keeps closing webparts - MOSS 2007

We have a custom list within MOSS 2007 which sporadically closes the edit forms web part, despite the fact that the web parts property 'allow close' is unticked. The only way to make the form work again is to edit the page in SharePoint Designer and untick the option of 'web part closed', this then allows the form to function but at a seemingly random interval it will close itself again.
There is quite a large user base accessing the site/list at anyone time, also note this has happened once on another list on another site collection.
Has anyone else experienced this issue before or can offer any advice?

How to create a Login/Password dialog using Delphi 2010

I want to create a Login/Password dialog which will prompt when someone click a specific button in my Delphi project. If the criteria entered are correct the user can proceed and open the form, the button opens. If not the button must not open the form.
For example my MainForm starts with 2 buttons. Both Buttons, when clicked, open a different form. I want to implement the Login/Password function to one of these buttons.
I use Delphi 2010.
You can make a login-function to which you also pass a TForm variable that has to be opened when login is correct. Or you can have the forms check if the user is logged in when they are opened.
There are many different approaches to this problem, you will have to decide for yourself which method is the best for your situation. Did you already try something that we can comment on?
The operating system provides such services, namely CredUIPromptForCredentials for XP, and CredUIPromptForWindowsCredentials for Vista and up. The JEDI libraries expose this through the JwaWinCred.pas unit.
These don't look like being the easiest API functions to call, but they do have the obvious benefit of being system native and so should give a good look and feel.

Is it possible to avoid page reload after accept of an activex object

I have a multi-page flow of webpages (jsp).
After the user have done a lot of work i need to use an activex component, if not pressent on the machine the user is presented yellow bar at the top to accept the component, after accepting the page is reloaded and the user must repeat all the work, do to the fact that the page is reloaed - can this be avoided?
There is no way to keep from reloading the page after dealing with the yellow bar, but there are ways you can detect if the activex control is installed or not, and then install it with a .exe or .msi (requires the user to download it) which is then available immediately after installation.
It's not an easy thing to get right, but there are some posts about it here:
http://colonelpanic.net/2009/01/detecting-the-version-of-an-activex-ie-browser-plugin/

Delphi, possible to make a form modal to specific parent form only?

I've got an application where there's a main background form, from there user can only non-modal forms that maintains different part of the system. The non-modal forms overrides the CreateParams method so each one displays a button in the start task bar:
procedure TfmMaterialsPlanning.CreateParams(var Params: TCreateParams);
begin
inherited;
//create a new window on the task bar when this form is created
Params.ExStyle := Params.ExStyle or WS_EX_APPWINDOW;
end;
In effect, a user can open a non-modal form that maintains 'Apples', another non-modal form that maintains 'Oranges', and use the start menu bar to easily switch between the two.
However, if they open a modal form from the 'Apples' form, e.g. to set options, preferences, etc, then they can't use the 'Oranges' forms until they close the modal form.
Is it possible to make a modal form modal to the parent form only? So if they open the Apple's options form, they can't use the Apples maintenance form, but can still use the Oranges maintenance form?
If you have a look at the source code of TCustomForm.ShowModal() you will see that the VCL does not use the Windows API call for showing modal dialogs, but that it does instead disable all other forms in the application while the modal form is shown. You can of course try the very same, just Show() the form-modal dialog, then disable the parent, then re-enable it after the form-modal dialog has been closed. There needs to be a central place where you keep track of form-modal dialogs, the forms that need to be re-enabled and so on. You should however test thoroughly whether the code does indeed what you want it to do, even when switching back and forth between applications, when minimizing the application and so on.
Having said that - I don't think that this a good idea at all. It breaks all assumptions a Windows user makes about the behaviour of applications. Unlike in Mac OS X there is no distinction in Windows between application-modal and form-modal dialogs, and you should stick to the behaviour consistent with the platform your are programming against.
There is most probably a better way to structure your UI. Have a look at the relevant page for dialog boxes in the "Windows User Experience Interaction Guidelines". Modal dialogs are better avoided as much as possible, the linked guidelines show better alternatives for many use cases. If you limit the use of modal dialogs, maybe you do no longer need the form-modal dialogs.
This post has a nice trick to acomplish your needs: http://blogs.teamb.com/deepakshenoy/2006/08/21/26864
The summary is to reenable the nonmodal window you want when a modal window disabled it.
Couldn't you achieve the same effect by preventing the "Apples" form from accepting focus while its child form is open?
Just as an aside (although it would be an awful lot of work), another approach to this problem is the way Google's chrome went, where each "tab" is a separate process but appear to the user as a single integrated application.
Even though this approach would achieve what you wanted, I would have to agree with the comment above that this would break a user assumptions and expectations about modal behaviour.
This is possible, if you create each non-modal form in its own thread. Each modal form will then block the thread it belongs to.
Edit: This should be possible, even though the vcl is not thread-safe. Please take a look at Alexeys explanation of how this can be done:
So if you have a set of forms that should live in a separate thread then place them into one dll, compile it without packages and use! It will work and it will be thread-safe.

Resources