[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

win32ole.AppActivate broken in VISTA?

Robert Batzinger

1/26/2008 7:49:00 AM

I have been trying to use the win32ole module on Vista. However, the
AppActivate method always fails regardless of whether simple or
root-relative address are used in the following program. The module
appears to be working well on all other versions of Windows. Does
anyone know the fix to this?

require 'win32ole'
wsh = WIN32OLE.new('Wscript.Shell')
if wsh.AppActivate('notepad')
print 'Success'
else
print 'Fail'
end

BTW Just typing the word notepad works at the DOS prompt and the
WIN32OLE does open the OLE object

================
Bob Batzinger
Arkfriends
South Bend, Indiana

14 Answers

David Mullet

1/27/2008 2:46:00 AM

0

Robert Batzinger wrote:
> I have been trying to use the win32ole module on Vista. However, the
> AppActivate method always fails regardless of whether simple or
> root-relative address are used in the following program. The module
> appears to be working well on all other versions of Windows. Does
> anyone know the fix to this?
>
> require 'win32ole'
> wsh = WIN32OLE.new('Wscript.Shell')
> if wsh.AppActivate('notepad')
> print 'Success'
> else
> print 'Fail'
> end
>
> BTW Just typing the word notepad works at the DOS prompt and the
> WIN32OLE does open the OLE object
>
> ================
> Bob Batzinger
> Arkfriends
> South Bend, Indiana

Bob-

For what it's worth, your code works for me using Ruby 1.8.6 on Windows
Vista Home Premium.

David
http://rubyonwindows.bl...
--
Posted via http://www.ruby-....

Dirk Meijer

1/27/2008 1:09:00 PM

0

[Note: parts of this message were removed to make it a legal post.]

i'm on vista ultimate, and when notepad's allready on, it switches to the
notepad screen and prints "succes"
but when notepad's not activated, i get a "fail" as well.

2008/1/27, David Mullet <david.mullet@gmail.com>:
>
> Robert Batzinger wrote:
> > I have been trying to use the win32ole module on Vista. However, the
> > AppActivate method always fails regardless of whether simple or
> > root-relative address are used in the following program. The module
> > appears to be working well on all other versions of Windows. Does
> > anyone know the fix to this?
> >
> > require 'win32ole'
> > wsh = WIN32OLE.new('Wscript.Shell')
> > if wsh.AppActivate('notepad')
> > print 'Success'
> > else
> > print 'Fail'
> > end
> >
> > BTW Just typing the word notepad works at the DOS prompt and the
> > WIN32OLE does open the OLE object
> >
> > ================
> > Bob Batzinger
> > Arkfriends
> > South Bend, Indiana
>
> Bob-
>
> For what it's worth, your code works for me using Ruby 1.8.6 on Windows
> Vista Home Premium.
>
> David
> http://rubyonwindows.bl...
> --
> Posted via http://www.ruby-....
>
>


--
Procrastinate today! (Tomorrow may be too late...)

Jano Svitok

1/27/2008 3:31:00 PM

0

On Jan 27, 2008 2:09 PM, Dirk Meijer <hawkman@gelooft.nl> wrote:
> i'm on vista ultimate, and when notepad's allready on, it switches to the
> notepad screen and prints "succes"
> but when notepad's not activated, i get a "fail" as well.
>
> 2008/1/27, David Mullet <david.mullet@gmail.com>:
>
> >
> > Robert Batzinger wrote:
> > > I have been trying to use the win32ole module on Vista. However, the
> > > AppActivate method always fails regardless of whether simple or
> > > root-relative address are used in the following program. The module
> > > appears to be working well on all other versions of Windows. Does
> > > anyone know the fix to this?
> > >
> > > require 'win32ole'
> > > wsh = WIN32OLE.new('Wscript.Shell')
> > > if wsh.AppActivate('notepad')
> > > print 'Success'
> > > else
> > > print 'Fail'
> > > end
> > >
> > > BTW Just typing the word notepad works at the DOS prompt and the
> > > WIN32OLE does open the OLE object

http://msdn2.microsoft.com/en-us/librar...(VS.85).aspx says
AppActivate searches by window title. That means the app must be
already running.
You might want to use the Run method instead (if you want to start a
new instance of notepad).

Other than that, you may try
1. checking whether the window title really contains the specified string
2. running the script from another language (.vbs, .wsh, vba, python)

(I'm not an expert on wsh, so please take these as hints only)

J.

Michael A. Terrell

1/1/2013 8:52:00 AM

0


Gunner wrote:
>
> On Tue, 01 Jan 2013 00:13:20 -0800, Beeper <ibeep@u.com> wrote:
>
> >On 01/01/2013 12:02 AM, Too_Many_Tools wrote:
> >> LOL...like you losers needed any more bad press.
> >>
> >> The most HATED political fringe group in America!!!
> >>
> >> Will the accident rate among Tea Party members go up in 2013...you bet
> >> it will!
> >>
> >> TMT
> >>
> >> p.s. You dumb conservative shits just helped me win over 11 steak
> >> dinners.
> >
> >Watch out! It's a trick!
> >
> ><http://health.yahoo.net/articles/healthcare/photos/biggest-health-stories-...
> >
> >"For the first time, researchers estimated the effect of red meat on a
> >person's lifespan?and the news wasn't good.
> >
> >On average, each additional serving of saturated fat-filled red meat was
> >associated with a 13% higher risk of dying during the 28-year study."
>
> So if I ate a steak a day for 10 days...Id die about day 8 or 9?
>
> Fascinating!


According to their figures, my relatives who ate red meat every day
from the time they were put on solid food until they died in their 90s
would have lived thousands of years, if they were vegietarians? Or
would it just seem that way?

Tom Gardner

1/1/2013 9:36:00 AM

0

On 1/1/2013 3:45 AM, Gunner wrote:
> So if I ate a steak a day for 10 days...Id die about day 8 or 9?
>
> Fascinating!
>
>
> Gunner

Probably of boredom. Unless you pick up a 5-bone prime rib and cut your
own steaks from that. Just a little salt and pepper then a 700 deg.
plus charcoal sear then finished to rare/med-rare on the "cool" side of
the grill.

But I'd rather insert some chicken, fish and vegetarian days in there.

Gunner Asch

1/1/2013 11:06:00 AM

0

On Tue, 01 Jan 2013 03:51:40 -0500, "Michael A. Terrell"
<mike.terrell@earthlink.net> wrote:

>
>Gunner wrote:
>>
>> On Tue, 01 Jan 2013 00:13:20 -0800, Beeper <ibeep@u.com> wrote:
>>
>> >On 01/01/2013 12:02 AM, Too_Many_Tools wrote:
>> >> LOL...like you losers needed any more bad press.
>> >>
>> >> The most HATED political fringe group in America!!!
>> >>
>> >> Will the accident rate among Tea Party members go up in 2013...you bet
>> >> it will!
>> >>
>> >> TMT
>> >>
>> >> p.s. You dumb conservative shits just helped me win over 11 steak
>> >> dinners.
>> >
>> >Watch out! It's a trick!
>> >
>> ><http://health.yahoo.net/articles/healthcare/photos/biggest-health-stories-...
>> >
>> >"For the first time, researchers estimated the effect of red meat on a
>> >person's lifespan?and the news wasn't good.
>> >
>> >On average, each additional serving of saturated fat-filled red meat was
>> >associated with a 13% higher risk of dying during the 28-year study."
>>
>> So if I ate a steak a day for 10 days...Id die about day 8 or 9?
>>
>> Fascinating!
>
>
> According to their figures, my relatives who ate red meat every day
>from the time they were put on solid food until they died in their 90s
>would have lived thousands of years, if they were vegietarians? Or
>would it just seem that way?

Thats what Im seeing as well.

Whodathunkit!

Gunner

The methodology of the left has always been:

1. Lie
2. Repeat the lie as many times as possible
3. Have as many people repeat the lie as often as possible
4. Eventually, the uninformed believe the lie
5. The lie will then be made into some form oflaw
6. Then everyone must conform to the lie

Gunner Asch

1/1/2013 12:29:00 PM

0

On Tue, 01 Jan 2013 04:35:34 -0500, Tom Gardner <Mars@Tacks> wrote:

>On 1/1/2013 3:45 AM, Gunner wrote:
>> So if I ate a steak a day for 10 days...Id die about day 8 or 9?
>>
>> Fascinating!
>>
>>
>> Gunner
>
>Probably of boredom. Unless you pick up a 5-bone prime rib and cut your
>own steaks from that. Just a little salt and pepper then a 700 deg.
>plus charcoal sear then finished to rare/med-rare on the "cool" side of
>the grill.
>
>But I'd rather insert some chicken, fish and vegetarian days in there.

But of course! Some steamed rice, brussels sprouts with cheese,
mustard beans and a big glass of milk!

Yummy!!

Im unfortunately allergic to fish..shrug

Gunner

The methodology of the left has always been:

1. Lie
2. Repeat the lie as many times as possible
3. Have as many people repeat the lie as often as possible
4. Eventually, the uninformed believe the lie
5. The lie will then be made into some form oflaw
6. Then everyone must conform to the lie

Beeper

1/1/2013 3:20:00 PM

0

On 01/01/2013 03:05 AM, Gunner wrote:
> On Tue, 01 Jan 2013 03:51:40 -0500, "Michael A. Terrell"
> <mike.terrell@earthlink.net> wrote:
>
>>
>> Gunner wrote:
>>>
>>> On Tue, 01 Jan 2013 00:13:20 -0800, Beeper <ibeep@u.com> wrote:
>>>
>>>> On 01/01/2013 12:02 AM, Too_Many_Tools wrote:
>>>>> LOL...like you losers needed any more bad press.
>>>>>
>>>>> The most HATED political fringe group in America!!!
>>>>>
>>>>> Will the accident rate among Tea Party members go up in 2013...you bet
>>>>> it will!
>>>>>
>>>>> TMT
>>>>>
>>>>> p.s. You dumb conservative shits just helped me win over 11 steak
>>>>> dinners.
>>>>
>>>> Watch out! It's a trick!
>>>>
>>>> <http://health.yahoo.net/articles/healthcare/photos/biggest-health-stories-...
>>>>
>>>> "For the first time, researchers estimated the effect of red meat on a
>>>> person's lifespan?and the news wasn't good.
>>>>
>>>> On average, each additional serving of saturated fat-filled red meat was
>>>> associated with a 13% higher risk of dying during the 28-year study."
>>>
>>> So if I ate a steak a day for 10 days...Id die about day 8 or 9?
>>>
>>> Fascinating!
>>
>>
>> According to their figures, my relatives who ate red meat every day
>>from the time they were put on solid food until they died in their 90s
>> would have lived thousands of years, if they were vegietarians? Or
>> would it just seem that way?
>
> Thats what Im seeing as well.

The word "higher" didn't register in those little brainstems. A 13%
_higher_ risk is not the same as a 13% risk.

> Whodathunkit!

For sure, not you or Terrell.

pyotr filipivich

1/2/2013 11:27:00 AM

0

Let the Record show that Gunner <gunnerasch@gmail.com> on or about
Tue, 01 Jan 2013 04:29:26 -0800 did write, type or otherwise cause to
appear in talk.politics.guns the following:
>On Tue, 01 Jan 2013 04:35:34 -0500, Tom Gardner <Mars@Tacks> wrote:
>
>>On 1/1/2013 3:45 AM, Gunner wrote:
>>> So if I ate a steak a day for 10 days...Id die about day 8 or 9?
>>>
>>> Fascinating!
>>>
>>>
>>> Gunner
>>
>>Probably of boredom. Unless you pick up a 5-bone prime rib and cut your
>>own steaks from that. Just a little salt and pepper then a 700 deg.
>>plus charcoal sear then finished to rare/med-rare on the "cool" side of
>>the grill.
>>
>>But I'd rather insert some chicken, fish and vegetarian days in there.
>
>But of course! Some steamed rice, brussels sprouts with cheese,
>mustard beans and a big glass of milk!
>
>Yummy!!

I've been introduced to the "Fried Onions and Greens" basic side
dish. Caramelized Onions are yummy. Brunch was that with some
sausage sliced in while cooking, and broiled lamb chops with a house
special honey mustard sauce.

Got to get me some cabbage and apples. Yeah, my SO is a good
cook, and she's learning me.
--
pyotr filipivich
Question for the gun Control advocates, "Do you agree with
this statement?"
"I would rather have a society without guns, even if it
means that people cannot defend themselves against murder
(with other weapons), rape, robbery, and assault. I would
rather make everyone defenseless than have to endure the
mass shootings that occasionally occur. If that means that
many more people, (particularly the old, the weak, and the
infirm) are subjected to these violent crimes, then so be
it. They'll just have to suffer more. I do claim the power
to dictate whether or not others are able to defend themselves."

SaPeIsMa

1/2/2013 1:50:00 PM

0


"Beeper" <ibeep@u.com> wrote in message
news:kbuuqb$uvd$1@speranza.aioe.org...
> On 01/01/2013 03:05 AM, Gunner wrote:
>> On Tue, 01 Jan 2013 03:51:40 -0500, "Michael A. Terrell"
>> <mike.terrell@earthlink.net> wrote:
>>
>>>
>>> Gunner wrote:
>>>>
>>>> On Tue, 01 Jan 2013 00:13:20 -0800, Beeper <ibeep@u.com> wrote:
>>>>
>>>>> On 01/01/2013 12:02 AM, Too_Many_Tools wrote:
>>>>>> LOL...like you losers needed any more bad press.
>>>>>>
>>>>>> The most HATED political fringe group in America!!!
>>>>>>
>>>>>> Will the accident rate among Tea Party members go up in 2013...you
>>>>>> bet
>>>>>> it will!
>>>>>>
>>>>>> TMT
>>>>>>
>>>>>> p.s. You dumb conservative shits just helped me win over 11 steak
>>>>>> dinners.
>>>>>
>>>>> Watch out! It's a trick!
>>>>>
>>>>> <http://health.yahoo.net/articles/healthcare/photos/biggest-health-stories-...
>>>>>
>>>>> "For the first time, researchers estimated the effect of red meat on a
>>>>> person's lifespan?and the news wasn't good.
>>>>>
>>>>> On average, each additional serving of saturated fat-filled red meat
>>>>> was
>>>>> associated with a 13% higher risk of dying during the 28-year study."
>>>>
>>>> So if I ate a steak a day for 10 days...Id die about day 8 or 9?
>>>>
>>>> Fascinating!
>>>
>>>
>>> According to their figures, my relatives who ate red meat every day
>>>from the time they were put on solid food until they died in their 90s
>>> would have lived thousands of years, if they were vegietarians? Or
>>> would it just seem that way?
>>
>> Thats what Im seeing as well.
>
> The word "higher" didn't register in those little brainstems. A 13%
> _higher_ risk is not the same as a 13% risk.
>

The problem is that neither you nor the idiots you were quoting defined what
was the base that was higher
Apparently it was such a minuscule number as to be meaningless
Why don't you come back when you have something more credible.