windows

Thought experiment with __stdcall and corrupted stack (C++)

My mind was wandering today on the topic of function pointers, and I came up with the following scenario in my head: __stdcall int function (int) { return 0; } int main() { (*(int(*)(char*,char*))function)("thought", "experiment"); return 0; } AFAIK this code would corrupt the stack, so what types of issues could I be loo...

Export To Excel Fom DataGrid VB.Net Windows Application

I need to Export DataGrids' Contents to Excel using VB.Net for a Window based Application. How to do this.. any ideas ? ...

Temporarily Hide a Modal Dialog

I have a modal dialog displayed with the main application window set as owner (as in dialog.ShowDialog(mainAppWindow)) and I would like to temporarily allow the user to interact with the main application window before returning to the modal dialog again. How can I do this? I am using Windows Forms. Edit: AutoCAD does this well. ...

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

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 w...

Create user account with VBScript

Hi, I'm using this code to create user account, Function CreateUserAccount (acc, paas) Dim WinUserAccountName, WinUserAccountPass WinUserAccountName = Session.Property("WIN_USER_ACCOUNT") WinUserAccountPass = Session.Property("WIN_USER_PASS") strComputer = "." set objSystem = GetObject("WinNT://" & strComputer) set objUser = o...

Using Base SAS to validate Windows Password

We have a signon script that requires a Windows password in order to access and validate against the SAS metadata server. The problem is that if the windows password is changed, and the script is run a few without being updated, then the user gets locked out and has to call IT support for a password reset. What is the simplest way of u...

What could cause the application as well as the system to slowdown?

I am debugging an application which slows down the system very badly. The application loads a large amount of data (some 1000 files each of half an MB) from the local hard disk.The files are loaded as memory mapped files and are mapped only when needed. This means that at any given point in time the virtual memory usage does not exceed 3...

How to interface with Windows Media Player in C#

I need to synchronize Windows Media Player with my application. I want to show the current song that WMP is playing in a ListBox in real time, with updates when WMP changes songs. How can I implement this? ...

Using shared memory under Windows. How to pass different data

I currently try to implement some interprocess communication using the Windows CreateFileMapping mechanism. I know that I need to create a file mapping object with CreateFileMapping first and then create a pointer to the actual data with MapViewOfFile. The example then puts data into the mapfile by using CopyMemory. In my application I ...

Windows recursive grep command-line

I need to do a recursive grep in Windows, something like this in Unix/Linux: grep -i 'string' `find . -print` or the more-preferred method: find . -print | xargs grep -i 'string' I'm stuck with just cmd.exe, so I only have Windows built-in commands. I can't install Cygwin, or any 3rd party tools like UnxUtils on this server unfort...

Refreshing the Windows XP font cache via a script

Does anyone know how to force windows XP to rebuild the list of installed fonts without needing a reboot. They seem to have been installed correctly since everything works as expected after a reboot but I would like to avoid that reboot. ...

What's the difference between calling CComModule.RegisterServer, _AtlComModule.RegisterServer, and LoadTypeLibEx for TypeLib registration?

In my DllRegisterServer method of my COM dll, I previously had code that called LoadTypeLibEx(module, REGKIND_REGISTER, &pTypeLib) to register my COM classes and their corresponding TypeLib's. My COM DLL is a 64-bit. I've noticed that on my 64-bit Vista system, under HKCR:\\TypeLib\{myguid}\1.0\0 I find a win32 subkey with the location t...

How can I access the MySQL command line with XAMPP for Windows?

How can I access the MySQL command line with XAMPP for Windows? ...

monitor cpu usage per thread on windows mobile device

Is is possible to measure CPU per thread on a windows mobile (or CE 5) device programmatically (c++)? If not, is their a utility that will monitor the CPU usage of a process? ...

InvalidateRect in WM_CREATE does not work

I want to invalidate the window when it's created. How can I do that? calling InvalidateRect during WM_CREATE doesn't work. The thing is I call SetWindowLongPtr in WM_CREATE and set GWLP_USERDATA. WM_PAINT looks for some pointer in USER_DATA but the first time I receive WM_PAINT the data isn't apparently still there so it doenst paint m...

Learning Audio Manipulation

I want to learn how applications like CakeWalk, Cubase, and ProTools are built. Are there any good resources out there to learn this type of development? Resources Digital Signal Processing Basics ...

how do i get rid of mid spaces in an environment variable

how do i get rid of mid spaces in an environment variable suppose i have the following for loop fragment that get free disk space size of a certain disk for /f "tokens=3" %%i in ('dir ^| find "Dir(s)"') do set size=%%i would result something like this C:\>set size=129,028,096 i wanted to get rid of delims as follows for /f "deli...

navigating through different drive letters in python os.system

I am having a problem with a bit of code on one windows machine but not all windows machines. i have the following code: path = "F:/dir/" os.system(path[0:2] + " && cd " + path + " && git init") On all but one of my windows systems it runs fine but on a windows 2003 server it gives a "directory not found" error but if i run the same c...

Receiving an ICMP packet in the context of a service on 2008

When we send a packet from a udp port we receive an exception if the network returns an ICMP host unreachable. The exception doesn't tell us anything useful (like the contents of the ICMP packet). No problem, we'll just listen for ICMP and that will give us the info we need, while ignoring the exception on the UDP port. So, open a raw s...

How can I write a program which can test throughput of disk?

How can I write a program which can test throughput of disk in Windows systems using c++? What's the mainly steps and APIs that I can use to programming? ...