windows-xp

Using VB6, how do I get the current user and domain on Windows XP?

≯℡__Kan透↙ 提交于 2019-12-18 06:31:30
问题 I need the current user and the domain. I am using a VB 6 application. Thanks 回答1: One way would be to ask the environment: Dim UserName As String Dim UserDomain As String UserName = Environ("USERNAME") UserDomain = Environ("USERDOMAIN") (Works on Windows NT and up only, obviously.) 回答2: And the API-version: Private Declare Function GetUserName Lib "advapi32.dll" Alias "GetUserNameA" (ByVal lpBuffer As String, nSize As Long) As Long Declare Function LookupAccountName Lib "advapi32.dll" Alias

How to run another app as administrator on Windows XP

邮差的信 提交于 2019-12-18 06:16:13
问题 I used the application manifest file as described here to have a part of my application running with elevated privileges (which it needs). So when needed, the main program just invokes a small assembly using Process.Start which then handles the task for which admin rights are required. However, how can I do the same thing on Windows XP? It seems XP just ignores this manifest and runs the small assembly in the current user context. 回答1: The following code from here does just what I need:

Python 2.6 on Windows: how to terminate subprocess.Popen with “shell=True” argument?

徘徊边缘 提交于 2019-12-18 06:08:31
问题 Is there a way to terminate a process started with the subprocess.Popen class with the "shell" argument set to "True"? In the working minimal example below (uses wxPython) you can open and terminate a Notepad process happily, however if you change the Popen "shell" argument to "True" then the Notepad process doesn't terminate. import wx import threading import subprocess class MainWindow(wx.Frame): def __init__(self, parent, id, title): wx.Frame.__init__(self, parent, id, title) self.main

Python 2.6 on Windows: how to terminate subprocess.Popen with “shell=True” argument?

為{幸葍}努か 提交于 2019-12-18 06:07:23
问题 Is there a way to terminate a process started with the subprocess.Popen class with the "shell" argument set to "True"? In the working minimal example below (uses wxPython) you can open and terminate a Notepad process happily, however if you change the Popen "shell" argument to "True" then the Notepad process doesn't terminate. import wx import threading import subprocess class MainWindow(wx.Frame): def __init__(self, parent, id, title): wx.Frame.__init__(self, parent, id, title) self.main

Porting getifaddrs to Win XP

末鹿安然 提交于 2019-12-18 05:56:21
问题 I'm trying to port a MacOSX app to windows and I've come up against a problem around getifaddrs. Basically windows does not support it. I'm trying to figure a way to re-implement it (for AF_INET and AF_INET6) but the "equivalent" functionality on windows appears to be nothing like the MacOSX support. Has someone done this sort of conversion before? If so is there a nice way I can get windows to report me interface info like MacOSX does? 回答1: The closest functions on Windows are

Team is Going from XP32 to XP64 for .NET Development - Any Gotchas?

ぃ、小莉子 提交于 2019-12-18 05:05:07
问题 My team is getting new XP64 workstations. We've been using XP32 up until now. Most of our work is done in managed C#/VS2008/.net 3.5 and SQL Server 2005. However we do have a couple apps that are still in VS2005/.net 2.0. The majority of our applications are ASP.NET webforms apps and WCF services that are running on 64bit servers in production. However, we have some WPF development going on that will have to run on 32bit machines. Are there any gotchas or transition pains we should be aware

os.exec on Windows

强颜欢笑 提交于 2019-12-18 04:46:12
问题 I have a script that calls os.execvp into another Python instance. After doing this, I appear to be attached to a cmd.exe instance, not the Python instance I just created. The Python instance responds to Ctrl+C however. H:\bin>Python 3.2.1 (default, Jul 10 2011, 21:51:15) [MSC v.1500 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> print('hi') Can't find file ('hi') H:\bin> H:\bin> KeyboardInterrupt >>> echo hi hi The call to exec : from sys

How can I freeze the execution of a program?

别说谁变了你拦得住时间么 提交于 2019-12-18 04:08:31
问题 Say I have got a program that hogs the processor and/or hard disk to the point that it makes it nearly impossible to do anything else on that computer. Now I don't want to kill that program because what it does is useful (it's a batch job that really is that CPU or disk heavy, e.g. it could ZIP a few gigabytes of data files) but for a short time I need to do something else on that computer. Is there any way an external program could do to freeze that performance killer for a while? It's like

How to create own XP printer driver

雨燕双飞 提交于 2019-12-17 23:43:53
问题 How would I create my own XP printer driver which will do the following: print to file (probably XPS format) put this file into a password protected ZIP file email the zip file to a configured email address 回答1: What you need is not a printer driver. One named it Print Monitor . It is a DLL, which will be loaded in Spooler.exe process. The DLL gives Spooler at the initialisation phase a logical names of ports like LPT1:, FILE:, SPSPort: etc. The optput prepared with a printer driver must be

C#: How to wake up system which has been shutdown?

元气小坏坏 提交于 2019-12-17 23:15:19
问题 Is there any Win32 API for waking up a system that has been shut down, at a specific time? I have seen a program named Autopower On which is able to power the system on at a specified time. 回答1: Got the below post from a site. Any body tried this? Nothing in the framework, so you'll have to "PInvoke" a bit. The API's you need to call are CreateWaitableTimer and SetWaitableTimer. Following is a complete (Q&D) sample that illustrates how you can set a system to be awoken from sleep/hibernate