Running Win32 DLL functions

O

Ondrej Sevecek

Hello,
is there some program (I need one from either Windows, SupportTools or
ResourceKit) which would be able to call ANY of Win32 DLL functions? Use of
RUNDLL32 is not allowed as Win32 .DLL do not provide this functionality
(they havent the required entry point function).

Ondra.
 
M

Matthias Tacke

Ondrej Sevecek said:
Hello,
is there some program (I need one from either Windows, SupportTools or
ResourceKit) which would be able to call ANY of Win32 DLL functions?
Use of RUNDLL32 is not allowed as Win32 .DLL do not provide this
functionality (they havent the required entry point function).
Did you miss the right ng Ondra?
IMO using the windows api function from a batch isn't possible without
at least programming a wrapper to handle transforming of params and io.

And then this is a programming task not a batch one.

hth
 
O

Ondrej Sevecek

E? The only problem is that there is perhaps no such program providing the
wrapper functionality.
I would make it myself but first wanted to know if it is neccessary.
By the way, what's "ng"?

Ondra.
 
M

Matthias Tacke

Ondrej Sevecek said:
E? The only problem is that there is perhaps no such program providing the
wrapper functionality.
I would make it myself but first wanted to know if it is neccessary.
By the way, what's "ng"?

Ondra.
newsgroup ?
 
M

Mark_Pryor

Ondrej Sevecek said:
Hello,
is there some program (I need one from either Windows, SupportTools or
ResourceKit) which would be able to call ANY of Win32 DLL functions? Use of
RUNDLL32 is not allowed as Win32 .DLL do not provide this functionality
(they havent the required entry point function).

Ondra.

If you are willing to use a 3rd party Script Interpreter,
IMO, the best one to get at the Win32API is ActivePyton 2.2,
or higher. see

http://www.activestate.com/Products/ActivePython/

This product is tailor made to quickly edit script and solve
problems in Windows. The learning curve is not as steep as
Perl, while the functionality hammers the WSH (VBScript & JScript).

Here's a trivial Python script to enum the License Hive in the
Registry:

#!/usr/bin/python
'''
keywords: registry enum license typelib
description: scriptlet to enum a subkey collection
date: 11/8/02 3:03PM
'''

import os, sys
import win32api as wi
import win32con as wc
import string as st
#exercise to enumerate a subkey collection

# try this for the Licenses key, then the TypeLib key
kName = "Licenses"
kName = "TypeLib"

# get a handle
pyk = wi.RegOpenKey( wc.HKEY_CLASSES_ROOT, kName)

# get key info, num1 has the key count
( num1, vals, works) = wi.RegQueryInfoKey( pyk )
print num1, vals, works
nt = 0
guid = wi.RegEnumKey( pyk, nt )
nt = nt + 1
#
done = 0
for nt in range(num1):
guid = wi.RegEnumKey( pyk, nt)
svers = ''
if kName == "TypeLib":
'''
for TypeLibs we need to step down to the version key and
read the help string (default value)
'''
pyj=wi.RegOpenKey(wc.HKEY_CLASSES_ROOT,os.path.join(kName,guid))
(num2, val2, work2) = wi.RegQueryInfoKey(pyj)

if num2 > 0:
# we are ingnoring multi versions, like Ado (2.1, 2.5, 2.7, etc)
svers = wi.RegEnumKey( pyj, 0)
valkey = wi.RegQueryValue( pyj, svers)

else:
valkey = wi.RegQueryValue( pyk, guid)

print guid, svers, valkey
nt = nt + 1

pyk.Close()
sys.exit()
# end code

hagd,
msp
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top