Re: [python-win32] How to create a com_record?

2008-03-11 Thread Kevin Patterson
I found the comtypes equivalent if that helps any. The generated comtypes file looks like this: COMMETHOD([dispid(1610743812), helpstring(u'GetInterface() method')], HRESULT, 'GetInterface', ( ['in'], POINTER(GUID), 'riid' ), ( ['retval', 'out'], POINTER(POINTER(IUnk

Re: [python-win32] win32gui.EnumWindows, documentation?

2008-03-11 Thread Tim Golden
Julius wrote: > Hi, > > im new to python in generell and was wondering where i would find the > api to win32gui.EnumWindows? > I know one of its arguments is a callback function, but i cant find any > information how it should look like? > > Is this another win32 python implementation or is the s

Re: [python-win32] win32gui.EnumWindows, documentation?

2008-03-11 Thread Tim Roberts
Julius wrote: > My fault(already got that one running), i meant the > win32gui.EnumChildWindows(currentHwnd, windowEnumerationHandler, > childWindows) > function. > > from what i understand the purpose of this function is to return the > childwindows from a top window - if this is right why not ju

Re: [python-win32] win32gui.EnumWindows, documentation?

2008-03-11 Thread Julius
My fault(already got that one running), i meant the win32gui.EnumChildWindows(currentHwnd, windowEnumerationHandler, childWindows) function. from what i understand the purpose of this function is to return the childwindows from a top window - if this is right why not just pass a topwindow as argu

Re: [python-win32] win32gui.EnumWindows, documentation?

2008-03-11 Thread Rickey, Kyle W
I like using lambda for this, but you could also put it into a function. windows = [] win32gui.EnumWindows(lambda hwnd, resultList: resultList.append(hwnd), windows) This will populate windows with all the hwnds. -Kyle Rickey -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PRO

[python-win32] win32gui.EnumWindows, documentation?

2008-03-11 Thread Julius
Hi, im new to python in generell and was wondering where i would find the api to win32gui.EnumWindows? I know one of its arguments is a callback function, but i cant find any information how it should look like? Is this another win32 python implementation or is the site just called activestate? I

Re: [python-win32] How to create a com_record?

2008-03-11 Thread Kevin Patterson
Old thread, but I got a little more data on the function. The function actually has a REFIID as the first parameter. This apparently is a standard structure for C COM code. I'm not entirely sure why the win32com changes the REFIID to be a VT_RECORD. Does the following definition of the functions h

Re: [python-win32] embedding IPython in a windows dll

2008-03-11 Thread mani sabri
>-Original Message- >From: [EMAIL PROTECTED] [mailto:python-win32- >[EMAIL PROTECTED] On Behalf Of Tim Roberts mani sabri wrote: >> I want to run a Python shell from a DllMain() function. > >It isn't safe to do this much processing in a DllMain. There is a >thing called the "loader loc

Re: [python-win32] advice on architecting or program design in python:

2008-03-11 Thread mark.a.brand
Python is that refactoring is usually really easy. thats a good thing to know. i was originally going to just start out the naive way and refactor as python became more familiar. i think that approach may work best for me - take baby steps and refactor as i my knowledge and experience grows.

Re: [python-win32] advice on architecting or program design in python:

2008-03-11 Thread Tim Golden
mark.a.brand wrote: > Hi Tim: > > Thanks, that was what I was after, but maybe you are right a couple of extra > for loops is not looking too bad after all. The code looks a little scary at first sight but it's not that bad ;) It's one of those things everyone learns to weigh up when they're put

Re: [python-win32] advice on architecting or program design in python:

2008-03-11 Thread mark.a.brand
Hi Tim: Thanks, that was what I was after, but maybe you are right a couple of extra for loops is not looking too bad after all. Cheers Mark On 11/03/2008, Tim Golden <[EMAIL PROTECTED]> wrote: > > Tim Golden wrote: > [... snip Elixir-based solution ...] > > I realise, rereading my post that it

Re: [python-win32] advice on architecting or program design in python:

2008-03-11 Thread mark.a.brand
Hi Tim: So what you are saying is that it would be perfectly acceptable to have a "for loop" for each Win32_* query and that there is no good way to generalise that behaviour. eg. class Process() ... class Product() ... class Event() ... class Service() if __name__ == '__main__'

Re: [python-win32] advice on architecting or program design in python:

2008-03-11 Thread Tim Golden
Tim Golden wrote: [... snip Elixir-based solution ...] I realise, rereading my post that it doesn't really solve your concern about multiple loops etc. I doubt it's really a problem, but in the spirit of the question, here's a raw sqlite solution, again Noddy and untested. You've said you're newi

Re: [python-win32] advice on architecting or program design in python:

2008-03-11 Thread Tim Golden
mark.a.brand wrote: > sorry - client as in customer Ah. I see. (Didn't think of that :) > i will try and explain better, but its not quite clear in my mind what is > achievable ... > > so to build up these database tables, i have to have some queries happening > of the form : > > for list in Wi

Re: [python-win32] advice on architecting or program design in python:

2008-03-11 Thread mark.a.brand
> > hi: > > > Not that it's necessarily wrong, but it's not clear why you're bothering > to pull server information from each client separately. It's not as > though the services running on Server S1 will appear different when > queried from client C1 and C2. But maybe there's something I'm missin

Re: [python-win32] advice on architecting or program design in python:

2008-03-11 Thread Tim Golden
mark.a.brand wrote: > hi: > > i am new to python and wish but am writing a program as both a learning > experience and which may even get used if it is any good. Welcome to the wonderful world of Python :) > purpose of this program: > is to retrieve and store (for historical purposes) system-inf

Re: [python-win32] OE/WAB help with VB ...

2008-03-11 Thread Clinton Lee Taylor
Greetings ... Thanks again for the quick response ... > Clinton Lee Taylor wrote: > > I think I get this because com objects have to be "imported" ... But > > this ActiveX object does not seem to have a "type lib"? ... > It appears the type info is embedded in the dll itself, rather than > s