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

Re: starting condition for browsing to a folder

From: Dr. Roger Dube <rogerdube_at_dathq.com>
Date: Fri, 14 Oct 2005 16:41:37 -0400

Anil, for turnkeys, here's what works well for me:

\\ ************** Begin turnkey code *******************

REQUIRES PROTECTION

REQUIRES mycode.f \ Put source code for
turnkey here

: TURNKEYFUNCTION my-special-function ; \ Put turnkey word here for
use.

CREATE AppName ,Z" Turnkey"

[SWITCH TURNKEY-MESSAGES DEFWINPROC ( -- res )
   WM_DESTROY RUN: 0 PostQuitMessage DROP 0 ;
SWITCH]

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

: TURNWINDOW ( -- hwnd )
      0 \ extended style
      AppName \ window class name
      Z" All Done!" \ 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 QUIT ;

: DEMO ( -- )
   AppName TURNPROC DefaultClass DROP
   TURNWINDOW DUP SW_SHOWDEFAULT ShowWindow DROP
   UpdateWindow DROP
   DISPATCHER DROP BYE ;

: WINMAIN ( -- )
   DEMO 0 ExitProcess ;

' WINMAIN 'MAIN !

[+SWITCH TURNKEY-MESSAGES ( -- res )
    WM_CREATE RUN: TURNKEYFUNCTION TURN-CLOSE 0 ExitProcess 0 ;
 SWITCH]

 -1 THRESHOLD

 PROGRAM turnkeyname turnkey-icon.ico

 bye \ go away when turnkey has
been created

\\********************End turnkey creation code ****************************

 NOTES: The above creates a turnkey called "turnkeyname.exe" using 32x32
pixel icon turnkey-icon.ico (766 byte icon).

The source code is defined by a file, mycode.f, and the Forth word that will
be run upon executing the turnkey is "my-special-function"... obviously all
of these need to be customized to your task and code.

Good luck!

- Roger

-----Original Message-----
From: sftalk-bounce_at_forth.com [mailto:sftalk-bounce_at_forth.com] On Behalf Of
Anil Rodrigues
Sent: Friday, October 14, 2005 4:22 PM
To: sftalk_at_forth.com
Subject: [sftalk] Re: starting condition for browsing to a folder

Glad that helped; code modified from examples by Mike Gahn and
others. To me that's one of the first things needed for an app.
The other first thing is to make turnkey files, where I'm still
a bit lost.
Cheers! Anil

-----Original Message-----
From: Dr. Roger Dube [mailto:rogerdube_at_dathq.com]
Sent: Friday, October 14, 2005 3:50 PM
To: sftalk_at_forth.com
Subject: [sftalk] Re: starting condition for browsing to a folder

That works perfectly, Anil. Thanks! This helps me focus the GUI to a
specific folder.

- Roger

-
----------------------------------------------------------------------
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
----------------------------------------------------------------------

--
No virus found in this incoming message.
Checked by AVG Anti-Virus.
Version: 7.0.344 / Virus Database: 267.12.0/132 - Release Date: 10/13/2005
----------------------------------------------------------------------
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 Oct 14 2005 - 13:42:21 PDT

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