In article <
5a675ef1-2467-4bb6...@googlegroups.com>,
Have you stopped beating your wife?
You command MS-Windows itself to open a window, and you
talk about an emulator, what??
>
>I'd like to see some screen shots.
Show you a source accepted by wina.
wina is a console Forth opened in a terminal window.
I give you my word that it opens a graphical window and sports a
dialogue.
I think DLL is a bad name for calls to the MS operating
system. I use `` CALL '' or `` CALL[ ... par# .. par# .. CALL] ''
CALL accepts parameters in the usual way.
CALL] allows the parameters to be positioned in place
using words PAR3, that fills in the third parameter.
\ ------------------------------------------------
\ A vd Horst, vrij naar FASM
\ Beer - example of tiny (one section) Win32 program
HEX
20 CONSTANT MB_ICONQUESTION
4 CONSTANT MB_YESNO
6 CONSTANT IDYES
WANT K32
"USER32.DLL" LOAD-DLL: user32
"MessageBoxA" 'user32 DLL-ADDRESS: MessageBoxA
"WINMM.DLL" LOAD-DLL: winmm
"mciSendStringA" 'winmm DLL-ADDRESS: mciSendStringA
"open cdaudio" Z CONSTANT _cmd_open
"set cdaudio door open" Z CONSTANT _cmd_eject
"close cdaudio" Z CONSTANT _cmd_close
"Do you need additional place to put the beer?" Z CONSTANT _message
"Desktop configuration" Z CONSTANT _caption
: handle-error DUP ?ERROR ;
: MAKE-PLACE-FOR-BEER
0 0 0 _cmd_open mciSendStringA .S CALL .S handle-error .S
0 0 0 _cmd_eject mciSendStringA CALL .S handle-error .S
0 0 0 _cmd_close mciSendStringA CALL .S handle-error .S
;
: beer[] \ HEX
MessageBoxA DROP \ preload
CALL[
MB_ICONQUESTION MB_YESNO OR PAR4
_caption PAR3
_message PAR2
0 PAR1
MessageBoxA CALL]
.S
IDYES = IF
MAKE-PLACE-FOR-BEER
THEN
;
\ --------------------------------
You can load the source on wina. Then beer[]
opens a window and asks a question.
The window remains open after answering the question.
After that you can go on with Forthing, and you can close
the graphical window, or not.
There are subtleties involved. This program can be made
into beer.exe, and this executable works on other
machines where wina is not installed (but it requires
winmm, of course).
Note that you only need -- besides CALL itself --
LOAD-DLL and DLL-ADDRESS .
All the other information, the commands for the cd-player,
the actual value for IDYES , the name of the multi-media
DLL etc. can be found in the Microsoft documentation.
Actually finding the documentation is two order of magnitudes
more difficult/time consuming than writing a graphical application.
Groetjes Albert
--
Don't praise the day before the evening. One swallow doesn't make spring.
You must not say "hey" before you have crossed the bridge. Don't sell the
hide of the bear until you shot it. Better one bird in the hand than ten in
the air. First gain is a cat spinning. - the Wise from Antrim -