Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

PC Uptime

 [1/10] from: ptretter::charter::net at: 1-Aug-2002 13:26


I have been playing more with /PRO. Gotta admit, it gives you quite a bit more power than /core and /view. Here is a little PC Uptime monitor for you /PRO users. Use at your own risk! REBOL [ Title: "PC Uptime Monitor" Author: "Paul Tretter" ] libfile: %kernel32.dll getcount: "GetTickCount" clib: load/library libfile uptime: make routine! ["Return Uptime" return: [long]] clib getcount print ["PC has been up for " uptime / 1000 / 60 " minutes"] Have fun! Paul Tretter

 [2/10] from: greggirwin:mindspring at: 1-Aug-2002 13:00


Good one Paul! Often times, I'll use a routine name that emulates the API call and then wrap functions around them that translate values to more rebol friendly datatypes and values. E.g. lib: load/library %kernel32.dll get-tick-count: make routine! [return: [integer!]] lib "GetTickCount" up-time: does [to time! divide get-tick-count 1000] print up-time --Gregg

 [3/10] from: ptretter:charter at: 1-Aug-2002 14:17


Heres a link to a url for creating a BEEP! However, I'm new to library functions and havent yet got this one to work on win2k. Anyone else want to try. http://216.26.168.92/vbapi/ref/b/beep.html Paul Tretter

 [4/10] from: greggirwin:mindspring at: 1-Aug-2002 13:54


Hi Paul, This works on W2K. I think the behavior is different on different versions of Windows. lib: load/library %kernel32.dll beep: make routine! [ frequency [integer!] duration [integer!] return: [integer!] ] lib "Beep" beep 500 1000 --Gregg

 [5/10] from: ptretter:charter at: 1-Aug-2002 16:22


Ahhh cool! Paul Tretter

 [6/10] from: atruter:hih:au at: 2-Aug-2002 9:12


While we are on the subject of using Windows calls to do fancy stuff . . . anyone tried "wrapping" the DC (Device Context?), SetPixel and FreeDC routines to enable direct pixel manipulation. I don't know enough about the Windows API set myself but was told by a C programmer type that these three would be a good start for fast drawing on large faces. Comments? Regards, Ashley

 [7/10] from: anton:lexicon at: 2-Aug-2002 10:53


How do we get a pointer to the rebol window frame buffer from rebol? I don't think there is a way in rebol. However, that sparks an idea. You can probably open your own "windows" window, then you can find the pointer to its frame buffer. Anton.

 [8/10] from: cyphre:seznam:cz at: 2-Aug-2002 10:38


Hi all, There is a way how to "draw" directly into Rebol's face image using dll calls....I did a library wrapper for reading/writing/showing more than 200 image formats using xnview library...I'll release it soon. I think using this method we could even for show Direct3D/OpenGL.... output embedded in Rebol gui. regards, Cyphre

 [9/10] from: anton:lexicon at: 2-Aug-2002 20:38


Good! How portable is OpenGL ? I got interested in SDL - Simple DirectMedia Layer http://www.libsdl.org/intro/toc.html SDL is a free cross-platform multi-media development API . It's currently ported to Linux Win32 BeOS MacOS, MacOS/X but I only did some simple tests to see if I could call a routine! I wanted to use SDL for graphics. I'll probably get back into it some time, so then I'd be very interested how you got the pointer to the face frame buffer. Anton.

 [10/10] from: chris:langreiter at: 2-Aug-2002 15:05


> There is a way how to "draw" directly into Rebol's face image using dll > calls....I did a library wrapper for reading/writing/showing more than 200 > image formats using xnview library...I'll release it soon. I think using > this method we could even for show Direct3D/OpenGL.... output embedded in > Rebol gui.
If that really works (which I don't doubt ;-), then - WOW! This is the most amazing REBOL news I've read in weeks. Best regards, -- Chris