hiding tray icons exeption: "Could not load Module [...

delphi package - easy access to kernel objects etc.
Post Reply
smallsmoker
Posts: 4
Joined: Tue Feb 26, 2008 1:58 pm

hiding tray icons exeption: "Could not load Module [...

Post by smallsmoker »

Hi i tried to hide a tray icon of a externel application,
my os.: Windows Vista Ultimate x64
delphi.: Codegear Rad delphi 2007

i also tried it on windows xp professional xp2
with a delphi 7 compiler :/

here my source code:

Code: Select all

unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, madkernel, StdCtrls;

type
  TForm1 = class(TForm)
    Button1: TButton;
    procedure Button1Click(Sender: TObject);
  private
    { Private-Deklarationen }
  public
    { Public-Deklarationen }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
var name:string;
begin
Name := 'foobar2000.exe';
Process( Name).TrayIcons.Hide;
MessageBox(0, pchar('"' + Process( Name).Exefile + '"'), '', 0);
Process( Name).TrayIcons.Show;
end;

end.
and a Screenshot of the Exeption.:
http://wearestrange.jypd.de/boredcoders ... Bitmap.jpg
smallsmoker
Posts: 4
Joined: Tue Feb 26, 2008 1:58 pm

Re: hiding tray icons exeption: "Could not load Module

Post by smallsmoker »

*push*
please help me :-/
smallsmoker
Posts: 4
Joined: Tue Feb 26, 2008 1:58 pm

Post by smallsmoker »

push again
madshi
Site Admin
Posts: 10754
Joined: Sun Mar 21, 2004 5:25 pm

Post by madshi »

Strange, it works with Delphi 7 on XPSP2 here on my PC.
brian
Posts: 45
Joined: Fri Feb 29, 2008 11:12 am

Post by brian »

You need to run it from outside the IDE, the exception seems to happen only if you run it with the IDE/debugger etc

It doesn't really work anyway with D2007/Vista
smallsmoker
Posts: 4
Joined: Tue Feb 26, 2008 1:58 pm

Post by smallsmoker »

and theres no way that i can hide a single icon on windows vista ?
lg smallsmoker
Post Reply