windows

how to hide cmd shell window ?

on start up i have a bat file run routine things for me however, the black console pops up and stays open until everything is finished.... anyway to hide it and run it in background ? so it shouldn't appear minimized or system tray. ...

When/why should heapmin be used?

A customer has some memory usage requirements of our application. They note that while our committed memory is reasonable, the reserved memory is high. They suspect this is because the CRT heap grows as we allocate memory, but the CRT isn't returning pages to the OS when the memory is deallocated. We are just using built-in operator ne...

Are the time functions of MSVC thread-safe?

In case of Linux, for time functions we have a _r versions Ex: localtime has localtime_r, but in Windows I am unable to find some such functions. Are the Windows time functions inherently thread-safe? ...

Set ip adress for network interface in Windows XP from java

I need to set IP adress on Windows XP machine from our Java APP. As I do not know any way how to set it purely from java I would like to use netsh to set it. Howerver as there are more than one interfaces I need to obtain special "long name" of network connection. Nethsh command will look like this: netsh interface ip set address ...

Is a single wxWidgets MSW application binary compatible across Win2K, XP, Vista, and 7?

wxWdgets is a cross-platform library that includes support for all the major windows versions, but I can't find anywhere in the wxWidgets documentation that says anything about the portability of a single MSW (windows) build of the wxWidgets library across different windows versions. Assuming my core app just uses vanilla C++ (and perh...

Last Runtime 9020 returned by Windows Scheduler

I implemented an update process for a piece of software using the Windows scheduler. It worked great until lately. For some reason the task entered in the Windows Scheduler is not executed anymore. I suspect that the configuration of the target system changed, but I do not know in which way. The command schtasks /query /V /FO list retur...

Comparing and sorting Unicode filenames

Using Delphi 2007 and TMS components for Unicode utils and interface (upgrading to Delphi 2009 for Unicode support is not an option). I'm storing a list of filenames in a string list (TTntStringList). It's sorted and case insensitive. The default sort routine uses CompareStringW(LOCALE_USER_DEFAULT, NORM_IGNORECASE, ...) to compare stri...

Windows, getting CLSID for DLL?

I want to have a small app to add and remove user defined context menu entries from the registry. To make this somehow I need to get the CLSID of an arbitrary DLL so I can back up previous entries if they exist and then write new ones. Although regsrv32 somehow manages to create this magical number, I didn't find any answer with google. ...

Get the process handle of a process by image name

I need the simplest way from C using Win32 to get the process handle of another process by its executable file name. The process I am looking for does not have any registered window classes. I also know that if it is running there will be only one instance of it running. ...

How to enumerate all windows within a process?

I need to capture particular windows of 3rd party process. I can find main window handle as Process.MainWindowHandle, but what I can use to list other windows? I am using C# / .NET ...

Advertise service with Bonjour on Windows

Hi! I'm developping a remote control on iPhone for Mac OS and Windows. I use Bonjour framework and it's working well on Mac OS. I can see on my iPhone the different Mac devices which have my server. I would like to do the same thing on Windows with language C or C#. I haver wrote a piece of code it does'nt work : my iPhone does'nt see ...

Impersonate standard user

Hi I am trying to make a running process of mine which is elevated to restart explorer using the standard user token. What I'm doing is first I run the main process as an administrator, then I take a snapshot of the running: if (Process32First(hSnapshot,&pe32)) { do { if (!wcsicmp(pe32.szExeFile, L"expl...

Which DVCS for a one-man .NET shop?

I'm the only developer working in a very small company. I currently use VisualSVN on Windows on my development machine as my VCS. This is problematic because I can't get to my projects outside the IT firewall, and my colleague can't integrate his content into my projects. We (my PM, who develops content for me) are very interested in a...

Using Windows Explorer context menus within WPF

Hello All, Is there a way to gain access to the Windows Explorer shell context menus for files & folders without using a complete Explorer drop-in control? The gist of my plight is this: I have a Viewport3D that displays a handful of raw files & folders. Basically, it's like every other 3d explorer replacement you've ever seen :) W...

Python, trying to run a program from the command prompt

Hi All, I am trying to run a program from the command prompt in windows. I am having some issues. The code is below: commandString = "'C:\Program Files\WebShot\webshotcmd.exe' //url '" + columns[3] + "' //out '"+columns[1]+"~"+columns[2]+".jpg'" os.system(commandString) time.sleep(10) So with the single quotes I get "The filename, di...

How to insert colored text int a ListView?

Hi! I have a listview with 3 coloumns. The first two columns has values and the third one is empty yet. I want to know, how can i insert a colored text later into the third column? I don't want to color the full row, only the third column with changing colors. Thanks in advance! kampi ...

Saving image as JPG -library?

I'd like to find a JPEG-writing library that can be statically linked (so there are no DLL dependencies). No JPEG-reading ability is required. Edit: I got LibGD working, but it had one problem described here: http://stackoverflow.com/questions/2307965/libgd-library-is-not-working-crash-when-saving-image ...

How does the COMSPEC environmental variable effect a cgi executable?

It appears that a cgi app (in C, VS C++) does not inherit the COMSPEC environmental variable. When adding the variable to the application: _putenv( "COMSPEC=C:\\WINDOWS\\system32\\cmd.exe" ); // C4996 the cgi application no longer executes from the browser but is interpreted as a file for download. (i.e. - Save this file?) My quest...

Out of proc function call and HANDLE type returned (Windows C++)

I need to call one function using maximum privileges (NT AUTHORY\System) from other process (IIS7 module work process) running in same local computer in much less privileged mode (NT AUTHORY\Network service). IIS module will call that function passing some text (user name) and that function need to return HADNLE type witch will be close...

How to minimize my application with the Windows+m keyboard shortcut?

I have a simple winforms application in VB.NET 2008. I am using a form with a completely custom look, so there is no title bar, thus no minimize, maximize, and close buttons. I've created custom controls to replace those. If I have my app running, and I click the 'Show Desktop' shortcut, all the programs minimize properly, including mi...