[#96321] parent of TrueClass, FalseClass — "Ara.T.Howard" <Ara.T.Howard@...>

19 messages 2004/04/01
[#96356] Re: parent of TrueClass, FalseClass — matz@... (Yukihiro Matsumoto) 2004/04/02

Hi,

[#96404] Variable names — David King Landrith <dlandrith@...>

About a year ago, I wrote a simple type enforcement library that adds a

33 messages 2004/04/02
[#96406] Re: Variable names — ts <decoux@...> 2004/04/02

>>>>> "D" == David King Landrith <dlandrith@mac.com> writes:

[#96424] Re: Variable names — David King Landrith <dlandrith@...> 2004/04/02

[#96430] Re: Variable names — Dan Doel <djd15@...> 2004/04/02

On Friday 02 April 2004 2:43 pm, David King Landrith wrote:

[#96432] Re: Variable names — David King Landrith <dlandrith@...> 2004/04/02

On Apr 2, 2004, at 3:51 PM, Dan Doel wrote:

[#96447] Learning Ruby, was a C geek... — Nicholas Paul Johnson <nickjohnson@...>

Hello all,

17 messages 2004/04/02

[#96634] Where does the name Rite come from? — Michael Neumann <mneumann@...>

Hi,

15 messages 2004/04/06
[#96642] Re: Where does the name Rite come from? — matz@... (Yukihiro Matsumoto) 2004/04/06

Hi,

[#96652] Re: Where does the name Rite come from? — Eric Hodel <drbrain@...7.net> 2004/04/06

Yukihiro Matsumoto (matz@ruby-lang.org) wrote:

[#96697] Idea: Simplified GTK — Hal Fulton <hal9000@...>

Here's an idea. I've begun implementing it.

74 messages 2004/04/07
[#96699] Re: Idea: Simplified GTK — Chad Fowler <chad@...> 2004/04/07

[#96876] RedCloth bug and suggestion — Jim Menard <jimm@...>

_why_ and fellow RedCloth users,

15 messages 2004/04/09

[#96877] Instiki 0.3.0: Before the Storm — David Heinemeier Hansson <david@...>

What's new in Instiki 0.3.0?

12 messages 2004/04/09

[#97020] test / unit question: facility to mark some tests as "missing" or "incomplete" — "Its Me" <itsme213@...>

I often find myself with some unit tests that run, and several more test

14 messages 2004/04/12

[#97077] Instiki 0.5.0: Getting Serious — David Heinemeier Hansson <david@...>

What's new in Instiki 0.5.0?

16 messages 2004/04/13

[#97083] New Ruby questions... — Jeff Massung <jma@...>

I've just started Ruby a couple days ago (man this is cool). Coming from

14 messages 2004/04/13

[#97109] New Local Variable Scope rule — "Shashank Date" <sdate@...>

In one of Matz's slides at RubyConf ,

33 messages 2004/04/14

[#97134] BlueCloth: a Markdown implementation for Ruby — Michael Granger <ged@...>

Hi all,

17 messages 2004/04/14

[#97201] File locking, portably? — Hugh Sasse Staff Elec Eng <hgs@...>

Searching the web and books for information on this, I can't seem to

12 messages 2004/04/14

[#97277] Hash, ==, key-value comparison — walter@...

Ok,

20 messages 2004/04/15

[#97308] Instiki 0.6.0: Feeds, Exports, Safety, and Compatibility — David Heinemeier Hansson <david@...>

What's new in Instiki 0.6.0?

14 messages 2004/04/15

[#97351] "bad file descriptor" in Win32 DLL — "Christian Kaiser" <chk@...>

Using Ruby 1.81, the DLL (msvcrt-ruby18.dll) sometimes raises an exception

14 messages 2004/04/16

[#97363] BlueCloth 0.0.2 (beta) — Michael Granger <ged@...>

Hi,

18 messages 2004/04/16
[#97399] BlueCloth on Instiki (was Re: [ANN] BlueCloth 0.0.2 (beta)) — David Heinemeier Hansson <david@...> 2004/04/16

> Thanks to all of you that have offered your suggestions and code. I

[#97405] RubyConf 2004 — Ian Macdonald <ian@...>

Hello,

46 messages 2004/04/17
[#97409] Re: RubyConf 2004 — Chad Fowler <chad@...> 2004/04/17

[#97460] Re: RubyConf 2004 — Paul Duncan <pabs@...> 2004/04/17

* Chad Fowler (chad@chadfowler.com) wrote:

[#97465] Re: RubyConf 2004 — Hal Fulton <hal9000@...> 2004/04/17

Paul Duncan wrote:

[#97466] Re: RubyConf 2004 — Chad Fowler <chad@...> 2004/04/17

[#97486] Ruby Installer for Windows 1.8.1-12 — "Curt Hibbs" <curt@...> 2004/04/18

The Ruby Installer 1.8.1-12 for Windows has been released and is now

[#97418] Objects in perl6 (rubyish :) — gabriele renzi <surrender_it@...1.vip.ukl.yahoo.com>

Hi gurus and nubys,

20 messages 2004/04/17

[#97426] $0 is messed up — Simon Strandgaard <neoneye@...>

I have just upgraded to 1.9 16-apr-2004 from 1.9 7-apr-2004.

15 messages 2004/04/17

[#97473] convert yield to proc — Simon Strandgaard <neoneye@...>

How do you guys convert yield to block ?

21 messages 2004/04/18

[#97565] Gateway — "Robert Klemme" <bob.news@...>

34 messages 2004/04/19

[#97628] Instiki 0.7.0: Flavors of Expression — David Heinemeier Hansson <david@...>

What's new in Instiki 0.7.0?

15 messages 2004/04/19

[#97631] proposal: call_up() for use in redefined methods — Mark Hubbart <discord@...>

Hi all,

18 messages 2004/04/19

[#97640] Fox --> GTK ? — Hal Fulton <hal9000@...>

Who has experience converting Fox to GTK and might like to

29 messages 2004/04/19

[#97705] The quest for opensource database... — "Ruby Tuesdays" <NoSpamPlease_rubytuzdaiz@...>

Perhaps you database guru able to suggest what would be a good choice for

35 messages 2004/04/20

[#97743] Setting up a wiki when you don't have root — ptkwt@... (Phil Tomson)

12 messages 2004/04/20

[#97785] Creating bang methods — "Jon Hurst" <jon@...>

(newbie) I can't for my life figure out how to create bang methods. Please

20 messages 2004/04/21

[#97797] rexml: how to get element type? — "Its Me" <itsme213@...>

doc = REXML::Document.new <<EOF

14 messages 2004/04/21

[#97808] binding - how to get current script? — Szymon Drejewicz <drejewic@...>

18 messages 2004/04/21

[#97866] Is Ruby is better than PHP ... — "Useko Netsumi" <usenets_remote_this@...>

or perhaps Java for developing web application?

46 messages 2004/04/21

[#97873] Re: how to get ri/rdoc working for 1.8.1 on Windows? — "John W. Kennedy" <jwkenne@...>

Part 1 is to chdir \Ruby\bin and delete the five *.bat files

41 messages 2004/04/21
[#97910] Re: how to get ri/rdoc working for 1.8.1 on Windows? — "Its Me" <itsme213@...> 2004/04/21

[#97964] Re: how to get ri/rdoc working for [user-installed libraries] — Gavin Sinclair <gsinclair@...> 2004/04/21

On Thursday, April 22, 2004, 4:44:09 AM, Its wrote:

[#97984] Re: how to get ri/rdoc working for [user-installed libraries] — Dave Thomas <dave@...> 2004/04/22

[#98000] Re: how to get ri/rdoc working for [user-installed libraries] — "Gavin Sinclair" <gsinclair@...> 2004/04/22

>

[#97926] Re: how to get ri/rdoc working for 1.8.1 on Windows? — Lothar Scholz <mailinglists@...> 2004/04/21

Hello John,

[#97936] Re: how to get ri/rdoc working for 1.8.1 on Windows? — Dave Thomas <dave@...> 2004/04/21

[#97971] Re: how to get ri/rdoc working for 1.8.1 on Windows? — Jos Backus <jos@...> 2004/04/21

On Thu, Apr 22, 2004 at 05:50:40AM +0900, Dave Thomas wrote:

[#97985] Re: how to get ri/rdoc working for 1.8.1 on Windows? — Dave Thomas <dave@...> 2004/04/22

[#97997] RedCloth 2.0.7 -- A Textile Humane Web Text Generator — why the lucky stiff <ruby-talk@...>

more and more, you've seen it all before (i swear it's slowin down):

12 messages 2004/04/22
[#98008] Re: [ANN] RedCloth 2.0.7 -- A Textile Humane Web Text Generator — David Heinemeier Hansson <david@...> 2004/04/22

> I've wanted this feature to work right for awhile. It took a rewrite

[#98101] Extract all occurences from a text — Michael Weller <michael@...>

Hi!

11 messages 2004/04/23

[#98135] Problem assigning an Array object to an Array-subclass object — "Richard Lionheart" <NoOne@...>

[ I apologize if this is a second post. My earlier one seems to have gotten

29 messages 2004/04/23

[#98177] Psyco — Jim Moy <web@...>

Interesting stuff for Python, is any work like this being done in Ruby?

14 messages 2004/04/23

[#98181] Playing with sockets... — Hal Fulton <hal9000@...>

I'm writing a little expect-like piece of code and trying to test it

16 messages 2004/04/23

[#98281] String#unpack and null-terminated strings — Michael Neumann <mneumann@...>

Hi,

15 messages 2004/04/24

[#98362] How's ruby compare to it older brother python — "Hunn E. Balsiche" <hunnebal@...>

in term of its OO features, syntax consistencies, ease of use, and their

51 messages 2004/04/26
[#98597] Re: How's ruby compare to it older brother python — "Ken Hilton" <kenosis@...> 2004/04/28

Amen, brother.

[#98778] Re: How's ruby compare to it older brother python — "trevor andrade" <trevor.andrade@...> 2004/04/30

I agree that flaming the question is not appropriate and its also bad for

[#98789] Re: How's ruby compare to it older brother python — Dan Doel <djd15@...> 2004/04/30

I'm not saying the topic isn't appropriate. I don't mind the topic, and I find

[#98365] Introducing myself - Sascha Ebach — Sascha Ebach <se@...>

Hello dear Rubyists,

51 messages 2004/04/26
[#98568] Re: Introducing myself - Sascha Ebach — "Josef 'Jupp' Schugt" <jupp@...> 2004/04/27

Hello from Beethoven's home town,

[#98569] Re: Introducing myself - Sascha Ebach — Sascha Ebach <se@...> 2004/04/27

Hello Jupp

[#98570] Re: Introducing myself - Sascha Ebach — Simon Strandgaard <neoneye@...> 2004/04/27

Sascha Ebach <se@hexatex.de> wrote:

[#98753] Re: Introducing myself - Sascha Ebach — "Josef 'Jupp' Schugt" <jupp@...> 2004/04/29

Simon Strandgaard wrote:

[#98762] Re: Introducing myself - Sascha Ebach — Simon Strandgaard <neoneye@...> 2004/04/29

Josef 'Jupp' Schugt <jupp@gmx.de> wrote:

[#98817] Opportunities and pitfalls; was "Introducing myself - Sascha Ebach" — Mike Calder <ceo@...> 2004/04/30

A word of warning from a potential friend. Please don't take this negatively,

[#98847] Re: Opportunities and pitfalls; was "Introducing myself - Sascha Ebach" — Mark Hubbart <discord@...> 2004/04/30

[#98854] Re: Opportunities and pitfalls; was "Introducing myself - Sascha Ebach" — "Curt Hibbs" <curt@...> 2004/04/30

Mark Hubbart wrote:

[#98858] Re: Opportunities and pitfalls; was "Introducing myself - Sascha Ebach" — Mark Hubbart <discord@...> 2004/04/30

[#98366] How do I scale large Ruby web applications? — Sascha Ebach <se@...>

Hi there,

19 messages 2004/04/26

[#98409] Semantics of Multiple Values — Kristof Bastiaensen <kristof@...>

Hi liszt,

25 messages 2004/04/26

[#98435] Approaches to localization? — ptkwt@... (Phil Tomson)

I'm developing a GUI app using Ruby and FLTK. One of the requirements

22 messages 2004/04/26

[#98714] Ruby under Suse Linux — Mike Calder <ceo@...>

Hi.

14 messages 2004/04/29

[#98750] coerce(), what protocol to implement it — Jean-Hugues ROBERT <jean_hugues_robert@...>

Hi,

14 messages 2004/04/29

[#98758] File.expand_path(__FILE__) — John Platte <john.platte@...>

I'm having a problem with File.expand_path(__FILE__) after a chdir.

30 messages 2004/04/29

[#98796] SciTE Ruby Lexer — Kaspar Schiess <eule@...>

-----BEGIN PGP SIGNED MESSAGE-----

13 messages 2004/04/30

[#98820] ruby CVS can't use shared libs on NetBSD — Dick Davies <rasputnik@...>

11 messages 2004/04/30

[#98832] def [](v) xx; return yy; end # returned value is ignored !? — Jean-Hugues ROBERT <jean_hugues_robert@...>

Hi,

27 messages 2004/04/30

[#98851] Lazy evaluation — Michael Neumann <mneumann@...>

Hi,

51 messages 2004/04/30
[#98871] Re: Lazy evaluation — Jean-Hugues ROBERT <jean_hugues_robert@...> 2004/04/30

At 03:45 01/05/2004 +0900, you wrote:

[#98875] Re: Lazy evaluation — Florian Gross <flgr@...> 2004/04/30

Jean-Hugues ROBERT wrote:

[#98896] Re: Lazy evaluation (evil) — ptkwt@... (Phil Tomson) 2004/05/01

In article <c6uh31$gaq2i$1@ID-7468.news.uni-berlin.de>,

[#98913] Re: Lazy evaluation (evil) — Florian Gross <flgr@...> 2004/05/01

Phil Tomson wrote:

[#98917] Re: Lazy evaluation (evil) — ts <decoux@...> 2004/05/01

>>>>> "F" == Florian Gross <flgr@ccan.de> writes:

[#98919] Re: Lazy evaluation (evil) — Florian Gross <flgr@...> 2004/05/01

ts wrote:

Re: win32api find display size

From: "Allen Mitchell" <ajm@...>
Date: 2004-04-12 14:48:10 UTC
List: ruby-talk #97010
Try the following code using the system module below

w,h = System.screenSize



# SYSTEM

module System

	@getUserName 			= Win32API.new("advapi32", 	"GetUserName", 			['P','P'],
'L')
	@getComputerName 	= Win32API.new("kernel32", 	"GetComputerName",
['P','P'], 	'L')
	@getLastError			= Win32API.new("kernel32", 	"GetLastError", 		[], 				'L')
	@getSystemTime		= Win32API.new("kernel32", 	"GetSystemTime", 		['P'],
'V')
	@setSystemTime		= Win32API.new("kernel32", 	"SetSystemTime", 		['P'],
'V')
  @ods              = Win32API.new("kernel32", "OutputDebugString", ['P'],
'V' )
  @shellExecute	    = Win32API.new("shell32", "ShellExecute",
['L','P','P','P','P','L'], 	'L')
	@getSystemMetrics = Win32API.new("user32", 		"GetSystemMetrics", ['I'],
'I')

	def getUserName

		# 1. Reserve lots of space
		buffer = " "*1000

		# 2. Convert the length
		len = [buffer.length].pack('L')

		# 3. Make the call
		if( @getUserName.call( buffer, len ) == 1 )

			# 4. return computer name if successful
			return buffer[0,len.unpack('L')[0]-1]

		end

		# 5. otherwise return empty string
		""

	end
  module_function :getUserName

	def getSystemTime

		# 1. Allocate space for a SYSTEMTIME structure
		systemtime = " "*16

		# 2. Execute the function
		@getSystemTime.call( systemtime )

		# 3. unpack back to ruby stuff
		yr,mn,dw,dm,hr,mnt,sec,ms = systemtime.unpack('ssssssss')

		# 4. and return a gm time based on the values
		Time.gm(yr,mn,dm,hr,mnt,sec,ms)

	end
  module_function :getSystemTime

	def setSystemTime ( tm )

		raise ArgumentError if !tm.instance_of?(Time)

		# 1. Conver the time to GMT
		gmt = tm.gmtime

		# 2. Build a SYSTEMTIME structure
		systemtime = [gmt.year,gmt.month,gmt.wday,gmt.day,
gmt.hour,gmt.min,gmt.sec,gmt.usec].pack('ssssssss')

		# 3. And call the OS
		@setSystemTime.call( systemtime )

	end
  module_function :setSystemTime


	def getComputerName

		# 1. Reserve lots of space
		buffer = " "*1000

		# 2. Convert the length
		len = [buffer.length].pack('L')

		# 3. make the call
		if( @getComputerName.call( buffer, len ) == 1 )

			# 4. return name if successful
			return buffer[0,len.unpack('L')[0]]
		end

		# 5. otherwise return empty string
		""

	end
  module_function :getComputerName

	def getLastError

		# this one is easy
		@getLastError.call

	end
  module_function :getLastError

	def shellExecute ( p1, p2, p3, p4, show=3 )

    @shellExecute.call(0,p1,p2,p3,p4,show)

	end
  module_function :shellExecute

	def ods ( msg )
    @ods.call(msg)
	end
  module_function :ods

	#------------------------------------------------------------
	# setup constants for system metrics
	# see windows docs for explanation of values
	# in GetSystemMetrics
	#------------------------------------------------------------
	SM_CXSCREEN        		=      0
	SM_CYSCREEN        		=      1
	SM_CXVSCROLL       		=      2
	SM_CYHSCROLL       		=      3
	SM_CYCAPTION       		=      4
	SM_CXBORDER        		=      5
	SM_CYBORDER        		=      6
	SM_CXDLGFRAME      		=      7
	SM_CYDLGFRAME      		=      8
	SM_CYVTHUMB        		=      9
	SM_CXHTHUMB        		=     10
	SM_CXICON          		=     11
	SM_CYICON          		=     12
	SM_CXCURSOR        		=     13
	SM_CYCURSOR        		=     14
	SM_CYMENU          		=     15
	SM_CXFULLSCREEN    		=     16
	SM_CYFULLSCREEN    		=     17
	SM_CYKANJIWINDOW   		=     18
	SM_MOUSEPRESENT    		=     19
	SM_CYVSCROLL       		=     20
	SM_CXHSCROLL       		=     21
	SM_DEBUG           		=     22
	SM_SWAPBUTTON      		=     23
	SM_RESERVED1       		=     24
	SM_RESERVED2       		=     25
	SM_RESERVED3       		=     26
	SM_RESERVED4       		=     27
	SM_CXMIN           		=     28
	SM_CYMIN           		=     29
	SM_CXSIZE          		=     30
	SM_CYSIZE          		=     31
	SM_CXFRAME         		=     32
	SM_CYFRAME         		=     33
	SM_CXMINTRACK      		=     34
	SM_CYMINTRACK      		=     35
	SM_CXDOUBLECLK     		=     36
	SM_CYDOUBLECLK     		=     37
	SM_CXICONSPACING   		=     38
	SM_CYICONSPACING   		=     39
	SM_MENUDROPALIGNMENT	=     40
	SM_PENWINDOWS       	=     41
	SM_DBCSENABLED      	=     42
	SM_CMOUSEBUTTONS    	=     43
	SM_CXFIXEDFRAME     	=     SM_CXDLGFRAME
	SM_CYFIXEDFRAME     	=     SM_CYDLGFRAME
	SM_CXSIZEFRAME     		=     SM_CXFRAME
	SM_CYSIZEFRAME      	=     SM_CYFRAME
	SM_SECURE           	=    	44
	SM_CXEDGE           	=    	45
	SM_CYEDGE           	=    	46
	SM_CXMINSPACING     	=    	47
	SM_CYMINSPACING     	=    	48
	SM_CXSMICON         	=    	49
	SM_CYSMICON         	=    	50
	SM_CYSMCAPTION      	=    	51
	SM_CXSMSIZE         	=    	52
	SM_CYSMSIZE         	=    	53
	SM_CXMENUSIZE       	=    	54
	SM_CYMENUSIZE       	=    	55
	SM_ARRANGE          	=    	56
	SM_CXMINIMIZED      	=    	57
	SM_CYMINIMIZED      	=    	58
	SM_CXMAXTRACK       	=    	59
	SM_CYMAXTRACK       	=    	60
	SM_CXMAXIMIZED      	=    	61
	SM_CYMAXIMIZED      	=    	62
	SM_NETWORK          	=    	63
	SM_CLEANBOOT        	=    	67
	SM_CXDRAG           	=    	68
	SM_CYDRAG           	=    	69
	SM_SHOWSOUNDS       	=    	70
	SM_CXMENUCHECK      	=    	71
	SM_CYMENUCHECK      	=    	72
	SM_SLOWMACHINE      	=    	73
	SM_MIDEASTENABLED   	=    	74
	SM_MOUSEWHEELPRESENT	=    	75
	SM_XVIRTUALSCREEN   	=    	76
	SM_YVIRTUALSCREEN   	=    	77
	SM_CXVIRTUALSCREEN  	=    	78
	SM_CYVIRTUALSCREEN  	=    	79
	SM_CMONITORS        	=    	80
	SM_SAMEDISPLAYFORMAT	=   	81

	def getSystemMetrics ( value )
		@getSystemMetrics.call(value)
	end
  module_function :getSystemMetrics

  def screenWidth
    getSystemMetrics(SM_CXSCREEN)
  end
  module_function :screenWidth

  def screenHeight
    getSystemMetrics(SM_CYSCREEN)
  end
  module_function :screenHeight

  def isMouseInstalled?
    numMouseButtons > 0
  end
  module_function :isMouseInstalled?

  def numMouseButtons
    getSystemMetrics(SM_CMOUSEBUTTONS)
  end
  module_function :numMouseButtons

  def screenSize
    [ getSystemMetrics(SM_CXSCREEN), getSystemMetrics(SM_CYSCREEN) ]
  end
  module_function :screenSize

  def borderSize
    [ getSystemMetrics(SM_CXBORDER), getSystemMetrics(SM_CYBORDER) ]
  end
  module_function :borderSize

  def cursorSize
    [ getSystemMetrics(SM_CXCURSOR), getSystemMetrics(SM_CYCURSOR) ]
  end
  module_function :cursorSize

  def iconSize
    [ getSystemMetrics(SM_CXICON), getSystemMetrics(SM_CXICON) ]
  end
  module_function :iconSize

end

-----Original Message-----
From: Michael Hale [mailto:michael@halefamilysite.com]
Sent: April 12, 2004 11:32 AM
To: ruby-talk ML
Subject: win32api find display size







In This Thread