Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Creating a Process with an Impersonated User
Message
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Miscellaneous
Thread ID:
01059576
Message ID:
01059589
Views:
17
Fernando,

Probably it's similar to your Long2Str function
FUNCTION num2dword(lnValue)
#DEFINE m0  0x0000100
#DEFINE m1  0x0010000
#DEFINE m2  0x1000000
	IF lnValue < 0
		lnValue = 0x100000000 + lnValue
	ENDIF
	LOCAL b0, b1, b2, b3
	b3 = Int(lnValue/m2)
	b2 = Int((lnValue - b3*m2)/m1)
	b1 = Int((lnValue - b3*m2 - b2*m1)/m0)
	b0 = Mod(lnValue, m0)
RETURN Chr(b0)+Chr(b1)+Chr(b2)+Chr(b3)
* * *
You can find constants here:
http://www.news2news.com/vfp/w32constants.php

* * *
cApp -- application name, second parameter, like "c:\windows\notepad.exe"

cCmd -- command line, third parameter, like "mytext.txt", note that I add a space before it when calling the function
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform