Board index » delphi » How to create Program Manager groups and icons??

How to create Program Manager groups and icons??

Hello World,

I saw a post a few months ago asking how to create Program Manager groups and
icons from within Delphi apps, and I didn't see any replies.  We have the same
need in some of our programs, so the question still stands.  Anyone know what
the PM macro name is to create icons, or is there some Windows API stuff we
can use??

We'd greatly appreciate any help you can offer!!

Thanks,
Steve

 

Re:How to create Program Manager groups and icons??


In article: <swbaker.863.00048...@oakland.edu>  swba...@oakland.edu (Steve Baker) writes:

Quote

> Hello World,

> I saw a post a few months ago asking how to create Program Manager groups and
> icons from within Delphi apps, and I didn't see any replies.  We have the same
> need in some of our programs, so the question still stands.  Anyone know what
> the PM macro name is to create icons, or is there some Windows API stuff we
> can use??

> We'd greatly appreciate any help you can offer!!

> Thanks,
> Steve

The following was posted over the weekend, hope its what you
want.

Quote
>>Does anybody know how to create program groups and program items in
>>progman at run time. I think you use the API call SendMessage() but I
>>can't figure out how to use it with the on line docs provided with Delphi.

(Put a DDEClientConv component on your form and call it
DDEClient and set these properties:
DDEService PROGMAN
ConnectMode ddeAutomatic
ServiceApplication PROGMAN)

procedure AddToProgman;
var
    s,s1,s2,Macro : String;
    Cmd: array[0..255] of Char;

begin
    s1:='The group name';
    Macro := Format('[CreateGroup(%s)]', [s1]) + #13#10;
    StrPCopy (Cmd, Macro);
    DDEClient.ExecuteMacro(Cmd, false);
    s2:='C:\MYPATH\MYPROG.EXE';
    s:='Description of myprog';
    Macro := '[AddItem('+s2+','+s+')]'+ #13#10;
    StrPCopy (Cmd, Macro);
    DDEClient.ExecuteMacro(Cmd, false);
end;

Regards from Ian.
--
                     ||||||||
                     | ~  ~ |
                    (| @  @ |)
----------------oOOo---(__)---oOOo------------------------
| Ian - "Smoke me a kipper I'll be back for breakfast !" |
|                                                        |
| EMail IanMa...@breallon.demon.co.uk    Banco Real s.a. |
|                                        (London Branch) |
----------------------------------------------------------

Re:How to create Program Manager groups and icons??


In article <swbaker.863.00048...@oakland.edu>, swba...@oakland.edu says...

Quote

>Hello World,

>I saw a post a few months ago asking how to create Program Manager groups and
>icons from within Delphi apps, and I didn't see any replies.  We have the same
>need in some of our programs, so the question still stands.

There is a demo on Delphi, look for file
\delphi\demos\ddedemo\ddeform.pas. In my WFW 3.11 that demo does not work 100%.
You can create ONE GROUP ONLY but after that you allways get the error case. Why ???

The DDE commands of Program Manager are
  CreateCmd = '[CreateGroup(%s)]';
    ShowCmd = '[ShowGroup(%s, 1)]';
     DelCmd = '[DeleteItem(%s)]';
     AddCmd = '[AddItem(%s)]';

The program manager DDEserviceName is PROGMAN and topic name is empty.
The topic name is used when your program asks contents of a group.
To add the item into a group I had first to make sure that PM is showing the group just
now. If the EXE is allready in the group I have to delete it first.

  GetGroup( szgpName, buffer );
  s := '[ShowGroup('+gpName+',1)]';
  if StrPos(Buffer, szItName) <> nil then begin
        s := s+'[DeleteItem("'+itName+'")]';
  end;
  s := s+'[AddItem('
        +itExe
        +','+itName
        +',,,'
        +xypos+','
        +itWrkDir
        +')]';
  send this command  to PROGMAN.

Greetings, Lasse

Re:How to create Program Manager groups and icons??


Quote
swba...@oakland.edu (Steve Baker) wrote:
>I saw a post a few months ago asking how to create Program Manager groups and
>icons from within Delphi apps, and I didn't see any replies.  We have the same
>need in some of our programs, so the question still stands.  Anyone know what
>the PM macro name is to create icons, or is there some Windows API stuff we
>can use??

I've got a component to do exactly this (TProgMan, how creative).  It will let you access
progman, program groups, and program items as objects and manipulate them
without having to figure out dde.  Perfect for install programs.  I'm working on the help
system now.  Email me if anyone's interested.  See my recent post in c.l.p.d.components
for more info.

Quote
>We'd greatly appreciate any help you can offer!!
>Thanks,
>Steve

Stephen

--
Stephen Sprunk
sspr...@pobox.com sspr...@nyx.cs.du.edu spr...@uiuc.edu
C, Pascal, Delphi, Basic, Lisp, English, Spanish, PGP, RIPEM, etc..
Printed on 100% Recycled bits.  Damn tree-huggers!

Re:How to create Program Manager groups and icons??


Greetings again y'all!

Quote
>The following was posted over the weekend, hope its what you
>want.

[ snip ]

Wow, thanks to everyone for replying so swiftly!!  We'll try out this great
stuff and see what happens!  Thanks again.

Steve

Re:How to create Program Manager groups and icons??


Article 782 of comp.lang.pascal.delphi.misc:
From: l...@mail.wallac.fi (Lasse Laine)
[SNIP]

Quote
>The DDE commands of Program Manager are
>  CreateCmd = '[CreateGroup(%s)]';
>    ShowCmd = '[ShowGroup(%s, 1)]';
>     DelCmd = '[DeleteItem(%s)]';
>     AddCmd = '[AddItem(%s)]';
[SNIP]
>Greetings, Lasse

Lasse and any others into this sort of thing,

There are several others ReloadGroup,DeleteGroup,and ReplaceItem are just
a few. In the Windows API help, search for SHELL and select Shell
Dynamic-Data Exchange Interface Overview for a more detailed view of the
commands and all their parameters.

Greetings,

Martin Searle
Micro Support Group

Author of : DDEDLL.DLL - a C++ .DLL for wrapping all the Progman DDE
commands into easy to use functions. This was before DELPHI and the DDE
components simplified it all :-(.

Other Threads