winapi

tried to update hudson via dashboard and now it doesn't work (windows)

I get the following now in the output log. I really wish I hadn't attempted to update the version. What a hassle. Can anyone diagnose the issue here? Was trying to go from Hudson ver. 1.341 to the latest. 1.361? All I see now when I go to the hudson url is: Please wait while Hudson is restarting... Your browser will relo...

Finding Windows printer driver name using API

I can't seem to find an API call that returns the driver name for a Windows printer. Note that I'm not talking about the friendly name of the printer in the printer folder, I'm talking about the name of actual driver being used as shown on the "Advanced" tab when you look at the printer properties: I'm trying to detect when I'm printi...

What is this (C/C++) program doing?

It's calling these API functions (advapi32.dll) with these parameters: CryptCreateHash ( 3275488, 32771, 0, 0, 1243424 ); CryptHashData ( 3203040, 'UY30930037661', 13, 0 ); CryptCreateHash ( 3276304, 32771, 0, 0, 46463812 ); CryptHashData ( 3203296, '-585164138661', 10, 0 ); CryptCreateHash ( 3276304, 32771, 0, 0, 46463808 ); CryptH...

How can I work out what events are being waited for with WinDBG in a kernel debug session

I'm a complete WinDbg newbie and I've been trying to debug a WindowsXP problem that a customer has sent me where our software and some third party software prevent windows from logging off. I've reproduced the problem and have verified that only when our software and the customers software are both installed (although not necessarily ru...

How to mute microphone in Windows 7 with C/C++?

I made a program to mute microphone using WinAPI and it seems to work perfectly in Windows XP but doesn't do a thing in Windows 7. Is it possible to control microphone volume or mute with WinAPI in Windows 7? void setVolume(DWORD volume) { HMIXER mixer; if (mixerOpen(&mixer, 0, 0, 0, 0) != MMSYSERR_NOERROR) { MessageBoxW(NULL, L"Er...

SQLConfigDataSource creates invalid datasource

I am using SQLConfigDataSource to create an ODBC MS Access data source programmatically. It works most of the time, but fails if the DBQ value (i.e., path to the Access database) in the lpszAttributes string contains more than 148 characters (far fewer than MAX_PATH). Has anyone ever run into this before? Any possible workarounds? ...

Identify which executable is throwing a runtime error

I have a program that is throwing a run-time error dialog. Is there a way to programmatically detect which executable is the parent of this dialog box from another process? ...

Getting USB Storage Device Instance ID (unique ID) programmatically

Whenever user plug a USB mass storage device, how to get the Device Instance ID (unique ID) of that particular device programmatically? ...

How to have a MSI package to change installed Win32 application compatibility options

Our Win32 applications need to write in their installation directory. So under Windows 7 and Server 2008, this requires administrator rights. Currently we manually check the "run as administrator" option in the properties/compatibility tab of the EXE file. Is there a way to do this automatically during the installation of the MSI? ...

Win32 ShowWindow API and WPF

I am writing a desktop application that requires only one instance running, means if there is already running application instance, when another application instance runs, it check and shows actives the running application and exit itself quietly. I can get the running window's hwnd handle, but when I use ShowWindow API to show that wind...

Win32Shutdown Method of the Win32_OperatingSystem Class

Does anyone can describe me the difference between "Forced Shutdown" and "Forced Power Off" ? Thanks :) ...

Correct way to replace CHeaderCtrl with custom version in a CListCtrl

CListCtrl has a CHeaderCtrl 'built-in' and we want to override it with something customized, i.e a class which derives from CHeaderCtrl. What's the best/correct way to do this, assuming we have a dialog CMyDlg which contains a CListCtrl m_List, and a custom header CCustomHeader. ...

Is there a set of Win32 API functions to manage synchronized queues?

Hi, I have a program with several worker threads, and a main thread that receives jobs. In the main thread I want to queue the jobs onto a synchronized queue, and have the worker threads sitting there all waiting on the queue. When there's something in the queue I want the worker to pull the job from the queue, while the remaining work ...

Vertical Rebar (WinAPI)

I was wondering if it was possible to make a Rebar that goes vertically instead of controls horizontally? Thanks ...

boost::threads - how to do graceful shutdown?

I'm trying to improve the portability of a C++ app by using boost:threads instead of our own wrapper over Win32 threads, and the issue of graceful thread termination (again) rears its ugly head. On pure win32, I 'interrupt' threads by using QueueUserAPC to throw a "thread_interrupt" exception which causes all RAII objects to cleanup on ...

Get window z index from window handle

If I have a window handle, is there a win32 call or .net equilavent that will tell me what the z index is? ...

Python win32api registry key change

Hi, I am trying to trigger an event every time a registry value is being modified. import win32api import win32event import win32con import _winreg key = _winreg.OpenKey(_winreg.HKEY_CURRENT_USER,'Control Panel\Desktop',0,_winreg.KEY_READ) sub_key = _winreg.CreateKey(key,'Wallpaper') evt = win32event.CreateEvent(None,0,0,None) win32api...

Is it safe to catch EXCEPTION_GUARD_PAGE

Environment is VC++ 9 on various Win platforms (XP and later) I'm writing an unhandled exception handler. I have a vague recollection from my kernel days that it was bad to catch an EXCEPTION_GUARD_PAGE, as this was generated to tell the OS to enlarge the stack. My question is twofold: Can such an exception occur in user space? If s...

Which Win32 API reports the Format preference in the Region and Language control panel?

Windows 7 and Windows Vista have a Region and Language control panel which contains a Formats tab which contains a popup menu titled Format. This menu allows the user to select from among many language-oriented sets of number, currency, time, and date formatting preferences regardless of the language of the base system. For example, I co...

synchronize Mouse wheel scroll for two independent windows

Hi.. I want two independent windows to be scroll synchronously using WIN32 C++. Right now whichever window in focused, scroll is working for only that window. But my requirement is like, with a single scroll both the windows should scroll..some one suggested me to send same scroll message for other window also...but MSDN says WM_HSCROLL...