Advertisement

04.07.2008 at 02:37AM PDT, ID: 23300811
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

Can I embedd an external application within a delphi form?

Tags: Delphi
Hi all,
Bit of a stupid question here but...

I know how to open an external application and that is working fine, but i was wondering if its possible to open the application within the form its self.

The reason for this is that the external application we have can be closed by our call center agents, but we do not want this. Ideally i want to lunch the external application 'within' the delphi form so that i can set the delphi form properties to no minimise/maximise/close.

Hope I have explained that ok.

If anyone has any ideas I would love to hear them.
Many thanks,
Stu
Start your free trial to view this solution
Question Stats
Zone: Programming
Question Asked By: stuartbrereton
Solution Provided By: MerijnB
Participating Experts: 2
Solution Grade: A
Views: 4
Translate:
Loading Advertisement...
04.07.2008 at 02:41AM PDT, ID: 21295379

Rank: Wizard

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
04.07.2008 at 02:43AM PDT, ID: 21295385

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
04.07.2008 at 02:46AM PDT, ID: 21295395

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
04.07.2008 at 02:48AM PDT, ID: 21295401

Rank: Wizard

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
04.07.2008 at 02:55AM PDT, ID: 21295429

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
04.07.2008 at 02:57AM PDT, ID: 21295437

Rank: Wizard

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
04.07.2008 at 03:01AM PDT, ID: 21295451

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
04.07.2008 at 03:05AM PDT, ID: 21295471

Rank: Wizard

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
04.07.2008 at 03:07AM PDT, ID: 21295475

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
04.07.2008 at 03:19AM PDT, ID: 21295505

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
04.07.2008 at 03:34AM PDT, ID: 21295549

Rank: Wizard

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
04.07.2008 at 03:44AM PDT, ID: 21295583

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
04.07.2008 at 04:03AM PDT, ID: 21295650

Rank: Wizard

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
04.07.2008 at 04:25AM PDT, ID: 21295759

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
04.07.2008 at 04:33AM PDT, ID: 21295791

Rank: Wizard

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
04.07.2008 at 04:37AM PDT, ID: 21295818

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
04.07.2008 at 05:00AM PDT, ID: 21295959

Rank: Wizard

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
04.07.2008 at 05:06AM PDT, ID: 21295983

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
04.07.2008 at 05:22AM PDT, ID: 21296079

Rank: Wizard

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
04.07.2008 at 05:37AM PDT, ID: 21296204

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
04.07.2008 at 05:48AM PDT, ID: 21296301

Rank: Wizard

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
04.07.2008 at 05:51AM PDT, ID: 21296324

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
04.07.2008 at 05:59AM PDT, ID: 21296390

Rank: Wizard

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
04.07.2008 at 06:03AM PDT, ID: 21296420

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
04.07.2008 at 06:31AM PDT, ID: 21296649

Rank: Wizard

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
04.07.2008 at 06:45AM PDT, ID: 21296789

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
04.07.2008 at 06:52AM PDT, ID: 21296855

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
Loading Advertisement...
Microsoft
  • Internet Protocols
  • Applications
  • Development
  • OS
  • Hardware
  • Windows Security
Apple
  • Operating Systems
  • Hardware
  • Programming
  • Networking
  • Software
Internet
  • Search Engines
  • File Sharing
  • WebTrends / Stats
  • Spy / Ad Blockers
  • Web Browsers
  • New Net Users
  • Web Development
  • Chat / IM
  • Anti Spam
  • Web Servers
  • Anti-Virus
  • Email Clients
Gamers
  • Tips
  • Online / MMORPG
  • Puzzle
  • Emulators
  • Action / Adventure
  • Role Playing
  • Consoles
  • Game Programming
  • Strategy
  • Sports
  • Misc
  • Computer Games
Digital Living
  • Hardware
  • Automotive
  • New Net Users
  • New Users
  • Software
  • Digital Music
  • Gaming World
  • Home Security
  • Apple
  • Networking Hardware
Virus & Spyware
  • Vulnerabilities
  • IDS
  • Encryption
  • Anti-Virus
  • Operating Systems Security
  • Software Firewalls
  • WebApplications
  • Cell Phones
  • Operating Systems
  • Internet
  • Hardware Firewalls
Hardware
  • Displays / Monitors
  • Handhelds / PDAs
  • Components
  • Peripherals
  • Laptops/Notebooks
  • Servers
  • Misc
  • Apple
  • Embedded Hardware
  • Networking Hardware
  • Storage
  • Desktops
  • New Users
Software
  • System Utilities
  • Industry Specific
  • Network Management
  • Photos / Graphics
  • Page Layout
  • VMware
  • Misc
  • Web Development
  • OS
  • CYGWIN
  • Voice Recognition
  • Virtualization
  • Message Queue
  • Quality Assurance
  • Security
  • Firewalls
  • MultiMedia Applications
  • Development
  • Database
  • Office / Productivity
  • Business Management
  • OS/2 Apps
  • Server Software
  • Internet / Email
ITPro
  • OS
  • Storage
  • Encryption
  • Operating Systems Security
  • Apple Hardware
  • Laptops & Notebooks
  • Servers
  • Networking Hardware
  • Peripherals
  • Devices
  • Displays / Monitors
  • WebTrends / Stats
  • Search Engines
  • Firewalls
  • Web Computing
  • WebApplications
  • IDS
  • Vulnerabilities
  • Email Clients
  • File Sharing
  • Spy / Ad Blockers
  • Web Browsers
  • Web Servers
  • Networking
  • Anti-Virus
  • Consulting
  • Chat / IM
  • Anti Spam
Developer
  • Web Servers
  • Web Browsers
  • Game Programming
  • Dev Tools
  • Industry Specific
  • Office / Productivity
  • Database
  • CYGWIN
  • Web Development
  • Search Engines
  • File Sharing
  • WebTrends / Stats
  • Programming
  • Content Management
  • Application Servers
  • Protocols
Storage
  • Removable Backup Media
  • Storage Technology
  • Servers
  • Grid
  • Remote Access
  • Backup / Restore
  • Misc
  • Hard Drives
OS
  • Miscellaneous
  • Security
  • Development
  • Linux
  • VMware
  • MainFrame OS
  • Unix
  • Apple
  • OS / 2
  • AS / 400
  • BeOS
  • Microsoft
  • VMS / OpenVMS
Database
  • Oracle
  • Miscellaneous
  • MySQL
  • Software
  • Sybase
  • Contact Management
  • PostgreSQL
  • Data Manipulation
  • Clarion
  • InterSystems Cache
  • Siebel
  • MUMPS
  • OLAP
  • SQLBase
  • SAS
  • GIS & GPS
  • 4GL
  • Berkeley DB
  • DB2
  • Informix
  • Interbase / Firebird
  • FoxPro
  • Reporting
  • LDAP
  • Filemaker Pro
  • MS SQL Server
  • dBase
  • MS Access
Security
  • Misc
  • Web Browsers
  • Software Firewalls
  • Operating Systems Security
  • File Sharing
  • Spy / Ad Blockers
  • Vulnerabilities
  • WebApplications
  • IDS
  • Anti-Virus
  • Encryption
  • Anti Spam
  • Email Clients
  • VPN
  • Chat / IM
Programming
  • Editors IDEs
  • Installation
  • Handhelds / PDAs
  • Multimedia Programming
  • System / Kernel
  • Automation
  • Algorithms
  • Game
  • Signal Processing
  • Project Management
  • Open Source
  • Database
  • Misc
  • Languages
  • Processor Platforms
  • Theory
Web Development
  • Scripting
  • Blogs
  • Web Servers
  • Software
  • Search Engines
  • Web Graphics
  • Web Services
  • Images
  • Internet Marketing
  • Images and Photos
  • Components
  • Document Imaging
  • Web Languages/Standards
  • Illustration
  • WebApplications
  • Fonts
  • WebTrends / Stats
  • Authoring
  • Digital Camera Software
  • Miscellaneous
Networking
  • Protocols
  • Apple Networking
  • Network Management
  • Message Queue
  • Application Servers
  • Content Management
  • File Servers
  • Email Servers
  • Misc
  • Java Editors & IDEs
  • Wireless
  • Networking Hardware
  • Backup / Restore
  • System Utilities
  • ISPs & Hosting
  • Web Servers
  • Storage Technology
  • Removable Backup Media
  • Servers
  • Web Computing
  • Broadband
  • Grid
  • OS / 2
  • Novell Netware
  • Unix Networking
  • Windows Networking
  • Security
  • Telecommunications
  • Operating Systems
  • Linux Networking
Other
  • Lounge
  • Business Travel
  • Community Support
  • New Net Users
  • Philosophy / Religion
  • Math / Science
  • Miscellaneous
  • URLs
  • Expert Lounge
  • Politics
  • Puzzles / Riddles
  • Automotive
Community Support
  • Suggestions
  • New to EE
  • New Topics
  • CleanUp
  • Announcements
  • General
  • Feedback
  • Input
  • EE Bugs
 
04.07.2008 at 02:41AM PDT, ID: 21295379

Rank: Wizard

what kind of application is this external application?
 
04.07.2008 at 02:43AM PDT, ID: 21295385
You probably need a hook for this and intercept the close query message
 
04.07.2008 at 02:46AM PDT, ID: 21295395
Its another external EXE.  It displays the number of calls waiting in the call center, and we do not want agents to close this application.

With refrence to 'hooks', could you expand please - i dont belive I have ever come across these before.

thanks
Stu
 
04.07.2008 at 02:48AM PDT, ID: 21295401

Rank: Wizard

is it a normal win32 application, or a console application?

If it's a 'normal' application, you can try something like this (example for running notepad).

To test, simple start notepad, and run this code (assumes you have English windows)
1:
2:
3:
4:
5:
6:
procedure TForm4.Button1Click(Sender: TObject);
var Handle: HWND;
begin
 Handle := FindWindow(nil, 'Untitled - Notepad');
 SetWindowLong(Handle, GWL_STYLE, (GetWindowLong(Handle, GWL_STYLE) and (not WS_SYSMENU)));
end;
Open in New Window
 
04.07.2008 at 02:55AM PDT, ID: 21295429
ah wonderful, that removes it.  The actual application, a standard win32 application (Its Avaya PC Wallboard) has a 'Compact' view whereby the File|View| etc can be hidden and just the 'message' from the phone server is displayed.

Would screen shots help at all?

Thank you all for the very quick replies
 
04.07.2008 at 02:57AM PDT, ID: 21295437

Rank: Wizard

you need more than removing it?
 
04.07.2008 at 03:01AM PDT, ID: 21295451
yes, becuse the File|View|Setup|Help menu is still visible, meaning that they can File|Exit and close it.  the code above does however remove the Minimise/Close from the window.  Let me get you a few screen shots as that will explain it much better than I can :o)
 
04.07.2008 at 03:05AM PDT, ID: 21295471

Rank: Wizard

you said you can hide these menu's, isn't that a good option?
 
04.07.2008 at 03:07AM PDT, ID: 21295475
Screen shots :

Normal View is the standard program.  Screen shot 2 is how we select coompact, and the 3rd view is the application running compact.  However at any time the user can click the compact view and restore the File menu, even if the windows hooks restrict the forms minimise/max/close.

Thanks for your help it is really appreciated.

Stu
 
Normal application state
Normal application state
 
 
Compact view
Compact view
 
 
Compact
Compact
 
 
04.07.2008 at 03:19AM PDT, ID: 21295505
thinking about it, can I not intercept the 'close' command of the program using a hook to stop it from closing?  Sorry to be such a pain in the backside....  
 
04.07.2008 at 03:34AM PDT, ID: 21295549

Rank: Wizard

ok, see this piece of code.

It will disable the file->exit menu item.

You will have to change the '8' in both the GetMenuItemInfo() and SetMenuItemInfo() calls to the correct value. This value is the menu item number counter from the top, starting with 0. You also need to count menu seperators.
For notepad its:

0 New
1 Open
2 Save
3 Save as
4 ---- (separator)
5 Page setup
6 Print
7 ---- (separator)
8 Exit
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
procedure TForm4.Button1Click(Sender: TObject);
var Handle: HWND;
    MenuHandle: HWND;
    SubMenuHandle: HWND;
    MenuItemInfo: TMenuItemInfo;
begin
 Handle := FindWindow(nil, 'Untitled - Notepad');
 SetWindowLong(Handle, GWL_STYLE, (GetWindowLong(Handle, GWL_STYLE) and (not WS_SYSMENU)));
 MenuHandle := GetMenu(Handle);
 SubMenuHandle := GetSubMenu(MenuHandle, 0);
 MenuItemInfo.cbSize := SizeOf(MenuItemInfo);
 MenuItemInfo.fMask := MIIM_STATE;
 GetMenuItemInfo(SubMenuHandle, 8, true, MenuItemInfo);
 MenuItemInfo.fState := MenuItemInfo.fState or MFS_DISABLED;
 MenuItemInfo.fState := MenuItemInfo.fState and (not MFS_ENABLED);
 SetMenuItemInfo(SubMenuHandle, 8, true, MenuItemInfo);
end;
Open in New Window
 
04.07.2008 at 03:44AM PDT, ID: 21295583
you are a STAR!  Thank you so much!  I take it I can re-enable the fratures by tweaking the code?  Thanks again
 
04.07.2008 at 04:03AM PDT, ID: 21295650

Rank: Wizard

yes, to re-enable, exchange MFS_DISABLED and MFS_ENABLED
 
04.07.2008 at 04:25AM PDT, ID: 21295759
One last thing, if I right click in the window - guess what - you get another popup menu with properties, minimise, always on top and exit :o(

Can we remove that exit from the right click popup menu?
 
04.07.2008 at 04:33AM PDT, ID: 21295791

Rank: Wizard

can you make a screen shot of that menu?
 
04.07.2008 at 04:37AM PDT, ID: 21295818
here it is...
 
the right click menu.
the right click menu.
 
 
04.07.2008 at 05:00AM PDT, ID: 21295959

Rank: Wizard

i'm afraid that menu is a lot harder to reach
 
04.07.2008 at 05:06AM PDT, ID: 21295983
hard or impossible?  I really appreciate all of your help by the way.  I have not used this site before, so is there something I need to do with regards to the 'points' system?  

Can I not just monitor the application, and intercept any close command?

If you have time, to point me in the right direction, or even advise what I need to research in order to stop that, it would be wonderful.
 
04.07.2008 at 05:22AM PDT, ID: 21296079

Rank: Wizard

it's probably possible. The problem is that you'll need to find a handle to the popupmenu.

Doing a hook and trying to stop it might work, but is probably more complicated.
 
04.07.2008 at 05:37AM PDT, ID: 21296204
if I was able to de-compile the original .exe (wall board) would I be able to see the handle for the pop up, or am I WAY off....

So I suppose its back to the original question.  Can I load the wallboard application, within a Delphi form?

Stu
 
04.07.2008 at 05:48AM PDT, ID: 21296301

Rank: Wizard

> if I was able to de-compile the original .exe (wall board) would I be able to see the handle for the pop up, or am I WAY off....

quite way off. The handle will change each time you start up the app.

> So I suppose its back to the original question.  Can I load the wallboard application, within a Delphi form?

This won't help, because this menu will then still be there.

I think you should consider how far do you want to go to protect your users from accidentally closing this app? If you can disable this menu item, probably alt-f4 will still work, if you could disable that, you can still open the task manager and kill it. How far do you want to go?
 
04.07.2008 at 05:51AM PDT, ID: 21296324
well ideally we do not want it closed under any circumstances.  We would like it to start up with the PC, connect and not close at all untill the user logs off.

However I suppose this will be a step in the right direction and not allow any accidental closures.

 
04.07.2008 at 05:59AM PDT, ID: 21296390

Rank: Wizard

as said, it will be very difficult to disable _all_ options.

How about you monitor if the app is closed and re-open it again if it is?
 
04.07.2008 at 06:03AM PDT, ID: 21296420
yes that would be an acceptable option, infact that would probably be better as we can monitor for serial offenders.

On a scale of easy -> hard how easy would that be to do.  I have never touched this side of Delphi programming before, and to be honest I am lost.  
 
04.07.2008 at 06:31AM PDT, ID: 21296649

Rank: Wizard

quite close to 'easy' :)

see example for 'monitoring' notepad:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
unit Unit4;
 
interface
 
uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, ExtCtrls;
 
type
  TForm4 = class(TForm)
    Button1: TButton;
    Timer1: TTimer;
    procedure Timer1Timer(Sender: TObject);
    procedure FormCreate(Sender: TObject);
  private
    { Private declarations }
    fProcessHandle: HWND;
    procedure StartApp;
  public
    { Public declarations }
  end;
 
var
  Form4: TForm4;
 
implementation
 
{$R *.dfm}
 
procedure TForm4.FormCreate(Sender: TObject);
begin
 StartApp();
end;
 
procedure TForm4.StartApp;
var StartupInfo: TStartUpInfo;
    ProcessInformation: TProcessInformation;
begin
 ZeroMemory(@StartupInfo, sizeof(StartupInfo));
 StartupI