I have a c++ application in which threads could impersonate using LogonUser/ImpersonateLoggedOnUser, and then revert impersonation using RevertToSelf. I ran across the bug which caused thread to impersonate this way twice. I want to prevent this by testing if current thread is already impersonating and throw exception if it is. Is there ...
I am currently working on learning some different aspects of WINAPI, including features introduced in windows 7.. One of those is using a GUID as identifier for a Notification icon.
As can be read on the MSDN, the GUID is bound to the executable by path, the first time the notification icon is added. This page in question promises furth...
I am newbie in WinCE Programming, i want to Create Custom File Dialog for our application, which has totally diffrent look and feel than the default windows file dialog....
I looked into many Flag value bt they won't worth it ...
Any pointers will be helpful
Thnks...
Mukesh
...
I am newbie in MFC Programming, i want to Create Custom File Dialog for our application, which has totally diffrent look and feel than the default windows file dialog.... I looked into many Flag value bt they won't worth it ...
Any pointers will be helpful
Thnks... Mukesh
...
Hi
Given that I am on a workstation, that is inside a Windows Server domain.
In my data, I have the login name of the operator who has created the data.
When I print a presentation of this data, I want to display the first and last name
of this operator, which may be logged on another workstation of the domain... or even could even not...
There are already questions regarding unicode and ini files, but many of them are rather domain-specific. So I am not sure if the answer can be applied to the general case.
Motivation: I want to use ini files for storing simple data like some numbers and some strings. The strings are provided by users (input via GUI). The software could...
Hello. I need tree file at my asp.net site.
For getting icons I try use SHGetFileInfo api function.
At non asp.net application it works well, returns corrects Icon. When I conusme it at asp.net context I got:
Attempted to read or write protected memory.
What's wrong? Can I get fiel icon at asp.net context?
Code:
public class Extra...
I need to create a SDI form with a formview that has two tabs, which encapsulate multiple dialogs as the tab content. But the form has to have a colored background.
And things like these makes me hate programming.
First, I tried CTabControl, via resource editor, tried different things, but the undocumented behavior and the quirks with ...
Hi
I have an ATL based COM plugin and there is another 3rd party library that I want to use. It's not COM dll and implemented in C++.
details on 3rd party dll as follows:
Configuration type = Dynamic Library(.dll)
Use of MFC = Use MFC in a static library
Use of ATL = not using ATL
Character set = use multi-btye char set
CRL support...
My library performs a sequence of actions which result in a new (virtual) device node being added to the system. Assuming that everything is correctly configured the Windows PnP manager will respond by loading my function driver. This function driver will then proceed to create a device interface file which my library can open and inte...
I need to read (scan) a file sequentially and process its content.
File size can be anything from very small (some KB) to very large (some GB).
I tried two techniques using VC10/VS2010 on Windows 7 64-bit:
Win32 memory mapped files (i.e. CreateFile, CreateFileMapping, MapViewOfFile, etc.)
fopen and fread from CRT.
I thought that mem...
Here is the problem: I monitor a directory using Win32 API ReadDirectoryChangesW function. And I need to distinguish between newly created files and modified files. But there are problems... as always :(
Cases:
I monitor directory for new/modify (FILE_NOTIFY_CHANGE_FILE_NAME | FILE_NOTIFY_CHANGE_SIZE). Problem: After file creation, ne...
I looked at the GetAdaptersInfo() sample in MSDN:
http://msdn.microsoft.com/en-us/library/aa365917%28VS.85%29.aspx
and noticed that while the sample attempts to iterate through ALL adapters, it only allocates memory for the first one.
Is this a bug?
If not, why not? Do all adapters have the same info size?
To further clarify my ques...
My C Win32 application should allow passing a full command line for another program to start, e.g.
myapp.exe /foo /bar "C:\Program Files\Some\App.exe" arg1 "arg 2"
myapp.exe may look something like
int main(int argc, char**argv)
{
int i;
for (i=1; i<argc; ++i) {
if (!strcmp(argv[i], "/foo") {
// handle /foo
} e...
I'm writing some code to interface with a piece of hardware. The hardware connects to the PC via a USB with a USB-to-Serial converter inside the device (it shows up as a COM port device in Windows).
I'm having issues with the Win32 API ReadFile system call. I can't seem to get it to work as advertised. I've setup the COMMTIMEOUTS str...
Windows API
So i know that the WinForms touches on the Windows API a little, but frankly its horrible. ESPECIALLY with the layered windows and flickering. So i was wondering if anyone has wrote partial, or full wrappers for the Windows API.Im particularly interested in the Layered Window aspect, but really any part of the API is a goo...
This guys says yes:
http://web.tiscalinet.it/giordy/midi-tech/lowmidi.htm
Same with a really old book from 1998 (Maximum MIDI).
MSDN doesn't mention it.
I'm not getting any sound.
I fill a char buffer with status|note|velocity|status|note|velocity...
Set lpData, dwBufferLength, and dwFlags of a MIDIHDR struct
call midiOutPrepareHeader ...
Hey, I have simple 16-bit PCM player that I made using DirectSound.
But when it plays, it seems that it plays only one speaker instead of both.
I don't know what code to post exactly, so you'll have to tell me if you need any.
I can say that I create the sound buffer using, and lock the stream using:
WAVEFORMATEX wfx; ZeroMemory(&wfx...
I want my application to capture input focus, whenever the mouse hovers over it. How do I do it in Windows?
Basically I dont want users to explicitly click on the application, or the taskbar icon before entering any text, when the application is not in foreground.
I tried the SetForegroundWindow API in the mouse hover notification, but...
GetAdaptersAddresses() will get you addresses in IP_ADAPTER_UNICAST_ADDRESS format, which is defined as:
typedef struct _IP_ADAPTER_UNICAST_ADDRESS {
union {
struct {
ULONG Length;
DWORD Flags;
} ;
} ;
struct _IP_ADAPTER_UNICAST_ADDRESS *Next;
SOCKET_ADDRESS Address;
IP_PREFIX_ORIGIN ...