[pmmail-list] Forcing PMMail/2 to fetch mail
Soren Ager
pmmail-list@blueprintsoftwareworks.com
Mon, 12 Mar 2001 23:04:06 -0500 (EST)
On Mon, 12 Mar 2001 21:34:24 -0500 (EST), Steve Marvin wrote:
>On Mon, 12 Mar 2001 03:05:05 +0000 (GMT), Paul Ratcliffe wrote:
>>This is very easy to do. It would take me about 15 minutes to code and
>>test a utility to do this. What's it worth? :-))
>
> WinInitialize
> WinQuerySwitchList,
> find "PMMail/2 - " in the list (just check the first 11 chars the rest
> is the account name)
> WinPostMsg WM_CHAR (F2 with or without KC_ALT flag)
> WinTerminate
Or expressed in Virtual Pascal:
{ Created 12.03.01 by Soren Ager }
PROGRAM PMMFetch;
USES OS2Def, OS2PmApi, VPUtils;
VAR
Myhab : hab;
hwndFrame : HWnd;
cbItems : ULong;
ulBufSize : ULong;
Pswblk : PSWBlock;
P : PSWEntry;
i : integer;
BEGIN
Myhab:=WinInitialize(0);
cbItems := WinQuerySwitchList(MyHab, nil, 0);
ulBufSize := cbItems*sizeof(SwEntry) + sizeof(hSwitch);
GetMem(pswBlk, ulBufSize);
cbItems := WinQuerySwitchList(MyHab, pswblk, ulBufSize);
p:=@pswblk^.aswentry;
i:=1;
WHILE (i<=cbItems) AND (Copy(p^.swctl.szswtitle,1,10)<>'PMMail/2 -') DO
BEGIN
inc(i);
inc(p);
END;
FreeMem(pswBlk);
if (Copy(p^.swctl.szswtitle,1,10)='PMMail/2 -') THEN
BEGIN
WriteLn('Found: ',p^.swctl.szswtitle,' ',Int2Hex(p^.swctl.hwnd,8));
WinPostMsg(p^.swctl.hwnd, WM_COMMAND, $3fe, $3);
END;
WinTerminate(Myhab);
END.
Greetings
Søren
- pmmail-list - The PMMail Dicussion List ---------------------------
To UNSUBSCRIBE, send a message to mdaemon@bmtmicro.com with the first
line of the message body being...
UNSUBSCRIBE pmmail-list@blueprintsoftwareworks.com