programming tools for Windows applications development
  Home  |   SwiftForth Archive  |   SwiftX Archive  |

icon on toolbar for a task

From: Dr. Roger Dube <rogerdube_at_dathq.com>
Date: Fri, 5 May 2006 05:42:58 -0400

Does anyone know how to add an icon to the task toolbar (at the bottom of
the Windows screen) for a turnkey that we create using SwiftForth? The
turnkeys work fine, but unlike other Windows tasks these basic turnkeys do
not have an icon below on the toolbar while they are running. it makes it
harder to switch back to the task later.

I use the following to create the turnkey.

REQUIRES PROTECTION

REQUIRES myfile.F \ Put source code for turnkey here

: TURNKEYFUNCTION myfunction ; \ Put turnkey word here.

CREATE AppName ,Z" Turnkey"

[SWITCH TURNKEY-MESSAGES DEFWINPROC ( -- res )

   WM_DESTROY RUN: 0 PostQuitMessage DROP 0 ;

SWITCH]

:NONAME 32 FSTACK MSG LOWORD TURNKEY-MESSAGES ; 4 CB: TURNPROC

: TURNWINDOW ( -- hwnd )

      0 \ extended style

      AppName \ window class name

      Z" Please click CONTINUE:" \ window caption

      WS_OVERLAPPEDWINDOW \ window style

      CW_USEDEFAULT \ initial x position

      CW_USEDEFAULT \ y

      100 \ x size

      40 \ y

      0 \ parent window handle

      0 \ window menu handle

      HINST \ program instance handle

      0 \ creation parameter

   CreateWindowEx ;

: TURN-CLOSE ( -- res ) HWND 0 EndDialog ;

: DEMO ( -- )

   AppName TURNPROC DefaultClass DROP

   TURNWINDOW DUP SW_SHOWDEFAULT ShowWindow DROP

   UpdateWindow DROP

   DISPATCHER DROP ;

: WINMAIN ( -- )

   DEMO 0 ExitProcess ;

' WINMAIN 'MAIN !

[+SWITCH TURNKEY-MESSAGES ( -- res )

    WM_CREATE RUN: TURNKEYFUNCTION TURN-CLOSE 0 ExitProcess ;

 SWITCH]

 -1 THRESHOLD

PROGRAM My-Turnkey.EXE icons\sat00c.ICO

-- Roger
 --------------------------------------------
 Dr. Roger Dube
 President and Chief Science Officer
 Digital Authentication Technologies, Inc.
 561.392.7404 (office)
 561.892.2474 (eFax)
 RogerDube_at_datHQ.com

 http://www.datHQ.com

 1900 Glades Road Suite 441
 Boca Raton, FL 33431

 ----------------------------------------------------------------------
 This email message is for the sole use of the intended recipient(s) and may
contain confidential and privileged information. Any unauthorized review,
use, disclosure or distribution is prohibited. If you are not the intended
recipient, please contact the sender by reply email and destroy all copies
of the original message. Any views expressed in this message are those of
the individual sender, except where the sender specifically states them to
be the views of Digital Authentication Technologies, Inc.

----------------------------------------------------------------------
sftalk_at_forth.com The SwiftForth programming discussion email list
To unsubscribe, send subject "unsubscribe" to sftalk-request_at_forth.com
For list command help, send subject "help" to sftalk-request_at_forth.com
Message archives are located at http://www.forth.com/archive/sftalk
----------------------------------------------------------------------
This list is a forum for SwiftForth users. For product support and bug
reports, please send email to support_at_forth.com
----------------------------------------------------------------------
Received on Fri May 05 2006 - 02:43:27 PDT

This archive was generated by hypermail 2.2.0 : Thu Dec 04 2008 - 03:04:21 PST