From djberg96 at yahoo.com Tue Apr 19 21:43:53 2005 From: djberg96 at yahoo.com (Daniel Berger) Date: Tue Apr 19 21:38:08 2005 Subject: [Win32utils-devel] Bug 1806 Message-ID: <20050420014353.35005.qmail@web50304.mail.yahoo.com> Hi all, I'm trying to get new tracker items to automatically send an email to this list, so I may run a couple of tests this week. You can ignore them. Heesob, can you please take a look at Bug 1806? I'm not sure if it's possible or not, but it seems like a reasonable idea if it is. Regards, Dan __________________________________ Do you Yahoo!? Plan great trips with Yahoo! Travel: Now over 17,000 guides! http://travel.yahoo.com/p-travelguide From phasis at nownuri.net Wed Apr 20 09:36:44 2005 From: phasis at nownuri.net (Park Heesob) Date: Wed Apr 20 09:30:54 2005 Subject: [Win32utils-devel] Bug 1806 References: <20050420014353.35005.qmail@web50304.mail.yahoo.com> Message-ID: <004101c545ad$fe613790$fa0d5bd2@2xnm9896kmqn5b9> Hi, > Hi all, > > I'm trying to get new tracker items to automatically > send an email to this list, so I may run a couple of > tests this week. You can ignore them. > > Heesob, can you please take a look at Bug 1806? I'm > not sure if it's possible or not, but it seems like a > reasonable idea if it is. > I committed the bug fixed version of changenotify. Now it returns array of struct. > Regards, > > Dan > Regards, Park Heesob From noreply at rubyforge.org Wed Apr 20 19:54:54 2005 From: noreply at rubyforge.org (noreply@rubyforge.org) Date: Thu Apr 21 00:37:43 2005 Subject: [Win32utils-devel] [ win32utils-Support Requests-1813 ] Merely a test Message-ID: <200504202354.j3KNssgu028123@rubyforge.org> Support Requests item #1813, was opened at 2005-04-20 23:48 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=412&aid=1813&group_id=85 Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Tom Copeland (tom) Assigned to: Nobody (None) Summary: Merely a test Initial Comment: Hm, did this go to to win32utils-devel? Tom ---------------------------------------------------------------------- >Comment By: Tom Copeland (tom) Date: 2005-04-20 23:54 Message: Logged In: YES user_id=102 Another test after manually subscribing "noreply@rubyforge.org". Tom ---------------------------------------------------------------------- Comment By: Tom Copeland (tom) Date: 2005-04-20 23:53 Message: Logged In: YES user_id=102 And from mailman: Apr 20 19:48:28 2005 (7712) smtp for 1 recips, completed in 0.043 seconds Apr 20 19:51:28 2005 (7712) smtp for 1 recips, completed in 0.168 seconds Hm... that looks fine.... Tom ---------------------------------------------------------------------- Comment By: Tom Copeland (tom) Date: 2005-04-20 23:51 Message: Logged In: YES user_id=102 Hm. The maillog made some noises like a msg was being sent: Apr 20 23:48:27 rubyforge sendmail[27921]: j3KNmRfu027921: Authentication-Warning: rubyforge.org: webuser set sender to noreply@rubyforge.org using -f Apr 20 23:48:27 rubyforge sendmail[27921]: j3KNmRfu027921: from=noreply@rubyforge.org, size=754, class=0, nrcpts=2, msgid=<200504202348.j3KNmRfu027921@rubyforge.org>, relay=webuser@localhost Apr 20 19:48:27 rubyforge sendmail[27923]: j3KNmRdS027923: from=, size=1028, class=0, nrcpts=2, msgid=<200504202348.j3KNmRfu027921@rubyforge.org>, proto=ESMTP, daemon=MTA, relay=localhost.localdomain [127.0.0.1] Apr 20 23:48:27 rubyforge sendmail[27921]: j3KNmRfu027921: to=win32utils-devel@rubyforge.org,noreply@rubyforge.org, delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=60200, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (j3KNmRdS027923 Message accepted for delivery) Apr 20 19:48:27 rubyforge sendmail[27924]: j3KNmRdS027923: to="|/etc/smrsh/mailman post win32utils-devel", ctladdr= (8/0), delay=00:00:00, xdelay=00:00:00, mailer=prog, pri=61197, dsn=2.0.0, stat=Sent Apr 20 19:48:27 rubyforge sendmail[27924]: j3KNmRdS027923: to=/dev/null, ctladdr= (8/0), delay=00:00:00, xdelay=00:00:00, mailer=*file*, pri=61197, dsn=2.0.0, stat=Sent Apr 20 19:48:28 rubyforge sendmail[27926]: j3KNmSdS027926: from=, size=2291, class=-60, nrcpts=1, msgid=, proto=ESMTP, daemon=MTA, relay=localhost.localdomain [127.0.0.1] Apr 20 19:48:28 rubyforge sendmail[27927]: j3KNmSdS027926: to=/dev/null, ctladdr= (8/0), delay=00:00:00, xdelay=00:00:00, mailer=*file*, pri=140483, dsn=2.0.0, stat=Sent But nothing in the archives... Tom ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=412&aid=1813&group_id=85 From noreply at rubyforge.org Thu Apr 21 00:39:48 2005 From: noreply at rubyforge.org (noreply@rubyforge.org) Date: Thu Apr 21 00:41:03 2005 Subject: [Win32utils-devel] [ win32utils-Support Requests-1813 ] Merely a test Message-ID: <200504210439.j3L4dmPF001546@rubyforge.org> Support Requests item #1813, was opened at 2005-04-20 16:48 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=412&aid=1813&group_id=85 Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Tom Copeland (tom) Assigned to: Nobody (None) Summary: Merely a test Initial Comment: Hm, did this go to to win32utils-devel? Tom ---------------------------------------------------------------------- >Comment By: Daniel Berger (djberg96) Date: 2005-04-20 21:39 Message: Logged In: YES user_id=109 Ok, seems to be working now. Thanks! Dan ---------------------------------------------------------------------- Comment By: Tom Copeland (tom) Date: 2005-04-20 16:54 Message: Logged In: YES user_id=102 Another test after manually subscribing "noreply@rubyforge.org". Tom ---------------------------------------------------------------------- Comment By: Tom Copeland (tom) Date: 2005-04-20 16:53 Message: Logged In: YES user_id=102 And from mailman: Apr 20 19:48:28 2005 (7712) smtp for 1 recips, completed in 0.043 seconds Apr 20 19:51:28 2005 (7712) smtp for 1 recips, completed in 0.168 seconds Hm... that looks fine.... Tom ---------------------------------------------------------------------- Comment By: Tom Copeland (tom) Date: 2005-04-20 16:51 Message: Logged In: YES user_id=102 Hm. The maillog made some noises like a msg was being sent: Apr 20 23:48:27 rubyforge sendmail[27921]: j3KNmRfu027921: Authentication-Warning: rubyforge.org: webuser set sender to noreply@rubyforge.org using -f Apr 20 23:48:27 rubyforge sendmail[27921]: j3KNmRfu027921: from=noreply@rubyforge.org, size=754, class=0, nrcpts=2, msgid=<200504202348.j3KNmRfu027921@rubyforge.org>, relay=webuser@localhost Apr 20 19:48:27 rubyforge sendmail[27923]: j3KNmRdS027923: from=, size=1028, class=0, nrcpts=2, msgid=<200504202348.j3KNmRfu027921@rubyforge.org>, proto=ESMTP, daemon=MTA, relay=localhost.localdomain [127.0.0.1] Apr 20 23:48:27 rubyforge sendmail[27921]: j3KNmRfu027921: to=win32utils-devel@rubyforge.org,noreply@rubyforge.org, delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=60200, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (j3KNmRdS027923 Message accepted for delivery) Apr 20 19:48:27 rubyforge sendmail[27924]: j3KNmRdS027923: to="|/etc/smrsh/mailman post win32utils-devel", ctladdr= (8/0), delay=00:00:00, xdelay=00:00:00, mailer=prog, pri=61197, dsn=2.0.0, stat=Sent Apr 20 19:48:27 rubyforge sendmail[27924]: j3KNmRdS027923: to=/dev/null, ctladdr= (8/0), delay=00:00:00, xdelay=00:00:00, mailer=*file*, pri=61197, dsn=2.0.0, stat=Sent Apr 20 19:48:28 rubyforge sendmail[27926]: j3KNmSdS027926: from=, size=2291, class=-60, nrcpts=1, msgid=, proto=ESMTP, daemon=MTA, relay=localhost.localdomain [127.0.0.1] Apr 20 19:48:28 rubyforge sendmail[27927]: j3KNmSdS027926: to=/dev/null, ctladdr= (8/0), delay=00:00:00, xdelay=00:00:00, mailer=*file*, pri=140483, dsn=2.0.0, stat=Sent But nothing in the archives... Tom ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=412&aid=1813&group_id=85 From noreply at rubyforge.org Thu Apr 21 01:00:53 2005 From: noreply at rubyforge.org (noreply@rubyforge.org) Date: Thu Apr 21 01:01:59 2005 Subject: [Win32utils-devel] [ win32utils-Support Requests-1813 ] Merely a test Message-ID: <200504210500.j3L50rJP013432@rubyforge.org> Support Requests item #1813, was opened at 2005-04-20 16:48 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=412&aid=1813&group_id=85 Category: None Group: None >Status: Deleted Resolution: None Priority: 5 Submitted By: Tom Copeland (tom) Assigned to: Nobody (None) Summary: Merely a test Initial Comment: Hm, did this go to to win32utils-devel? Tom ---------------------------------------------------------------------- Comment By: Daniel Berger (djberg96) Date: 2005-04-20 21:39 Message: Logged In: YES user_id=109 Ok, seems to be working now. Thanks! Dan ---------------------------------------------------------------------- Comment By: Tom Copeland (tom) Date: 2005-04-20 16:54 Message: Logged In: YES user_id=102 Another test after manually subscribing "noreply@rubyforge.org". Tom ---------------------------------------------------------------------- Comment By: Tom Copeland (tom) Date: 2005-04-20 16:53 Message: Logged In: YES user_id=102 And from mailman: Apr 20 19:48:28 2005 (7712) smtp for 1 recips, completed in 0.043 seconds Apr 20 19:51:28 2005 (7712) smtp for 1 recips, completed in 0.168 seconds Hm... that looks fine.... Tom ---------------------------------------------------------------------- Comment By: Tom Copeland (tom) Date: 2005-04-20 16:51 Message: Logged In: YES user_id=102 Hm. The maillog made some noises like a msg was being sent: Apr 20 23:48:27 rubyforge sendmail[27921]: j3KNmRfu027921: Authentication-Warning: rubyforge.org: webuser set sender to noreply@rubyforge.org using -f Apr 20 23:48:27 rubyforge sendmail[27921]: j3KNmRfu027921: from=noreply@rubyforge.org, size=754, class=0, nrcpts=2, msgid=<200504202348.j3KNmRfu027921@rubyforge.org>, relay=webuser@localhost Apr 20 19:48:27 rubyforge sendmail[27923]: j3KNmRdS027923: from=, size=1028, class=0, nrcpts=2, msgid=<200504202348.j3KNmRfu027921@rubyforge.org>, proto=ESMTP, daemon=MTA, relay=localhost.localdomain [127.0.0.1] Apr 20 23:48:27 rubyforge sendmail[27921]: j3KNmRfu027921: to=win32utils-devel@rubyforge.org,noreply@rubyforge.org, delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=60200, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (j3KNmRdS027923 Message accepted for delivery) Apr 20 19:48:27 rubyforge sendmail[27924]: j3KNmRdS027923: to="|/etc/smrsh/mailman post win32utils-devel", ctladdr= (8/0), delay=00:00:00, xdelay=00:00:00, mailer=prog, pri=61197, dsn=2.0.0, stat=Sent Apr 20 19:48:27 rubyforge sendmail[27924]: j3KNmRdS027923: to=/dev/null, ctladdr= (8/0), delay=00:00:00, xdelay=00:00:00, mailer=*file*, pri=61197, dsn=2.0.0, stat=Sent Apr 20 19:48:28 rubyforge sendmail[27926]: j3KNmSdS027926: from=, size=2291, class=-60, nrcpts=1, msgid=, proto=ESMTP, daemon=MTA, relay=localhost.localdomain [127.0.0.1] Apr 20 19:48:28 rubyforge sendmail[27927]: j3KNmSdS027926: to=/dev/null, ctladdr= (8/0), delay=00:00:00, xdelay=00:00:00, mailer=*file*, pri=140483, dsn=2.0.0, stat=Sent But nothing in the archives... Tom ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=412&aid=1813&group_id=85 From djberg96 at yahoo.com Thu Apr 21 01:38:23 2005 From: djberg96 at yahoo.com (Daniel Berger) Date: Thu Apr 21 01:32:35 2005 Subject: [Win32utils-devel] win32-changejournal modification Message-ID: <20050421053823.26681.qmail@web50308.mail.yahoo.com> Hi all, Should we make the same change for win32-changejournal that we made for win32-changenotify (i.e yield an array of structs rather than a single struct)? Any objections? Dan __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com From zdennis at mktec.com Thu Apr 21 01:52:45 2005 From: zdennis at mktec.com (Zach Dennis) Date: Thu Apr 21 01:46:56 2005 Subject: [Win32utils-devel] win32-changejournal modification In-Reply-To: <20050421053823.26681.qmail@web50308.mail.yahoo.com> References: <20050421053823.26681.qmail@web50308.mail.yahoo.com> Message-ID: <42673FAD.6040102@mktec.com> Daniel Berger wrote: > Hi all, > > Should we make the same change for win32-changejournal > that we made for win32-changenotify (i.e yield an > array of structs rather than a single struct)? > > Any objections? No objections....but i can't say i know what either of those are off the top of my head... Zach From Daniel.Berger at qwest.com Thu Apr 21 10:44:54 2005 From: Daniel.Berger at qwest.com (Berger, Daniel) Date: Thu Apr 21 10:39:10 2005 Subject: [Win32utils-devel] win32-changejournal modification Message-ID: <8FE83020B9E1A248A182A9B0A7B76E7358B3CC@itomae2km07.AD.QINTRA.COM> > -----Original Message----- > From: win32utils-devel-bounces@rubyforge.org > [mailto:win32utils-devel-bounces@rubyforge.org] On Behalf Of > Zach Dennis > Sent: Wednesday, April 20, 2005 11:53 PM > To: Development and ideas for win32utils projects > Subject: Re: [Win32utils-devel] win32-changejournal modification > > > Daniel Berger wrote: > > Hi all, > > > > Should we make the same change for win32-changejournal > > that we made for win32-changenotify (i.e yield an > > array of structs rather than a single struct)? > > > > Any objections? > > No objections....but i can't say i know what either of those > are off the > top of my head... > > Zach They're directory/file monitors. For example: flags = ChangeNotify::FILE_NAME | ChangeNotify::DIR_NAME flags |= ChangeNotify::LAST_WRITE cn = ChangeNotify.new("c:\\",false,flags) # Wait up to 5 minutes for a notification rv = cn.wait(300){ |arr| arr.each { |s| puts "Something changed" puts "File: " + s.file_name puts "Action: " + s.action } } Every time there's a change to a file or directory under C:\ a notification is sent. In some cases, multiple notifications can occur on a single event, which is why we altered it to yield an array of structs, rather than a single struct. Using the above example, if I change "C:\err.txt" to "C:\foo.txt" I get this: Something changed File: err.txt Action: renamed old name Something changed File: foo.txt Action: renamed new name You can see there we actually got 2 notifications. Previously, you would only have been able to get one. HTH. Dan From zdennis at mktec.com Thu Apr 21 10:55:52 2005 From: zdennis at mktec.com (Zach Dennis) Date: Thu Apr 21 10:49:57 2005 Subject: [Win32utils-devel] win32-changejournal modification In-Reply-To: <8FE83020B9E1A248A182A9B0A7B76E7358B3CC@itomae2km07.AD.QINTRA.COM> References: <8FE83020B9E1A248A182A9B0A7B76E7358B3CC@itomae2km07.AD.QINTRA.COM> Message-ID: <4267BEF8.5030808@mktec.com> Berger, Daniel wrote: > Using the above example, if I > change "C:\err.txt" to "C:\foo.txt" I get this: > > Something changed > File: err.txt > Action: renamed old name > Something changed > File: foo.txt > Action: renamed new name > > You can see there we actually got 2 notifications. Previously, you > would only have been able to get one. Ah, it makes good sense now. I would go for array of structs then, otherwise you might lose something in the shuffle!! Thanks for explaining, Zach From paul.rogers at shaw.ca Thu Apr 21 16:28:43 2005 From: paul.rogers at shaw.ca (Paul Rogers) Date: Thu Apr 21 16:21:43 2005 Subject: [Win32utils-devel] Screen capture, save to file In-Reply-To: <003d01c546af$fdcb08d0$6400a8c0@NewDell> Message-ID: <004201c546b0$b6b4fc70$6400a8c0@NewDell> Is there anything in the utils to capture a screen ( or maybe just a window) and save to a file. I have this, but I have no idea where it came from, but it gives a corrupted image Paul # -*- ruby -*- # screen capture -- # This script runs with a Ruby/DL which is included in ruby-1.7. require 'dl/import' module ScreenCapture extend DL::Importable dlload "kernel32.dll","user32.dll","gdi32.dll" HORZRES = 8 VERTRES = 10 SRCCOPY = 0xCC0020 GMEM_FIXED = 0 GMEM_MOVEABLE = 0x0002 DIB_RGB_COLORS = 0 GHND = 0x40 GPTR = 0x42 typealias "HDC","unsigned long" typealias "HBITMAP","unsigned long" extern "HDC GetWindowDC(int)" extern "HDC CreateCompatibleDC(HDC)" extern "int GetDeviceCaps(HDC, int)" extern "HBITMAP CreateCompatibleBitmap(HDC, int, int)" extern "long SelectObject(HDC, HBITMAP)" extern "long BitBlt(HDC, long, long, long, long, HDC, long, long, long)" extern "void* GlobalAlloc(long, long)" extern "void* GlobalLock(void*)" extern "long GetDIBits(HDC, HBITMAP, long, long, void*, void*, long)" extern "long GlobalUnlock(void*)" extern "long GlobalFree(void*)" extern "long DeleteObject(unsigned long)" extern "long DeleteDC(HDC)" extern "long ReleaseDC(long, HDC)" module_function def screenCapture(filename = "tmp.bmp") hScreenDC = getWindowDC(0) hmemDC = createCompatibleDC(hScreenDC) screenWidth = getDeviceCaps(hScreenDC, HORZRES) screenHeight = getDeviceCaps(hScreenDC, VERTRES) hmemBM = createCompatibleBitmap(hScreenDC, screenWidth, screenHeight) selectObject(hmemDC, hmemBM) printf("width,height = #{screenWidth},#{screenHeight}\n") r = bitBlt(hmemDC, 0, 0, screenWidth, screenHeight, hScreenDC, 0, 0, SRCCOPY) printf("bitBlt : #{r}\n") hpxldata = globalAlloc(GMEM_FIXED, screenWidth * screenHeight * 3) lpvpxldata = globalLock(hpxldata) bmInfo = [ 40, screenWidth, screenHeight, 1, 24, 0, 0, 0, 0, 0, 0, 0].pack('LLLSSLLLLLL').to_ptr bmFileHeader = [ 19778, (screenWidth * screenHeight * 3) + 40 + 14, 0, 0, 54].pack('ILIIL').to_ptr r = getDIBits(hmemDC, hmemBM, 0, screenHeight, lpvpxldata, bmInfo, DIB_RGB_COLORS) printf("getDIBits : #{r}\n") File::open(filename, "w") { |bitmap| bitmap.print(bmFileHeader.to_s(14)) bitmap.print(bmInfo.to_s(40)) bitmap.print(lpvpxldata.to_s(screenWidth * screenHeight * 3)) } globalUnlock(hpxldata) globalFree(hpxldata) deleteObject(hmemBM) deleteDC(hmemDC) releaseDC(0, hScreenDC) end end ScreenCapture::screenCapture() From phasis at nownuri.net Sat Apr 23 19:20:12 2005 From: phasis at nownuri.net (Park Heesob) Date: Sat Apr 23 19:14:18 2005 Subject: [Win32utils-devel] Screen capture, save to file References: <004201c546b0$b6b4fc70$6400a8c0@NewDell> Message-ID: <001a01c5485b$00081280$fa0d5bd2@2xnm9896kmqn5b9> Hi, ----- Original Message ----- From: "Paul Rogers" To: Sent: Friday, April 22, 2005 5:28 AM Subject: [Win32utils-devel] Screen capture, save to file > > > Is there anything in the utils to capture a screen ( or maybe just a > window) and save to a file. > > I have this, but I have no idea where it came from, but it gives a > corrupted image > > Paul > I have made another simple and annoying solution using Print Screen,Clipboard and MSPaint.exe. Regards, Park Heesob ================================================= require 'Win32API' KEYEVENTF_KEYUP = 0x2 SW_HIDE = 0 SW_SHOW = 5 SW_SHOWNORMAL = 1 VK_CONTROL = 0x11 VK_F4 = 0x73 VK_MENU = 0x12 VK_RETURN = 0x0D VK_SHIFT = 0x10 VK_SNAPSHOT = 0x2C VK_TAB = 0x09 def screenCapture(filename = "tmp.bmp") keybd_event = Win32API.new("user32", "keybd_event", ['I','I','L','L'], 'V') vkKeyScan = Win32API.new("user32", "VkKeyScan", ['I'], 'I') winExec = Win32API.new("kernel32", "WinExec", ['P','L'], 'L') filename = Dir.getwd.tr('/','\\') + '\\' + filename unless filename.index('\\') keybd_event.Call(VK_SNAPSHOT,0,0,0) # Print Screen # keybd_event.Call(VK_SNAPSHOT,1,0,0) # Alt+Print Screen winExec.Call('mspaint.exe', SW_SHOW) sleep(1) # Ctrl + V : Paste keybd_event.Call(VK_CONTROL, 1, 0, 0) keybd_event.Call(vkKeyScan.Call(?V), 1, 0, 0) keybd_event.Call(vkKeyScan.Call(?V), 1, KEYEVENTF_KEYUP, 0) keybd_event.Call(VK_CONTROL, 1, KEYEVENTF_KEYUP, 0) # Alt E + O : Save Selected Image keybd_event.Call(VK_MENU, 1, 0, 0) keybd_event.Call(vkKeyScan.Call(?E), 1, 0, 0) keybd_event.Call(vkKeyScan.Call(?E), 1, KEYEVENTF_KEYUP, 0) keybd_event.Call(VK_MENU, 1, KEYEVENTF_KEYUP, 0) keybd_event.Call(vkKeyScan.Call(?O), 1, 0, 0) keybd_event.Call(vkKeyScan.Call(?O), 1, KEYEVENTF_KEYUP, 0) sleep(1) # Enter filename filename.each_byte { |ch| keybd_event.Call(VK_SHIFT, 1, 0, 0) if ch==?: keybd_event.Call(vkKeyScan.Call(ch), 1, 0, 0) keybd_event.Call(vkKeyScan.Call(ch), 1, KEYEVENTF_KEYUP, 0) keybd_event.Call(VK_SHIFT, 1, KEYEVENTF_KEYUP, 0) if ch==?: } keybd_event.Call(VK_RETURN, 1, 0, 0) keybd_event.Call(VK_RETURN, 1, KEYEVENTF_KEYUP, 0) sleep(1) # Y keybd_event.Call(vkKeyScan.Call(?Y), 1, 0, 0) keybd_event.Call(vkKeyScan.Call(?Y), 1, KEYEVENTF_KEYUP, 0) sleep(1) # Alt + F4 : Exit keybd_event.Call(VK_MENU, 1, 0, 0) keybd_event.Call(VK_F4, 1, 0, 0) keybd_event.Call(VK_F4, 1, KEYEVENTF_KEYUP, 0) keybd_event.Call(VK_MENU, 1, KEYEVENTF_KEYUP, 0) sleep(1) # N keybd_event.Call(vkKeyScan.Call(?N), 1, 0, 0) keybd_event.Call(vkKeyScan.Call(?N), 1, KEYEVENTF_KEYUP, 0) end screenCapture From djberg96 at yahoo.com Sun Apr 24 14:50:59 2005 From: djberg96 at yahoo.com (Daniel Berger) Date: Sun Apr 24 14:45:04 2005 Subject: [Win32utils-devel] Change to win32-changejournal Message-ID: <20050424185059.59726.qmail@web50301.mail.yahoo.com> Heesob, Can you please alter win32-changejournal to return an array of structs as you did for win32-changenotify? Thanks. Dan __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com From paul.rogers at shaw.ca Sun Apr 24 19:14:46 2005 From: paul.rogers at shaw.ca (Paul Rogers) Date: Sun Apr 24 19:09:34 2005 Subject: [Win32utils-devel] Screen capture, save to file In-Reply-To: <001a01c5485b$00081280$fa0d5bd2@2xnm9896kmqn5b9> Message-ID: <004e01c54923$68610940$6400a8c0@NewDell> Thanks! I'll settle for simple and annoying for now! Paul -----Original Message----- From: win32utils-devel-bounces@rubyforge.org [mailto:win32utils-devel-bounces@rubyforge.org] On Behalf Of Park Heesob Sent: 23 April 2005 17:20 To: Development and ideas for win32utils projects Subject: Re: [Win32utils-devel] Screen capture, save to file Hi, ----- Original Message ----- From: "Paul Rogers" To: Sent: Friday, April 22, 2005 5:28 AM Subject: [Win32utils-devel] Screen capture, save to file > > > Is there anything in the utils to capture a screen ( or maybe just a > window) and save to a file. > > I have this, but I have no idea where it came from, but it gives a > corrupted image > > Paul > I have made another simple and annoying solution using Print Screen,Clipboard and MSPaint.exe. Regards, Park Heesob ================================================= require 'Win32API' KEYEVENTF_KEYUP = 0x2 SW_HIDE = 0 SW_SHOW = 5 SW_SHOWNORMAL = 1 VK_CONTROL = 0x11 VK_F4 = 0x73 VK_MENU = 0x12 VK_RETURN = 0x0D VK_SHIFT = 0x10 VK_SNAPSHOT = 0x2C VK_TAB = 0x09 def screenCapture(filename = "tmp.bmp") keybd_event = Win32API.new("user32", "keybd_event", ['I','I','L','L'], 'V') vkKeyScan = Win32API.new("user32", "VkKeyScan", ['I'], 'I') winExec = Win32API.new("kernel32", "WinExec", ['P','L'], 'L') filename = Dir.getwd.tr('/','\\') + '\\' + filename unless filename.index('\\') keybd_event.Call(VK_SNAPSHOT,0,0,0) # Print Screen # keybd_event.Call(VK_SNAPSHOT,1,0,0) # Alt+Print Screen winExec.Call('mspaint.exe', SW_SHOW) sleep(1) # Ctrl + V : Paste keybd_event.Call(VK_CONTROL, 1, 0, 0) keybd_event.Call(vkKeyScan.Call(?V), 1, 0, 0) keybd_event.Call(vkKeyScan.Call(?V), 1, KEYEVENTF_KEYUP, 0) keybd_event.Call(VK_CONTROL, 1, KEYEVENTF_KEYUP, 0) # Alt E + O : Save Selected Image keybd_event.Call(VK_MENU, 1, 0, 0) keybd_event.Call(vkKeyScan.Call(?E), 1, 0, 0) keybd_event.Call(vkKeyScan.Call(?E), 1, KEYEVENTF_KEYUP, 0) keybd_event.Call(VK_MENU, 1, KEYEVENTF_KEYUP, 0) keybd_event.Call(vkKeyScan.Call(?O), 1, 0, 0) keybd_event.Call(vkKeyScan.Call(?O), 1, KEYEVENTF_KEYUP, 0) sleep(1) # Enter filename filename.each_byte { |ch| keybd_event.Call(VK_SHIFT, 1, 0, 0) if ch==?: keybd_event.Call(vkKeyScan.Call(ch), 1, 0, 0) keybd_event.Call(vkKeyScan.Call(ch), 1, KEYEVENTF_KEYUP, 0) keybd_event.Call(VK_SHIFT, 1, KEYEVENTF_KEYUP, 0) if ch==?: } keybd_event.Call(VK_RETURN, 1, 0, 0) keybd_event.Call(VK_RETURN, 1, KEYEVENTF_KEYUP, 0) sleep(1) # Y keybd_event.Call(vkKeyScan.Call(?Y), 1, 0, 0) keybd_event.Call(vkKeyScan.Call(?Y), 1, KEYEVENTF_KEYUP, 0) sleep(1) # Alt + F4 : Exit keybd_event.Call(VK_MENU, 1, 0, 0) keybd_event.Call(VK_F4, 1, 0, 0) keybd_event.Call(VK_F4, 1, KEYEVENTF_KEYUP, 0) keybd_event.Call(VK_MENU, 1, KEYEVENTF_KEYUP, 0) sleep(1) # N keybd_event.Call(vkKeyScan.Call(?N), 1, 0, 0) keybd_event.Call(vkKeyScan.Call(?N), 1, KEYEVENTF_KEYUP, 0) end screenCapture _______________________________________________ win32utils-devel mailing list win32utils-devel@rubyforge.org http://rubyforge.org/mailman/listinfo/win32utils-devel From paul.rogers at shaw.ca Tue Apr 26 15:03:22 2005 From: paul.rogers at shaw.ca (Paul Rogers) Date: Tue Apr 26 14:57:17 2005 Subject: [Win32utils-devel] Screen capture, save to file In-Reply-To: <001a01c5485b$00081280$fa0d5bd2@2xnm9896kmqn5b9> Message-ID: <008901c54a92$9dbf7ca0$afd29044@NewDell> I havent had a chance to try this so far, but Im sure it will be fine. The reason I wanted this is that Im a developer on Watir ( http://wtr.rubyforge.org/ ) and several people have asked for the ability to capture screen shots when running tests. So my question is this - Is it ok for us to redistribute this code with Watir? I will obviously credit you with writing it. Thanks Paul -----Original Message----- From: win32utils-devel-bounces@rubyforge.org [mailto:win32utils-devel-bounces@rubyforge.org] On Behalf Of Park Heesob Sent: 23 April 2005 17:20 To: Development and ideas for win32utils projects Subject: Re: [Win32utils-devel] Screen capture, save to file Hi, ----- Original Message ----- From: "Paul Rogers" To: Sent: Friday, April 22, 2005 5:28 AM Subject: [Win32utils-devel] Screen capture, save to file > > > Is there anything in the utils to capture a screen ( or maybe just a > window) and save to a file. > > I have this, but I have no idea where it came from, but it gives a > corrupted image > > Paul > I have made another simple and annoying solution using Print Screen,Clipboard and MSPaint.exe. Regards, Park Heesob ================================================= require 'Win32API' KEYEVENTF_KEYUP = 0x2 SW_HIDE = 0 SW_SHOW = 5 SW_SHOWNORMAL = 1 VK_CONTROL = 0x11 VK_F4 = 0x73 VK_MENU = 0x12 VK_RETURN = 0x0D VK_SHIFT = 0x10 VK_SNAPSHOT = 0x2C VK_TAB = 0x09 def screenCapture(filename = "tmp.bmp") keybd_event = Win32API.new("user32", "keybd_event", ['I','I','L','L'], 'V') vkKeyScan = Win32API.new("user32", "VkKeyScan", ['I'], 'I') winExec = Win32API.new("kernel32", "WinExec", ['P','L'], 'L') filename = Dir.getwd.tr('/','\\') + '\\' + filename unless filename.index('\\') keybd_event.Call(VK_SNAPSHOT,0,0,0) # Print Screen # keybd_event.Call(VK_SNAPSHOT,1,0,0) # Alt+Print Screen winExec.Call('mspaint.exe', SW_SHOW) sleep(1) # Ctrl + V : Paste keybd_event.Call(VK_CONTROL, 1, 0, 0) keybd_event.Call(vkKeyScan.Call(?V), 1, 0, 0) keybd_event.Call(vkKeyScan.Call(?V), 1, KEYEVENTF_KEYUP, 0) keybd_event.Call(VK_CONTROL, 1, KEYEVENTF_KEYUP, 0) # Alt E + O : Save Selected Image keybd_event.Call(VK_MENU, 1, 0, 0) keybd_event.Call(vkKeyScan.Call(?E), 1, 0, 0) keybd_event.Call(vkKeyScan.Call(?E), 1, KEYEVENTF_KEYUP, 0) keybd_event.Call(VK_MENU, 1, KEYEVENTF_KEYUP, 0) keybd_event.Call(vkKeyScan.Call(?O), 1, 0, 0) keybd_event.Call(vkKeyScan.Call(?O), 1, KEYEVENTF_KEYUP, 0) sleep(1) # Enter filename filename.each_byte { |ch| keybd_event.Call(VK_SHIFT, 1, 0, 0) if ch==?: keybd_event.Call(vkKeyScan.Call(ch), 1, 0, 0) keybd_event.Call(vkKeyScan.Call(ch), 1, KEYEVENTF_KEYUP, 0) keybd_event.Call(VK_SHIFT, 1, KEYEVENTF_KEYUP, 0) if ch==?: } keybd_event.Call(VK_RETURN, 1, 0, 0) keybd_event.Call(VK_RETURN, 1, KEYEVENTF_KEYUP, 0) sleep(1) # Y keybd_event.Call(vkKeyScan.Call(?Y), 1, 0, 0) keybd_event.Call(vkKeyScan.Call(?Y), 1, KEYEVENTF_KEYUP, 0) sleep(1) # Alt + F4 : Exit keybd_event.Call(VK_MENU, 1, 0, 0) keybd_event.Call(VK_F4, 1, 0, 0) keybd_event.Call(VK_F4, 1, KEYEVENTF_KEYUP, 0) keybd_event.Call(VK_MENU, 1, KEYEVENTF_KEYUP, 0) sleep(1) # N keybd_event.Call(vkKeyScan.Call(?N), 1, 0, 0) keybd_event.Call(vkKeyScan.Call(?N), 1, KEYEVENTF_KEYUP, 0) end screenCapture _______________________________________________ win32utils-devel mailing list win32utils-devel@rubyforge.org http://rubyforge.org/mailman/listinfo/win32utils-devel From paul.rogers at shaw.ca Tue Apr 26 15:28:30 2005 From: paul.rogers at shaw.ca (Paul Rogers) Date: Tue Apr 26 15:22:26 2005 Subject: [Win32utils-devel] Screen capture, save to file In-Reply-To: <008901c54a92$9dbf7ca0$afd29044@NewDell> Message-ID: <008a01c54a96$209fa390$afd29044@NewDell> Ok, Ive just tried it, and there is a weird bug I don't understand. In the Save as dialog, a _ gets changed to a - c:\watir_bonus>screen_capture.rb file to use is: c:\watir_bonus\tmp.bmp after E O sending c 99 SHIFT sending : 58 sending \ 92 sending w 119 sending a 97 sending t 116 sending i 105 sending r 114 sending _ 95 <-- correct char is sent sending b 98 sending o 111 sending n 110 sending u 117 sending s 115 sending \ 92 sending t 116 sending m 109 sending p 112 sending . 46 sending b 98 sending m 109 sending p 112 after filename c:\watir_bonus>irb irb(main):001:0> "_".asc NoMethodError: undefined method `asc' for "_":String from (irb):1 irb(main):002:0> 95.chr => "_" irb(main):003:0> "-"[0] => 45 irb(main):004:0> 45.chr => "-" irb(main):005:0> But it shows up in the save as dialog as - Thanks Paul -----Original Message----- From: win32utils-devel-bounces@rubyforge.org [mailto:win32utils-devel-bounces@rubyforge.org] On Behalf Of Paul Rogers Sent: 26 April 2005 13:03 To: 'Development and ideas for win32utils projects' Subject: RE: [Win32utils-devel] Screen capture, save to file I havent had a chance to try this so far, but Im sure it will be fine. The reason I wanted this is that Im a developer on Watir ( http://wtr.rubyforge.org/ ) and several people have asked for the ability to capture screen shots when running tests. So my question is this - Is it ok for us to redistribute this code with Watir? I will obviously credit you with writing it. Thanks Paul -----Original Message----- From: win32utils-devel-bounces@rubyforge.org [mailto:win32utils-devel-bounces@rubyforge.org] On Behalf Of Park Heesob Sent: 23 April 2005 17:20 To: Development and ideas for win32utils projects Subject: Re: [Win32utils-devel] Screen capture, save to file Hi, ----- Original Message ----- From: "Paul Rogers" To: Sent: Friday, April 22, 2005 5:28 AM Subject: [Win32utils-devel] Screen capture, save to file > > > Is there anything in the utils to capture a screen ( or maybe just a > window) and save to a file. > > I have this, but I have no idea where it came from, but it gives a > corrupted image > > Paul > I have made another simple and annoying solution using Print Screen,Clipboard and MSPaint.exe. Regards, Park Heesob ================================================= require 'Win32API' KEYEVENTF_KEYUP = 0x2 SW_HIDE = 0 SW_SHOW = 5 SW_SHOWNORMAL = 1 VK_CONTROL = 0x11 VK_F4 = 0x73 VK_MENU = 0x12 VK_RETURN = 0x0D VK_SHIFT = 0x10 VK_SNAPSHOT = 0x2C VK_TAB = 0x09 def screenCapture(filename = "tmp.bmp") keybd_event = Win32API.new("user32", "keybd_event", ['I','I','L','L'], 'V') vkKeyScan = Win32API.new("user32", "VkKeyScan", ['I'], 'I') winExec = Win32API.new("kernel32", "WinExec", ['P','L'], 'L') filename = Dir.getwd.tr('/','\\') + '\\' + filename unless filename.index('\\') keybd_event.Call(VK_SNAPSHOT,0,0,0) # Print Screen # keybd_event.Call(VK_SNAPSHOT,1,0,0) # Alt+Print Screen winExec.Call('mspaint.exe', SW_SHOW) sleep(1) # Ctrl + V : Paste keybd_event.Call(VK_CONTROL, 1, 0, 0) keybd_event.Call(vkKeyScan.Call(?V), 1, 0, 0) keybd_event.Call(vkKeyScan.Call(?V), 1, KEYEVENTF_KEYUP, 0) keybd_event.Call(VK_CONTROL, 1, KEYEVENTF_KEYUP, 0) # Alt E + O : Save Selected Image keybd_event.Call(VK_MENU, 1, 0, 0) keybd_event.Call(vkKeyScan.Call(?E), 1, 0, 0) keybd_event.Call(vkKeyScan.Call(?E), 1, KEYEVENTF_KEYUP, 0) keybd_event.Call(VK_MENU, 1, KEYEVENTF_KEYUP, 0) keybd_event.Call(vkKeyScan.Call(?O), 1, 0, 0) keybd_event.Call(vkKeyScan.Call(?O), 1, KEYEVENTF_KEYUP, 0) sleep(1) # Enter filename filename.each_byte { |ch| keybd_event.Call(VK_SHIFT, 1, 0, 0) if ch==?: keybd_event.Call(vkKeyScan.Call(ch), 1, 0, 0) keybd_event.Call(vkKeyScan.Call(ch), 1, KEYEVENTF_KEYUP, 0) keybd_event.Call(VK_SHIFT, 1, KEYEVENTF_KEYUP, 0) if ch==?: } keybd_event.Call(VK_RETURN, 1, 0, 0) keybd_event.Call(VK_RETURN, 1, KEYEVENTF_KEYUP, 0) sleep(1) # Y keybd_event.Call(vkKeyScan.Call(?Y), 1, 0, 0) keybd_event.Call(vkKeyScan.Call(?Y), 1, KEYEVENTF_KEYUP, 0) sleep(1) # Alt + F4 : Exit keybd_event.Call(VK_MENU, 1, 0, 0) keybd_event.Call(VK_F4, 1, 0, 0) keybd_event.Call(VK_F4, 1, KEYEVENTF_KEYUP, 0) keybd_event.Call(VK_MENU, 1, KEYEVENTF_KEYUP, 0) sleep(1) # N keybd_event.Call(vkKeyScan.Call(?N), 1, 0, 0) keybd_event.Call(vkKeyScan.Call(?N), 1, KEYEVENTF_KEYUP, 0) end screenCapture _______________________________________________ win32utils-devel mailing list win32utils-devel@rubyforge.org http://rubyforge.org/mailman/listinfo/win32utils-devel _______________________________________________ win32utils-devel mailing list win32utils-devel@rubyforge.org http://rubyforge.org/mailman/listinfo/win32utils-devel From sdate at everestkc.net Tue Apr 26 23:24:49 2005 From: sdate at everestkc.net (Shashank Date) Date: Tue Apr 26 23:19:02 2005 Subject: [Win32utils-devel] Screen capture, save to file In-Reply-To: <008a01c54a96$209fa390$afd29044@NewDell> References: <008a01c54a96$209fa390$afd29044@NewDell> Message-ID: <426F0601.8090802@everestkc.net> Paul Rogers wrote: >Ok, Ive just tried it, and there is a weird bug I don't understand. >In the Save as dialog, a _ gets changed to a - > Is it because '_' (underscore) requires pressing of the Shift key without which it is simply '-' (hyphen)? Just a guess ... don't know if the code handles Shift, Ctrl and Alt key presses. -- shanko From sdate at everestkc.net Tue Apr 26 23:36:12 2005 From: sdate at everestkc.net (Shashank Date) Date: Tue Apr 26 23:30:19 2005 Subject: [Win32utils-devel] Screen capture, save to file In-Reply-To: <426F0601.8090802@everestkc.net> References: <008a01c54a96$209fa390$afd29044@NewDell> <426F0601.8090802@everestkc.net> Message-ID: <426F08AC.5090004@everestkc.net> Hi Paul, Shashank Date wrote: > Is it because '_' (underscore) requires pressing of the Shift key > without which it is simply '-' (hyphen)? I guessed it right. This worked for me: ## Screen Capture program By Park Heesob ## require 'Win32API' KEYEVENTF_KEYUP = 0x2 SW_HIDE = 0 SW_SHOW = 5 SW_SHOWNORMAL = 1 VK_CONTROL = 0x11 VK_F4 = 0x73 VK_MENU = 0x12 VK_RETURN = 0x0D VK_SHIFT = 0x10 VK_SNAPSHOT = 0x2C VK_TAB = 0x09 def screenCapture(filename = "C:\\watir_bonus\\tmp.bmp") keybd_event = Win32API.new("user32", "keybd_event", ['I','I','L','L'], 'V') vkKeyScan = Win32API.new("user32", "VkKeyScan", ['I'], 'I') winExec = Win32API.new("kernel32", "WinExec", ['P','L'], 'L') filename = Dir.getwd.tr('/','\\') + '\\' + filename unless filename.index('\\') keybd_event.Call(VK_SNAPSHOT,0,0,0) # Print Screen # keybd_event.Call(VK_SNAPSHOT,1,0,0) # Alt+Print Screen winExec.Call('mspaint.exe', SW_SHOW) sleep(1) # Ctrl + V : Paste keybd_event.Call(VK_CONTROL, 1, 0, 0) keybd_event.Call(vkKeyScan.Call(?V), 1, 0, 0) keybd_event.Call(vkKeyScan.Call(?V), 1, KEYEVENTF_KEYUP, 0) keybd_event.Call(VK_CONTROL, 1, KEYEVENTF_KEYUP, 0) # Alt E + O : Save Selected Image keybd_event.Call(VK_MENU, 1, 0, 0) keybd_event.Call(vkKeyScan.Call(?E), 1, 0, 0) keybd_event.Call(vkKeyScan.Call(?E), 1, KEYEVENTF_KEYUP, 0) keybd_event.Call(VK_MENU, 1, KEYEVENTF_KEYUP, 0) keybd_event.Call(vkKeyScan.Call(?O), 1, 0, 0) keybd_event.Call(vkKeyScan.Call(?O), 1, KEYEVENTF_KEYUP, 0) sleep(1) # Enter filename filename.each_byte { |ch| keybd_event.Call(VK_SHIFT, 1, 0, 0) if [?:,?_,?$].include?(ch) keybd_event.Call(vkKeyScan.Call(ch), 1, 0, 0) keybd_event.Call(vkKeyScan.Call(ch), 1, KEYEVENTF_KEYUP, 0) keybd_event.Call(VK_SHIFT, 1, KEYEVENTF_KEYUP, 0) if [?:,?_,?$].include?(ch) sleep(1) } keybd_event.Call(VK_RETURN, 1, 0, 0) keybd_event.Call(VK_RETURN, 1, KEYEVENTF_KEYUP, 0) sleep(1) # Y keybd_event.Call(vkKeyScan.Call(?Y), 1, 0, 0) keybd_event.Call(vkKeyScan.Call(?Y), 1, KEYEVENTF_KEYUP, 0) sleep(1) # Alt + F4 : Exit keybd_event.Call(VK_MENU, 1, 0, 0) keybd_event.Call(VK_F4, 1, 0, 0) keybd_event.Call(VK_F4, 1, KEYEVENTF_KEYUP, 0) keybd_event.Call(VK_MENU, 1, KEYEVENTF_KEYUP, 0) sleep(3) # N keybd_event.Call(vkKeyScan.Call(?N), 1, 0, 0) keybd_event.Call(vkKeyScan.Call(?N), 1, KEYEVENTF_KEYUP, 0) end screenCapture From Daniel.Berger at qwest.com Wed Apr 27 11:25:01 2005 From: Daniel.Berger at qwest.com (Berger, Daniel) Date: Wed Apr 27 11:19:08 2005 Subject: [Win32utils-devel] Screen capture, save to file Message-ID: <8FE83020B9E1A248A182A9B0A7B76E7358B3E6@itomae2km07.AD.QINTRA.COM> Hi Shanko, I reassigned feature request #872 to you. :) (Port of Win32::Screenshot) Unless you object, that is. By all means, feel free to use Win32API rather than C code (which is what the Perl module uses). That is, unless you don't want this assignment. :) Regards, Dan From noreply at rubyforge.org Wed Apr 27 11:16:53 2005 From: noreply at rubyforge.org (noreply@rubyforge.org) Date: Wed Apr 27 16:14:34 2005 Subject: [Win32utils-devel] [ win32utils-Feature Requests-872 ] Port of Win32::Screenshot Message-ID: <200504271516.j3RFGrw2000965@rubyforge.org> Feature Requests item #872, was opened at 2004-09-05 20:52 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=414&aid=872&group_id=85 Category: None Group: None Status: Open Resolution: None Priority: 4 Submitted By: Daniel Berger (djberg96) >Assigned to: Shashank Date (shashank) Summary: Port of Win32::Screenshot Initial Comment: I think porting Petr ??mejkal's Win32::Screenshot Perl module would be nice. :) Dan ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=414&aid=872&group_id=85 From sdate at everestkc.net Wed Apr 27 23:23:20 2005 From: sdate at everestkc.net (Shashank Date) Date: Wed Apr 27 23:17:29 2005 Subject: [Win32utils-devel] Screen capture, save to file In-Reply-To: <8FE83020B9E1A248A182A9B0A7B76E7358B3E6@itomae2km07.AD.QINTRA.COM> References: <8FE83020B9E1A248A182A9B0A7B76E7358B3E6@itomae2km07.AD.QINTRA.COM> Message-ID: <42705728.20701@everestkc.net> Hi Dan, Berger, Daniel wrote: >I reassigned feature request #872 to you. :) > >(Port of Win32::Screenshot) > > Great !! >Unless you object, that is. By all means, feel free to use Win32API >rather than C code (which is what the Perl module uses). > > Win32API will be easier for me to tackle so I will work in it first. But then I also want to get my hands dirty in Ruby-C and with your (and Park's) help learn a thing or two. So I will end up doing that too. >That is, unless you don't want this assignment. :) > > I will love to do this unless there some urgency ... you may want to ask the requestor how long he/she is willing to wait. It could be a while (a couple of months) before I get around to it. Many high-pri things pending. >Regards, > >Dan > > Thanks, -- shanko From paul.rogers at shaw.ca Wed Apr 27 23:43:45 2005 From: paul.rogers at shaw.ca (Paul Rogers) Date: Wed Apr 27 23:37:32 2005 Subject: [Win32utils-devel] Screen capture Message-ID: <00c501c54ba4$7afc4500$afd29044@NewDell> The nice folks over on the Win32Utils group were kind enough to write some code to do screen captures for us. Watir can now take a copy of the screen ( or active window) and save it to a jpg or a bmp file Usage: # this method saves the current window or whole screen as either a bitmap or a jpeg # It uses paint to save the file, so will barf if a duplicate filename is selected, or the path doesnt exist etc # * filename - string - the name of the file to save. If its not fully qualified the current directory is used # * active_window - boolean - if true, the whole screen is captured, if false, just the active window is captured # * save_as_bmp - boolean - if true saves the file as a bitmap, saves it as a jpeg otherwise def screen_capture(filename , active_window_only=false, save_as_bmp=false) ie.screen_capture('c:\\pics\\screen_1.jpg) # does a copy of the whole screen ie.screen_capture('c:\\pics\\screen_1.jpg) # does a copy of the whole screen ie.screen_capture('c:\\pics\\screen_1.jpg , true ) # does a copy of the active window ie.screen_capture('c:\\pics\\screen_1.bmp , tue , true ) # does a copy of the whole screen , saves as a bmp Paul From paul.rogers at shaw.ca Wed Apr 27 23:45:09 2005 From: paul.rogers at shaw.ca (Paul Rogers) Date: Wed Apr 27 23:39:59 2005 Subject: [Win32utils-devel] Screen capture, save to file In-Reply-To: <42705728.20701@everestkc.net> Message-ID: <00c601c54ba4$aca23b00$afd29044@NewDell> As soon as possible is always the answer ;-) No, whenever is fine. The code that Park Heesob and yourself posted will be fine for a while. As soon as there is on ethat doesn't need paint, we'll switch Thanks for even looking into it! Paul -----Original Message----- From: win32utils-devel-bounces@rubyforge.org [mailto:win32utils-devel-bounces@rubyforge.org] On Behalf Of Shashank Date Sent: 27 April 2005 21:23 To: Development and ideas for win32utils projects Subject: Re: [Win32utils-devel] Screen capture, save to file Hi Dan, Berger, Daniel wrote: >I reassigned feature request #872 to you. :) > >(Port of Win32::Screenshot) > > Great !! >Unless you object, that is. By all means, feel free to use Win32API >rather than C code (which is what the Perl module uses). > > Win32API will be easier for me to tackle so I will work in it first. But then I also want to get my hands dirty in Ruby-C and with your (and Park's) help learn a thing or two. So I will end up doing that too. >That is, unless you don't want this assignment. :) > > I will love to do this unless there some urgency ... you may want to ask the requestor how long he/she is willing to wait. It could be a while (a couple of months) before I get around to it. Many high-pri things pending. >Regards, > >Dan > > Thanks, -- shanko _______________________________________________ win32utils-devel mailing list win32utils-devel@rubyforge.org http://rubyforge.org/mailman/listinfo/win32utils-devel From zdennis at mktec.com Sat Apr 30 01:24:57 2005 From: zdennis at mktec.com (Zach Dennis) Date: Sat Apr 30 01:21:12 2005 Subject: [Win32utils-devel] Symlinks for Windows In-Reply-To: <20050226192300.28766.qmail@web50301.mail.yahoo.com> References: <20050226192300.28766.qmail@web50301.mail.yahoo.com> Message-ID: <427316A9.1010207@mktec.com> Daniel Berger wrote: > Hi all, > > Dave Burt mentioned the possibility of adding symlinks > to the Dir class. > > http://www.sysinternals.com/ntw2k/source/misc.shtml#junction > > > There is also Autrijus Tang's symlink Perl module at > http://search.cpan.org/~autrijus/Win32-Symlink-0.04/ > > Looks easy enough, but it only seems to work for > directories, not regular files. Should we add this to > the Directory class, or simply define it for the File > class with a big warning sticker? The former seems to > make more sense, but the latter helps keep things > portable and familiar. > > What's the consensus? > Did this ever happen. I can't find it in any of the win32 packages.... am i missing something? Thanks, Zach From djberg96 at gmail.com Sat Apr 30 12:03:56 2005 From: djberg96 at gmail.com (Daniel Berger) Date: Sat Apr 30 11:57:54 2005 Subject: [Win32utils-devel] Symlinks for Windows In-Reply-To: <427316A9.1010207@mktec.com> References: <20050226192300.28766.qmail@web50301.mail.yahoo.com> <427316A9.1010207@mktec.com> Message-ID: <6037b70c050430090354374173@mail.gmail.com> On 4/30/05, Zach Dennis wrote: > Daniel Berger wrote: > > Hi all, > > > > Dave Burt mentioned the possibility of adding symlinks > > to the Dir class. > > > > http://www.sysinternals.com/ntw2k/source/misc.shtml#junction > > > > > > There is also Autrijus Tang's symlink Perl module at > > http://search.cpan.org/~autrijus/Win32-Symlink-0.04/ > > > > Looks easy enough, but it only seems to work for > > directories, not regular files. Should we add this to > > the Directory class, or simply define it for the File > > class with a big warning sticker? The former seems to > > make more sense, but the latter helps keep things > > portable and familiar. > > > > What's the consensus? > > > > Did this ever happen. I can't find it in any of the win32 packages.... > am i missing something? Thanks, > > Zach Nope, hasn't happened yet. I'm still mulling it over. I noticed that some Perl folks got confused by Autrijus' module with regards to the file versus directory issue, so now I'm leaning towards adding this to win32-dir as Dir.junction and Dir#junction? instead of File.symlink and File#symlink? However, if anyone feels strongly one way or the other, I'm listening. Regards, Dan