delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2016/04/04/10:04:56

X-Recipient: archive-cygwin AT delorie DOT com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:mime-version:in-reply-to:references:date
:message-id:subject:from:to:content-type; q=dns; s=default; b=Bk
ayuoDdjswtFDflKjF96CvUim5+YbPn/A/AYPmk2gGVavTMRoLN3hurFywpfKNl+O
3Dvu0flS+RPSuCbgGfS0dgvL6leqd2GH7FhpSC7EhL3S9Mcmi8WQJKDptFa0QXTA
dNXsjKYl1rZAfxgoHVtGj9EjngYu0ymrbQcIom/q8=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:mime-version:in-reply-to:references:date
:message-id:subject:from:to:content-type; s=default; bh=MUkE2/ha
b4+4P7aurtboGaDB30c=; b=r5uQMX/ZSHJkjeyQPbXrpxBkWqs21Kvi8l9wdyBO
du9GUW0dhR7BcrBaM4dXr/62bq8abirAyucTS4t30lmX+qej+TTB4qqV64uSrxUB
hIZzYTZhhDIOQ1UeyZCfjlvry2wD/b2RWBXAKuHlP94tTd3mCJENXvrdRJqArZ0k
Fn0=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 spammy=dap1bellsouthnet, dap1 AT bellsouth DOT net, H*i:sk:570266A, H*f:sk:570266A
X-HELO: mail-qg0-f52.google.com
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to; bh=sVQy9oud62EIkFCd5Kji9c8PU57oRPgw7s00Oyf+rZA=; b=fuolNshzibx/mNiEaiMQMdQ/4AVVlsnFKggrH/yKzvSTjvPKlI5Cnyva5/LB9aub4c guDSx3EaqNVpesoTkE1AATSLdCH81bMfuBeUJMJOozy+HinORXqcqqez9flHH/qCfxTr bI7XBGX1bflD6HAEw7OA4A3225FkyqkiOHQMo1PjeLLdyrALKG4QwwAAqrgKXYZRCHvW nRKmNrU3OsdzACKX6OqNRNQfP6ibVkL23CMbwbP910wRJVFGVZsl/bb49YyqQ/YLRphz 1BzQdC32uF7PMoyihDH0HEQi45ACfaOLFJKck0lg7PihpAfjLYdUx0Qy28Qfa/jC2UX7 uhtQ==
X-Gm-Message-State: AD7BkJKNyJFakFPUijdt0/37A01xUVLnX3qaa2Fbgm5dzU4jiW0NlHvOpa3F8QiJY/H/23x7jqBinh4gRp+kDw==
MIME-Version: 1.0
X-Received: by 10.194.59.138 with SMTP id z10mr18069481wjq.74.1459778660478; Mon, 04 Apr 2016 07:04:20 -0700 (PDT)
In-Reply-To: <570266A6.7020505@bellsouth.net>
References: <570233D4 DOT 5090103 AT bellsouth DOT net> <57023987 DOT 2060604 AT gmail DOT com> <570244A1 DOT 20302 AT bellsouth DOT net> <CAOYw7dsVeLK8-8kemWgfhxRL2gSgZiskiVTiamRHDBpOt0JN6Q AT mail DOT gmail DOT com> <57025EEB DOT 9080302 AT bellsouth DOT net> <570266A6 DOT 7020505 AT bellsouth DOT net>
Date: Mon, 4 Apr 2016 15:04:20 +0100
Message-ID: <CAOYw7dvnwUGBcTjZD9T=kepqnwrtbLvTo7QEYk0b4qpeh-_Mqg@mail.gmail.com>
Subject: Re: Installing python's pypiwin32
From: Ray Donnelly <mingw DOT android AT gmail DOT com>
To: cygwin AT cygwin DOT com
X-IsSubscribed: yes

On Mon, Apr 4, 2016 at 2:05 PM, Dennis Putnam <dap1 AT bellsouth DOT net> wrote:
> Hi Ray,
>
> I kind of found the problem. The import should be:
>
> from ctypes import *
>
> Now I am getting a message box but the characters in it are garbage. I
> was tried to send an image but apparently this list does not allow that.

Which version of Python are you using?

>
> Here is my trivial test program:
>
> #!/usr/bin/python
>
> from ctypes import *
>
> user32=cdll.LoadLibrary('/cygdrive/c/Windows/System32/User32.dll')
> mbw=getattr(user32,"MessageBoxW")
> mbw(0,'Hello world!!','Hello',2)
>
> On 4/4/2016 8:32 AM, Dennis Putnam wrote:
>> Hi Ray,
>>
>> Thanks. That is actually where I started but I was not aware I needed
>> those first 2 assignments. I did not find any examples of MessageBoxW
>> that included that detail. However, now I get a different error. I am
>> guessing there is another import I'm missing:
>>
>> Traceback (most recent call last):
>>   File "./test.py", line 5, in <module>
>>     user32=cdll.LoadLibrary('/cygdrive/c/Windows/System32/User32.dll')
>> NameError: name 'cdll' is not defined
>>
>> On 4/4/2016 7:05 AM, Ray Donnelly wrote:
>>> Yes, you can use the ctypes module [1] for this sort of thing:
>>>
>>> import ctypes
>>> user32=cdll.LoadLibrary('/cygdrive/c/Windows/System32/User32.dll')
>>> mbw=getattr(user32,"MessageBoxW")
>>> mbw(0,"Hello World","Caption",2)
>>>
>>> .. but I think the ctypes module on Cygwin's Pythons should support
>>> the windll stuff out of the box and it doesn't seem to, then you could
>>> just do ctypes.windll.user32.MessageBoxW(...) instead.
>>>
>>> [1] https://docs.python.org/2/library/ctypes.html
>>>
>>> --
>>>
>>> Best regards,
>>>
>>> Ray.
>>>
>>> On Mon, Apr 4, 2016 at 11:40 AM, Dennis Putnam <dap1 AT bellsouth DOT net> wrote:
>>>> On 4/4/2016 5:53 AM, Marco Atzeri wrote:
>>>>> On 04/04/2016 11:28, Dennis Putnam wrote:
>>>>>> I'm trying to install pypiwin32  and have hit a stone wall. That module
>>>>>> wants _winreg so I installed cygwinreg. However, I cannot find a way to
>>>>>> tell pip to use cygwinreg rather than _winreg. Is there a way to alias
>>>>>> or some way to get pip to use the right module? TIA.
>>>>>>
>>>>> I doubt the package is cygwin compatible
>>>>>
>>>>> --
>>>>> Problem reports:       http://cygwin.com/problems.html
>>>>> FAQ:                   http://cygwin.com/faq/
>>>>> Documentation:         http://cygwin.com/docs.html
>>>>> Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
>>>>>
>>>>>
>>>> If that is the case then is there another way to open message boxes
>>>> without running Xwin?
>>>>
>
>

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019