1. Win32lib question

I'm going to try and describe the problem I'm having without being too 
vague....

I have a win32lib program that calls a routine in a dll that basically 
starts another Windows app (non-Euphoria).  My Euphoria routine passes 
the Euphoria program's instance to the dll routine and if the secondary 
program starts it returns the handle to the window of the spawned app.

What I need to know is when the spawned app closes.  I'm fairly certain 
that my program is being sent some messages by the spawned program.

Is it possible using win32lib to receive these messages and interpret 
them correctly?

Was that vague enough?

Thanks!!!!!!!!!

Jonas

new topic     » topic index » view message » categorize

2. Re: Win32lib question

------=_NextPart_000_0025_01C00E15.2D858100
        charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Brian I'm glad you studied that one farther than I.
You go MAN......

euman at bellsouth.net


------=_NextPart_000_0025_01C00E15.2D858100
        charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 5.50.4207.2601" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Brian I'm glad you studied that one =
farther than=20
I.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>You go MAN......</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2><A=20

------=_NextPart_000_0025_01C00E15.2D858100--

new topic     » goto parent     » topic index » view message » categorize

3. Re: Win32lib question

> posted by: Derek Parnell <ddparnell at bigpond.com>
> 
> Andy wrote:
> 
>>> 
>>> I was wondering what happened to the win32lib. Since it hasen't been updated
>>> in a long time, is it still being developed or was it abandoend
> 
> 
> It is not abandoned. I provide support for the existing release.
> 
> I'm slowly working on a rewrite of the library. The current one is not
> flexible enough to meet future needs. The work is not a high priority as the
> current library is fairly stable and usable. A higher priority for me is to
> develop a viable alternative implemenation of Euphoria.
> 
> Note to Greg Haberek: I've changed the internal API for user-written controls
> and I'm sure you'll have to rework some of the new Graph control. Sorry about
> that but I hope you'll find the new API a lot more versatile.
> 
> -- Derek Parnell Melbourne, Australia irc://irc.sorcery.net:9000/euphoria
> -------

This is why I'm holding off development on the new SynEdit control, 
which ideally could be accessed like a RichEdit, but has extended 
functionality (bookmarks, folding, adjustable selection, ...).The other 
reasons are disenchantment over RDS and my spending time playing bridge 
on the net :).
If you are interested in my helping with your "alternative 
implementation", just let me know...

CChris

new topic     » goto parent     » topic index » view message » categorize

4. Win32lib question

Hi everyone,

As a new registered user of Euphoria I am finding the language pretty 
much perfect for my needs,  and the quick and helpful support from 
Robert Craig and this board is something that I am very happy with.  I 
wonder though about Win32 development,  is Win32lib being worked on or 
what is the story?  I notice the date of March 5/01 as the last update 
on the archives.  I am not getting on anyone here,  I am just wondering 
about this,  as Euphoria is the perfect language to have a good solid 
Win32 development tool with it,  and one that is updated on a regular 
basis.  If this topic has already been discussed I apologize, I tried to 
search this list but had no luck.  I hope I have not stepped on any toes 
here.

Now for my newbie windows question,  How do you have multiple windows in 
Win32lib? You only have one Winmain statement but I need to go from one 
window to the next.  Do I have to make child windows of the main window 
all the time?

Thanks,
Dan

P.S. put me in the pro-Goto group,  I am sure I could write neater 
better code without the dreaded Goto but as a hack hobbyist programmer I 
am happy to just make it work and if I'm comfortable with so-called 
spaghetti code and I get the job done I don't care if it isn't the most 
structurally perfect or neatest,  it is how I like to program.

new topic     » goto parent     » topic index » view message » categorize

5. Re: Win32lib question

Dan,

Welcome.

As far as I know, you're right, to make multiple windows, make each after
the first a child of it (or any others, I think).  If you haven't already,
check out Judith's IDE, it's a big help in easily making Windows programs.
Might also try my "RunDemos", it's helpful to easily see & make use of the
various demos/examples for Win32Lib.

Here's an example of what Judith's IDE did for making some windows (it made
each window a child of the just previously created one, though on the
version of the IDE I used, it said (within the IDE) that they were all
children of the first window; myself, I don't know what difference any
specific window parenting would make, but you can make them however you
want.  I put the "moveZOrder" command in so that when you opened a sequence
of windows, and then closed them, the main would not get minimized.

Dan Moyer

-- multiple windows demo
--  code generated by Win32Lib IDE v0.10.4

include Win32lib.ew
without warning

----
--  Window Window1
global constant Window1 = create( Window, "Window1", 0, Default, Default,
400, 300, 0 )
global constant PushButton7 = create( PushButton, "Open Window 2", Window1,
20, 20, 90, 30, 0 )
global constant PushButton8 = create( PushButton, "Open Window 3", Window1,
128, 20, 90, 30, 0 )
global constant PushButton9 = create( PushButton, "Open Window 4", Window1,
244, 20, 90, 30, 0 )
----
--  Window Window2
global constant Window2 = create( Window, "Window 2", Window1, Default,
Default, 400, 300, 0 )
global constant PushButton10 = create( PushButton, "Open Window 5", Window2,
52, 40, 90, 30, 0 )
----
--  Window Window3
global constant Window3 = create( Window, "Window 3", Window2, Default,
Default, 400, 300, 0 )
global constant PushButton11 = create( PushButton, "Open Window 6", Window3,
60, 40, 90, 30, 0 )
----
--  Window Window4
global constant Window4 = create( Window, "Window 4", Window3, Default,
Default, 400, 300, 0 )
global constant PushButton13 = create( PushButton, "Open Window 7", Window4,
76, 36, 90, 30, 0 )
----
--  Window Window5
global constant Window5 = create( Window, "Window 5", Window4, Default,
Default, 400, 300, 0 )
----
--  Window Window6
global constant Window6 = create( Window, "Window 6", Window5, Default,
Default, 400, 300, 0 )
----
--  Window Window7
global constant Window7 = create( Window, "Window 7", Window6, Default,
Default, 400, 300, 0 )
----
procedure Window1_onClick ()
   openWindow( Window5, Modal )
end procedure
onClick[Window1] = routine_id("Window1_onClick")

----
procedure PushButton7_onClick ()
  openWindow( Window2, Modal )
end procedure
onClick[PushButton7] = routine_id("PushButton7_onClick")

----
procedure PushButton8_onClick ()
  openWindow( Window3, Modal )
end procedure
onClick[PushButton8] = routine_id("PushButton8_onClick")

----
procedure PushButton9_onClick ()
  openWindow( Window4, Modal )
end procedure
onClick[PushButton9] = routine_id("PushButton9_onClick")

----
procedure Window2_onClose ()
  moveZOrder( Window1, HWND_TOP)
end procedure
onClose[Window2] = routine_id("Window2_onClose")

----
procedure PushButton10_onClick ()
  openWindow( Window5, Modal )
end procedure
onClick[PushButton10] = routine_id("PushButton10_onClick")

----
procedure Window3_onClose ()
    moveZOrder( Window1, HWND_TOP)
end procedure
onClose[Window3] = routine_id("Window3_onClose")

----
procedure PushButton11_onClick ()
   openWindow( Window6, Modal )
end procedure
onClick[PushButton11] = routine_id("PushButton11_onClick")

----
procedure Window4_onClose ()
     moveZOrder( Window1, HWND_TOP)
end procedure
onClose[Window4] = routine_id("Window4_onClose")

----
procedure PushButton13_onClick ()
  openWindow( Window7, Modal )
end procedure
onClick[PushButton13] = routine_id("PushButton13_onClick")



WinMain( Window1, Normal )



----- Original Message -----
From: <dmccu at connect.ab.ca>
To: "EUforum" <EUforum at topica.com>
Sent: Sunday, March 24, 2002 8:56 PM
Subject: Win32lib question


>
> Hi everyone,
>
> As a new registered user of Euphoria I am finding the language pretty
> much perfect for my needs,  and the quick and helpful support from
> Robert Craig and this board is something that I am very happy with.  I
> wonder though about Win32 development,  is Win32lib being worked on or
> what is the story?  I notice the date of March 5/01 as the last update
> on the archives.  I am not getting on anyone here,  I am just wondering
> about this,  as Euphoria is the perfect language to have a good solid
> Win32 development tool with it,  and one that is updated on a regular
> basis.  If this topic has already been discussed I apologize, I tried to
> search this list but had no luck.  I hope I have not stepped on any toes
> here.
>
> Now for my newbie windows question,  How do you have multiple windows in
> Win32lib? You only have one Winmain statement but I need to go from one
> window to the next.  Do I have to make child windows of the main window
> all the time?
>
> Thanks,
> Dan
>
> P.S. put me in the pro-Goto group,  I am sure I could write neater
> better code without the dreaded Goto but as a hack hobbyist programmer I
> am happy to just make it work and if I'm comfortable with so-called
> spaghetti code and I get the job done I don't care if it isn't the most
> structurally perfect or neatest,  it is how I like to program.
>

new topic     » goto parent     » topic index » view message » categorize

6. Re: Win32lib question

> Hi everyone,

> As a new registered user of Euphoria I am finding the language pretty 
> much perfect for my needs,  and the quick and helpful support from 
> Robert Craig and this board is something that I am very happy with.  I 
> wonder though about Win32 development,  is Win32lib being worked on or 
> what is the story?  I notice the date of March 5/01 as the last update 
> on the archives.  I am not getting on anyone here,  I am just wondering 
> about this,  as Euphoria is the perfect language to have a good solid 
> Win32 development tool with it,  and one that is updated on a regular 
> basis.  If this topic has already been discussed I apologize, I tried to 
> search this list but had no luck.  I hope I have not stepped on any toes 
> here.

AFAIK Derek will be have version 0.57 out very soon, it's having a bit
of pre-release testing at the moment.

> Now for my newbie windows question,  How do you have multiple windows in 
> Win32lib? You only have one Winmain statement but I need to go from one 
> window to the next.  Do I have to make child windows of the main window 
> all the time?

I see Dan Moyer has already answered this with some helpful examples
so I won't try :)

> Thanks,
> Dan

> P.S. put me in the pro-Goto group,  I am sure I could write neater 
> better code without the dreaded Goto but as a hack hobbyist programmer I 
> am happy to just make it work and if I'm comfortable with so-called 
> spaghetti code and I get the job done I don't care if it isn't the most 
> structurally perfect or neatest,  it is how I like to program.

Evil I tell you! EEEEVVVVIIIILLLL! ;)

Thomas Parslow (PatRat)
E-Mail/Jabber: tom at almostobsolete.net
ICQ: 26359483

new topic     » goto parent     » topic index » view message » categorize

7. Re: Win32lib question

---- Original Message -----
From: <dmccu at connect.ab.ca>
To: "EUforum" <EUforum at topica.com>
Subject: Win32lib question


>
> Hi everyone,
>
> As a new registered user of Euphoria I am finding the language pretty
> much perfect for my needs,  and the quick and helpful support from
> Robert Craig and this board is something that I am very happy with.  I
> wonder though about Win32 development,  is Win32lib being worked on or
> what is the story?  I notice the date of March 5/01 as the last update
> on the archives.  I am not getting on anyone here,  I am just wondering
> about this,  as Euphoria is the perfect language to have a good solid
> Win32 development tool with it,  and one that is updated on a regular
> basis.  If this topic has already been discussed I apologize, I tried to
> search this list but had no luck.  I hope I have not stepped on any toes
> here.
>
> Now for my newbie windows question,  How do you have multiple windows in
> Win32lib? You only have one Winmain statement but I need to go from one
> window to the next.  Do I have to make child windows of the main window
> all the time?
>

All you need to do is create more than one window and organise a
triggering action to open the others. The window referenced in WinMain
() is the "prime" window. Other windows can be true children to the prime
one or independant windows. The only catch is that when the prime window is
closed, all others are too.


Here is some sample code:
----------------------
include win32lib.ew
constant wmain = create(Window,"Main",0,0,0,400,400,0),
         wother = create(Window,"Other", 0, 50,50,150,150,0)

procedure activate_main(integer self, integer event, sequence p)
    openWindow(wother, Normal)
end procedure
setHandler(wmain, w32HActivate, routine_id("activate_main"))

WinMain(wmain, Normal)

-----------
Derek

new topic     » goto parent     » topic index » view message » categorize

8. Win32lib question

Humm, we can do a lot of things with this wonderful library, but is there a
way to know the class of a control
with just an id ?
why ?  I have a lot of controls IDs in a sequence like this :

sequence s
....
s[1] = create( EditText, "", Win, 95, 0, 105, 20, 0 )
s[2] = create( DropDownList, "", Win, 95, 20, 105, 80, 0 )
s[3] = create( Radio, "", Win, 95, 60, 55, 20, 0 )
etc ...

and I want to copy all the values of these controls in one other sequence t
by example.

So I think I should probably do a thing like that :

for i=1 to length(s) do
    if integer ( s[i] ) and s[i] != 0 then   -- if it's a valid id

        if s[i] is an EditText control  then
            t=append(t, getText(s[i]) )
        elsif s[i] is an DropDownList control then
            t=append(t, getIndex(s[i]) )
        elsif etc ....

        end if

    end if
end for

But I don't know how to do.

new topic     » goto parent     » topic index » view message » categorize

9. Re: Win32lib question

Hi "Feta",
at this stage you cannot do this. But it's very easy to implement and I've
been think of doing it anyway, so I'll put it into the next release.

It'll be something like ....

   info = getControlInfo( id , item)

where item can be either a single keyword or a list of keywords. It would
return the item(s) requested by the keywords.

eg.
    sequence info
    info = getControlInfo(s[i], w32CI_Type)
    if info[1] = True then -- A valid ID and valid types supplied.
        if info[2] is an EditText control  then
            t=append(t, getText(s[i]) )
        elsif info[2] is an DropDownList control then
            t=append(t, getIndex(s[i]) )
        elsif etc ....

       end if
    end if

This is just an idea for now. Does anybody else have opinions about this
issue?

Of course another way would be to do this...

  s = {}
  . . .
  s = append(s, {create(...), EditText})
  s = append(s, {create(...), DropDownList})
  . . .
  for i=1 to length(s) do
     if integer ( s[i][1] ) and s[i][1] != 0 then   -- if it's a valid id

         if s[i][2] is an EditText control  then
             t=append(t, getText(s[i][1]) )
         elsif s[i][2] is an DropDownList control then
             t=append(t, getIndex(s[i][1]) )
         elsif etc ....

         end if

     end if
 end for

------
Derek Parnell
Melbourne, Australia
(Vote [1] The Cheshire Cat for Internet Mascot)

----- Original Message -----
From: "Feta" <mb11363 at CHELLO.BE>
To: <EUPHORIA at LISTSERV.MUOHIO.EDU>
Sent: Wednesday, November 15, 2000 6:56 AM
Subject: Win32lib question


> Humm, we can do a lot of things with this wonderful library, but is there
a
> way to know the class of a control
> with just an id ?
> why ?  I have a lot of controls IDs in a sequence like this :
>
> sequence s
> ....
> s[1] = create( EditText, "", Win, 95, 0, 105, 20, 0 )
> s[2] = create( DropDownList, "", Win, 95, 20, 105, 80, 0 )
> s[3] = create( Radio, "", Win, 95, 60, 55, 20, 0 )
> etc ...
>
> and I want to copy all the values of these controls in one other sequence
t
> by example.
>
> So I think I should probably do a thing like that :
>
> for i=1 to length(s) do
>     if integer ( s[i] ) and s[i] != 0 then   -- if it's a valid id
>
>         if s[i] is an EditText control  then
>             t=append(t, getText(s[i]) )
>         elsif s[i] is an DropDownList control then
>             t=append(t, getIndex(s[i]) )
>         elsif etc ....
>
>         end if
>
>     end if
> end for
>
> But I don't know how to do.

new topic     » goto parent     » topic index » view message » categorize

10. Re: Win32lib question

On Tue, 14 Nov 2000 20:56:57 +0100, Feta <mb11363 at CHELLO.BE> wrote:

>Humm, we can do a lot of things with this wonderful library, but is there a
>way to know the class of a control
>with just an id ?
>why ?  I have a lot of controls IDs in a sequence like this :
>

How about this:

sequence s

atom edtx

fuction edtxt()
  return create( EditText, "", Win, 95, 0, 105, 20, 0 )
end function

s[1] = routine_id("edtext")

then append them to the arrays

Then use call_func(x[1],{})


Bernie

new topic     » goto parent     » topic index » view message » categorize

11. Re: Win32lib question

Hi Bernie,
I think you missed to point. I think what was being asked was, given a
control id, and only a control id, how can one tell what sort of control it
is?

Currently, there is no support for this in win32lib. If you need to do this
sort of thing, you have to create your own solution.


------
Derek Parnell
Melbourne, Australia
(Vote [1] The Cheshire Cat for Internet Mascot)

----- Original Message -----
From: "Bernie" <xotron at PCOM.NET>
To: <EUPHORIA at LISTSERV.MUOHIO.EDU>
Sent: Wednesday, November 15, 2000 9:59 AM
Subject: Re: Win32lib question


> On Tue, 14 Nov 2000 20:56:57 +0100, Feta <mb11363 at CHELLO.BE> wrote:
>
> >Humm, we can do a lot of things with this wonderful library, but is there
a
> >way to know the class of a control
> >with just an id ?
> >why ?  I have a lot of controls IDs in a sequence like this :
> >
>
> How about this:
>
> sequence s
>
> atom edtx
>
> fuction edtxt()
>   return create( EditText, "", Win, 95, 0, 105, 20, 0 )
> end function
>
> s[1] = routine_id("edtext")
>
> then append them to the arrays
>
> Then use call_func(x[1],{})
>
>
> Bernie

new topic     » goto parent     » topic index » view message » categorize

12. Re: Win32lib question

Hello Derek!

Thanks for your help, I'm expecting the next ver. of win32lib !
You're one of the DevTeam, aren't you ?
So I have again a 'little' question (nevermind if you're too busy of bored
!) : I'm making a tiny roguelike game (in case you know, it's like Adom,
Nethack, Angband, ...) and all the graphics are in fact ASCII char with
colors. I begon it under Eu-Dos and I'm trying to adjust it to use win32lib
('cause all the advantages blink
I use setTextColor(), setPenPosition() and wPuts() for each char, but
unfortunately it's very very slow (in a 640*480 window with a PII 350 : +-
1 frame/sec. gloups !), is it in your plan to improve that, or...heu...do
you see another way to quicly print char with switching colors to the
screen ?
thanks in advance !

Gwen

PS : sorry for all the mistakes in the text, I just can't speak english smile

new topic     » goto parent     » topic index » view message » categorize

13. Re: Win32lib question

--- "Gwen (Feta)" <mb11363 at CHELLO.BE> wrote:

> So I have again a 'little' question (nevermind if you're too busy of bored
> !) : I'm making a tiny roguelike game (in case you know, it's like Adom,
> Nethack, Angband, ...) and all the graphics are in fact ASCII char with
> colors. I begon it under Eu-Dos and I'm trying to adjust it to use win32lib
> ('cause all the advantages blink

Cool.  Post something ASAP (DOS, Win, whatever)!

> I use setTextColor(), setPenPosition() and wPuts() for each char, but
> unfortunately it's very very slow (in a 640*480 window with a PII 350 : +-
> 1 frame/sec. gloups !), is it in your plan to improve that, or...heu...do
> you see another way to quicly print char with switching colors to the
> screen ?
> thanks in advance !

OK, it looks like you're probably just printing to a window directly, right?
If so, you might look into using a pixmap, and blitting that do the screen.  I
know, this kind of takes away from the simplicity you'd be using in DOS, but,
as I'm sure Jiri would be happy to point out, that's what you get for moving to
windows.

It's not that bad, really, and you could probably keep much of the same code,
and add an onPaint event that blits the pixmap to the window.

Seriously, though, I'd be very interested in seeing your Rogue/Nethack clone.
I've often thought about doing something like that myself.



=====
Matt Lewis
http://www.realftp.com/matthewlewis

__________________________________________________
Do You Yahoo!?
Yahoo! Calendar - Get organized for the holidays!
http://calendar.yahoo.com/

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu