1. A Few Questions

What would be the fastest way to go about searching for a filename on a
hard drive? For instance, I need to find all instances of "normal.dot"
on a person's hard drive.

Also, how do I check a user's operating system? I want to use dir95(),
but I have users who are in DOS6.x or older/Windows 3.1 and dir95() is
apparently not compatible with the older Windows/DOS systems.

Thanks!
ck

new topic     » topic index » view message » categorize

2. Re: A Few Questions

C.K. & Kirsten Lester wrote:
>
> What would be the fastest way to go about searching for a filename on a
> hard drive? For instance, I need to find all instances of "normal.dot"
> on a person's hard drive.
>
> Also, how do I check a user's operating system? I want to use dir95(),
> but I have users who are in DOS6.x or older/Windows 3.1 and dir95() is
> apparently not compatible with the older Windows/DOS systems.
>
Partial answer for second question:
this gets the version of DOS - if it's >= 7, then it's Win 95-98, right?

--------------------------------------------------------------------------
-- DosVer
--
-- Author   : Daniel Berstein <daber at pair.com>
--
-- Date     : June 8, 1998
--
-- Status   : Freeware
--
-- Thanks   : Jacques Deschenes, some portions copied from doswrap.e
--
--------------------------------------------------------------------------

-------------------------
global function dosver()
-------------------------
    sequence reg_list
    reg_list = repeat(0,10)
    reg_list[REG_AX] = #3000
    reg_list = dos_interrupt(#21,reg_list)
    return remainder(reg_list[REG_AX],256) +
floor(reg_list[REG_AX]/256)/100
end function

------------------------
-- MAIN        test stub
------------------------
print(1,dosver())

Regards,
Irv
http://www.mindspring.com/~mountains -- New Euphoria DOS GUI "thingie"
there now.

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

3. A Few Questions

Howdy, fellows and femmes...

I've got a few questions I hope someone can answer:

1. Using EXW and Win32Lib, how do I get the current screen resolution?
I'm looking for width and depth...
2. How do I apply strikethrough formatting to selected text?
3. Where are the key/input handlers for Win32Lib? I want to make the
<DELETE> and <BACKSPACE> keys add strikethrough to text instead of
deleting the text...

Thanks in advance!
ck

P.S. I'm printing out and reading the Win32Lib docs right now... so I
might find answers there... however, deeper insight from learned
EUPHORIA scholars is most appreciated! smile

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

4. Re: A Few Questions

C & K L wrote:

> Using EXW and Win32Lib, how do I get the current screen resolution?

Use GetDeviceCaps. Here's a wrapper that should work:

   function getDeviceCaps( integer id, integer parm )

      atom hDC, result

      -- get the device context of the window
      hDC = getDC( id )

      -- call GetDeviceCaps
      result = c_func( xGetDeviceCaps, { hDC, parm } )

      -- release the device context
      releaseDC( id )

      -- return the result
      return result

   end function


> I'm looking for width and depth...

The parameters are defined in Win32Lib. Try:

   width = getDeviceCaps( 0, HORZRES )
   depth = getDeviceCaps( 0, VERTRES )

Note that an id of zero refers to the *screen*.


> How do I apply strikethrough formatting to selected text?

Use the Strikeout attribute. The bad news is that if you want to mix text
styles from within a control, you'll have to end up writing your own MLE
control. I've started work on a Win32Lib editor, but I'm taking a coding
break for right now.

> Where are the key/input handlers for Win32Lib? I want to make the
> <DELETE> and <BACKSPACE> keys add strikethrough to text instead of
> deleting the text...

There are three key handlers:

   onKeyPress
   onKeyUp
   onKeyDown

Non-printing keys are filtered out of onKeyPress, so you have to use
onKeyUp/onKeyDown to trap your "special" keys. These keys are defined as
VK_DELETE and VK_BACK.

Hope this helps!

-- David Cuny

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

5. Re: A Few Questions

Thanks, David.

I've only recently started getting into the Windows-side of EUPHORIA
programming, and your Win32Lib is impressive... but I'm sure you already
knew that.

When will the final version be made available? And (here's the important
question), how much is it going to cost? blink

Thanks, again!
ck


"Cuny, David" wrote:
>
> C & K L wrote:
>
> > Using EXW and Win32Lib, how do I get the current screen resolution?
>
> Use GetDeviceCaps. Here's a wrapper that should work:
>
>    function getDeviceCaps( integer id, integer parm )
>
>       atom hDC, result
>
>       -- get the device context of the window
>       hDC = getDC( id )
>
>       -- call GetDeviceCaps
>       result = c_func( xGetDeviceCaps, { hDC, parm } )
>
>       -- release the device context
>       releaseDC( id )
>
>       -- return the result
>       return result
>
>    end function
>
> > I'm looking for width and depth...
>
> The parameters are defined in Win32Lib. Try:
>
>    width = getDeviceCaps( 0, HORZRES )
>    depth = getDeviceCaps( 0, VERTRES )
>
> Note that an id of zero refers to the *screen*.
>
> > How do I apply strikethrough formatting to selected text?
>
> Use the Strikeout attribute. The bad news is that if you want to mix text
> styles from within a control, you'll have to end up writing your own MLE
> control. I've started work on a Win32Lib editor, but I'm taking a coding
> break for right now.
>
> > Where are the key/input handlers for Win32Lib? I want to make the
> > <DELETE> and <BACKSPACE> keys add strikethrough to text instead of
> > deleting the text...
>
> There are three key handlers:
>
>    onKeyPress
>    onKeyUp
>    onKeyDown
>
> Non-printing keys are filtered out of onKeyPress, so you have to use
> onKeyUp/onKeyDown to trap your "special" keys. These keys are defined as
> VK_DELETE and VK_BACK.
>
> Hope this helps!
>
> -- David Cuny

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

6. Re: A Few Questions

On Wed, 29 Jul 1998, C.K. & Kirsten Lester wrote:

> What would be the fastest way to go about searching for a filename on a
> hard drive? For instance, I need to find all instances of "normal.dot"
> on a person's hard drive.

In DOS :
    dir /b /s [Drive:]\

It's a little more difficult in Euphoria, as dir() and other third party
functions only return current directory.

I'd suggest:

include file.e
constant Tempfile = "~eu.tmp"
sequence oldpwd
integer handle
:
:
oldpwd = current_dir()
system("cd \",2)
system("dir /b /s > " & Tempfile, 2)
handle = open(Tempfile, "r")
    -- Do your checking here...
    :
    :
close(handle)
:
:

--
Carl R White
E-mail...: cyrek- at -bigfoot.com              / Remove the hyphens before
Finger...: crwhite- at -dcsun1.comp.brad.ac.uk \ mailing or fingering...
Url......: http://www.bigfoot.com/~cyrek/

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

7. Re: A Few Questions

Carl, thanks for the suggestion!

Carl R. White wrote:
>
> On Wed, 29 Jul 1998, C.K. & Kirsten Lester wrote:
>
> > What would be the fastest way to go about searching for a filename on a
> > hard drive? For instance, I need to find all instances of "normal.dot"
> > on a person's hard drive.
>
> In DOS :
>     dir /b /s [Drive:]\
>
> It's a little more difficult in Euphoria, as dir() and other third party
> functions only return current directory.
>
> I'd suggest:
>
> include file.e
> constant Tempfile = "~eu.tmp"
> sequence oldpwd
> integer handle
> :
> :
> oldpwd = current_dir()
> system("cd \",2)
> system("dir /b /s > " & Tempfile, 2)
> handle = open(Tempfile, "r")
>     -- Do your checking here...
>     :
>     :
> close(handle)
> :
> :
>
> --
> Carl R White
> E-mail...: cyrek- at -bigfoot.com              / Remove the hyphens before
> Finger...: crwhite- at -dcsun1.comp.brad.ac.uk \ mailing or fingering...
> Url......: http://www.bigfoot.com/~cyrek/

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

Search



Quick Links

User menu

Not signed in.

Misc Menu