GDI Objects or USER Objects? - delphi

I have an application that allows a user to open multiple windows/modules. Each module has it's own popup menu, some of these are create at runtime when a form is created, some design time and I have a lot of them in each module, some are used when I right click a form, some are used in toolbutton.
The problem I have is that I have a lot of windows opened, when I right click to access the popup menu, the generated menu goes haywire, I mean, it's not showing the correct labels. Sometimes it'll show all "Save as.." or any other label I need to display. I guess the easiest way to explain this is by showing you a screenshot of the menu
Is this a GDI/User Objects problem? If so, how do I resolve this? I tried increasing my GDI and Uses object limits as a test but still getting this problem. The problem will be resolve if I close one or two windows; however, I cannot ask my users to limit the number of windows opened in the application. A check with windows task manager shows that my application is using 4,312 User Objects and 5,570 GDI objects with 437 Handles at the time this problem is occuring.

Related

Is it possible to load a dynamic website and trigger a search field inside of it?

I am new to Delphi and I want to know, is it technically possible to perform this task?
Firstly, I want to load a dynamic website, and then search it using an external input field, as in the picture.
When I enter a search parameter in the left side, it should perform a search operation in the loaded website.
Yes, it is technically possible.
On the right side of your application window, you should drop a TWebBrowser (This is actually based on Internet Explorer) or the new TEdgeBrowser.
You can then use those component's methods to make them load the page you want to.

How to disable textbox dropdown suggestions on certain websites?

I am trying to make my job easier by creating simple AHK scrips to auto-fill certain forms online.
Im not really good at explaining, but hopefully someone will understand what Im saying. The problem is that this website has certain textboxes with dropdown auto-suggestions turned on, and it has a delay when selecting those textboxes. I assume when selecting textbox it is pulling data from some database which is causing delay. Now my question is. Is it possible to turn off dropdown menu on websites or even in entire browser if necessary? I really want to my script to tab-in, wright down whats needed, tab-out without delay.
Autocomplete dropdown lists are just JS scripts. So there is no way, I think, to disable them by clicking checkbox in browser settings.
First, try to disable JS completely.
Also, if only few sites are involved, you could try to find out what JS libraries are used and disable them in browser JS console.
Are you planning to do this via keypresses or via COM?
I imagine that via keypresses you could not avoid focusing the elements and triggering the information lookup.
AutoHotkey can interact with webpages on Internet Explorer using COM (Component Object Model).
COM can launch/latch onto an IE instance, detect if the page is loading/has loaded, navigate to a particular url, and set the text of web elements,
quite possibly without triggering the drop-down lists. I haven't tested if COM can disable elements, it's possible.
Also, Acc.ahk may be able to set the text of elements.

Facilitating navigation through eclipse using Rascal visualization and callbacks

I am making a visualization of a code base using rascal, and I am currently trying to make it interactive by letting the user click on rendered Figures.
What I want to do is to let the user click on objects that represent parts of the analyzed code, upon which the user is taken to the appropriate part of the analyzed code.
I have noticed that the loc type, when evaluated in the normal console, yields a hyperlink to the location it describes. When the loc value is printed from a callback, however, it is not.
2 possible solutions:
Make the loc output clickable again.
Control the eclipse GUI directly, showing the user the code immediately.
Is any of the above possible? If not, are there alternatives?
Accepted solutions start with the user clicking on rendered Figures and end with the user seeing the code, without the user having to manually navigate to the respective Java files (user friendly!).
I found the answer to my own question, quickly enough. Apparently, I only had to read the documentation a little more thorough.
The function edit(loc location) in the module util::Editors will make eclipse open a new tab with the file pointed at by the location. In case the location points at a specific AstNode, it will even select the source code of the node.

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.

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.

Resources