Board index » delphi » Help! Add Icon to Program Manager Group

Help! Add Icon to Program Manager Group

I need to automatically add a program to the Startup Group.
Can anyone give me any help or code to do this.
(Please email me any answers)
Thanks
David Taylor
 

Re:Help! Add Icon to Program Manager Group


Quote
David Taylor <e...@dial.pipex.com> wrote:
>I need to automatically add a program to the Startup Group.
>Can anyone give me any help or code to do this.
>(Please email me any answers)
>Thanks
>David Taylor

There is an example of just that in the Delphi for Dummies book. It
uses DDE. I don't have it available at the moment, but try to get a
hold of a copy.

Re:Help! Add Icon to Program Manager Group


In article <4cm167$...@cloner3.netcom.com>,

Quote
Robert Reister <fastt...@ix.netcom.com> wrote:
>David Taylor <e...@dial.pipex.com> wrote:

>>I need to automatically add a program to the Startup Group.
>>Can anyone give me any help or code to do this.
>>(Please email me any answers)
>>Thanks
>>David Taylor

>There is an example of just that in the Delphi for Dummies book. It
>uses DDE. I don't have it available at the moment, but try to get a
>hold of a copy.

Folks,

There is an example of DDE with program manager (the best way to do
this), in the examples directory of your DELPHI CD or installation. It's
dead easy once you've sussed how to use the DDE control. Also the manual
mumbles about the DDE control and settings have a gander at that. Also in
the WINAPI reference (ie help file) you should do a search for Shell and
amongst that list should be Shell Dyanamic Data Exchange from there you
can get a reasonably complete list of all DDE commands program manager
accepts (and ideally all other shells), so you can also remove any added
icons in an uninstall program.

Hope that helps,

Martin Searle
PC Support
Univeristy of Kent

Re:Help! Add Icon to Program Manager Group


For various reason I had to write my own
install program. However when I add the Program Item (via
DDE) Program manger pops up for a second and shows
the new program item etc. I have noticed although most
of the commercial installers also do this some
(Freeman for example) do not!. What is the secret ??
How do I add a Group/Item to Progman without
seeing it pop up briefly ??

I have heard of an alternative to the DDE method
of adding Groups/Items anyone knwo how this is done ??

Jon

----------------------------------------------------------------------
Name:      Dr Jon Jenkins    Location: Digital Equipment Corporation NaC
Voice/Fax: 61-7-55-75-0151/100         Burnett Place, Research Park,
Inet:      jenki...@ozy.dec.com        Bond University, Gold Coast
Close Proximity: "HEY YOU !!!"         QLD, AUSTRALIA 4229
"Daddy, what's outside the Universe?" (My 5 year old.....)
-----------------------------------------------------------------------

Re:Help! Add Icon to Program Manager Group


In article <4d5mfa$...@nntpd.lkg.dec.com>,
Jon Jenkins  <jenki...@ozy.dec.com> wrote:

Quote
>For various reason I had to write my own
>install program. However when I add the Program Item (via
>DDE) Program manger pops up for a second and shows
>the new program item etc. I have noticed although most
>of the commercial installers also do this some
>(Freeman for example) do not!. What is the secret ??
>How do I add a Group/Item to Progman without
>seeing it pop up briefly ??

>I have heard of an alternative to the DDE method
>of adding Groups/Items anyone knwo how this is done ??

>Jon

Jon et al,

Here's a rough and ready solution to the above problem. Does anyone know
of an alternate more elegant way than this since the following method
uses the API exclusively :

The following procedures are the on-click methods in a test program for
this. The first will hide program manager once hidden any manipulation
of program manager via DDE is still possible but will not be displayed on
screen. The second procedure is run when the user wishes to re-display
program manager, it would in the real world be run after the DDE stuff is
done.

Procdeure TForm1.Button1Click(Sender: TObject);
{Run when user wishes to hide progman}
var
  Handle : HWnd;
begin
   Handle := FindWindow('Progman','Program Manager');
   if Handle = 0 then
       Application.MessageBox('This Did not Work','Test',MB_OK);
   ShowWindow(Handle,SW_HIDE);
   {Do DDE group/icon creation stuff here followed by UNHIDE as below}
end;

procedure TForm1.Button2Click(Sender: TObject);
{This is done when the user wishes to unhide progman, didn't bother to
check the handle with an IF.}
var
  Handle : HWnd;
begin
   Handle := FindWindow('Progman','Program Manager');
   ShowWindow(Handle,SW_NORMAL); {you could change the SW_ setting to one
                                  of the others}
end;

There are two alternates to using DDE but neither is recomended :

1) pre-create the group with icons and install to a fixed path in the
program. Amend progman.ini accodingly and restart windows.

ADV : Simple

DISADV : Fixed path, no flexibility

2) Create from scratch the Group File, Search File Formats in Win-API
help for the format and tips on doing this.

ADV : NONE over DDE that I can see, you can do all that this offers with
DDE.

DISADV : WAY TOO COMPLICATED, just a quick glance at the file format
document confirms this. It's easier to DDE it than try to write a program
to do this.

You can use similar FINDWINDOW,GETWINDOW and SendMessage commands to
tile program manager or manipulate it in other ways, in theory any WM_
command progman will respond to can be sent.

Hope that helps,

Martin Searle
PC Support
UKC

Re:Help! Add Icon to Program Manager Group


Quote
Jon Jenkins <jenki...@ozy.dec.com> wrote:
>For various reason I had to write my own
>install program. However when I add the Program Item (via
>DDE) Program manger pops up for a second and shows
>the new program item etc. I have noticed although most
>of the commercial installers also do this some
>(Freeman for example) do not!. What is the secret ??
>How do I add a Group/Item to Progman without
>seeing it pop up briefly ??
>I have heard of an alternative to the DDE method
>of adding Groups/Items anyone knwo how this is done ??

One possibility I can think of is to give your SETUP app the FormStyle
property of fsStayOnTop and make it full-screen.  The problem that
I've experienced with this, however, is that any child windows that
your SETUP creates are also hidden from view!

Having the Progam window flash briefly does not strike me as a serious
problem.  More serious is when the Progman window goes overtop of your
SETUP program and won't go away.  I found the following code will do
the trick in this case

  { Code to create icons in Progman }
  for J := 1 to 3 do Application.ProcessMessages;
  Application.BringToFront;

Other Threads