winapi

how to present a pdf object using win32 api ?

Hi, How can I render a pdf stream in a new memory using win32 API ? I know that ShellExecute can be used if the file is already saved on disk but what if I want to do that without having to first save the file ? Thanks ...

Will using CreateEvent to create/open an even that already exists reset the signal?

If I use CreateEvent to open an event: responseWaitEvent = CreateEvent(NULL, // no security TRUE, // manual-reset event FALSE, // not signaled (LPTSTR)eventName); // event name And this event already exists and has been signaled. Will this call reset the signal (because of setting initial state to FALSE). Or ...

Extending C++ Win32 application with a C# WPF component

Hello, I need to add a new component to a C++ Win32 application (no CLR support) and I would like to implement the new component in C# and use WPF. This new component is basically a window with some controls, which I need to launch quickly from an option in the menu of the Win32 application. The new component and the existing applicatio...

Disable Window's automated handling of errors in subprocesses.

I'm trying to write a test suite for a compiler (LLVM) and it works perfectly fine on every platform except for Windows. On Windows I get the "critical-error-handler" message box which stops the tests indefinitely. This problem makes it very difficult to test because, with compilers, a problem often means invalid code on the assembly l...

Drawing a system-like cursor, top-most, anywhere

I need to draw a system-like cursor that I simply can control the position of. In other words, I need to draw a transparent image that looks just like the system cursor and I need it to be rendered on top of all other windows. I've tried multiple approaches, but they all seem to have some downside. I've figured out that I can load the c...

What is the difference between a "Win32 Project", "CLR Empty Project", and "Empty Project" templates in Visual Studio?

I've just recently started working with Visual Studio this summer, primarily on CUDA and OpenCV related projects. Prior to this, I had been doing my development on Linux for CUDA using Makefiles and the common.mk makefile from NVIDIA. So my question is as follows: I've not been able to figure out for the life of me what the difference...

blocking in STA COM object

I'm about to write a control that has this defect. Why exactly is this bad? Your ActiveX control has a common defect that single-threaded apartment (STA) ActiveX & COM objects must avoid: STA COM objects cannot perform blocking operations on the STA thread, unless the COM object also pumps Windows messages. Therefore, ...

Suspending system using c++ program.

Hi All, I am trying to suspend my system using a c++ program using SetSuspendState method but I am facing issue during linking. I am using g++-4 (GCC) 4.3.4 20090804 (release) 1 compiler on Windows 7 OS (64bit). The code I have written is #include <iostream> #include "windows.h" #include "powrprof.h" using namespace std; int main()...

Access denied when updating config file in ProgramData directory. How do I fix this?

I can't seem to update my configuration file in c:\ProgramData\appname\config.ini. I keep getting an access denied error. Seems the ini code fails to be able to delete the existing .ini file when trying to update it with the new file. Funny thing is that I have other programs I've written that share the same code but don't have this prob...

stumbled in using ZwOpenFile.

I have to open a file using ZwOpenFile API. This is my requirement. When I set the path in object name parameter. I could see fields Length and maximumlength in the object name. Length is just length of the path and I usually keep maximumlength as the value of Length. It worked mostly, however some times it doesnot work. In some cases ...

unit testing time format conversions

After ncovering an ugly bug I wouldn't have caught in winter, I've started to centralize conversions between different time formats. I've already found some bugs by comparing different conversion paths, but need something more systematic. Test goals are correct conversion on all paths (of course), and errors on rimes not represented cor...

How to start a DVD playback on Windows using the default playback software?

Does anybody know how to initiate a DVD playback using a known drive letter from out of a C++ program. For what's worth: I simply search for the windows explorer's play function which is located in the context menu when right-clicking a DVD drive... Thx in advance, Axel ...

How to show web page

Hi, I wanna show web page in my program. I using Dev-C++ and I'm new. How I can do this? Best regards ...

Python Win32GUI Find Window

Hi, I have a GUI Windows application and I want to control it using the extension Win32gui in Python. How can I find the string s that I must give to the FindWindow function? I need to use the following code: import win32gui as gui gui.FindWindow(s, None) Thaks! ...

Adding a logoff script

I have some scripts that I would like to run every time a user logs off. I would like to create something that programatically sets up the logoff scripts. For example, an exe or a cmd file that can be executed to add the logoff script to the list of logoff scripts that Windows executes. Because of this, a Windows API function or a Window...

How to get information about network adapters in c++?

How to get information about all network adapters in system? Name, Manufacturer, Location(PCI, slot2), Driver Version. Actually i retrieved Name and Manufacturer with WMI but i can't find Location and Driver version. I need only c++ solutions not MFC/clr. winapi function? wmi (missing something)? Also i need to retrieve .NET version on ...

How to query the thread count of a process using the regular Windows C/C++ APIs

Hi all. Is there a way to query the number of threads that are currently running for a specific process using the standard Windows C/C++ APIs? I already prowled through the MSDN docs but the only thing that comes near is BOOL WINAPI GetProcessHandleCount( __in HANDLE hProcess, __inout PDWORD pdwHandleCount ); which queries ...

Strange performance problem

Hello! I am recompiling a old Delphi program (from Delphi 2007) in (Delphi 2010). The code is absolutely unchanged and it compiles well. The key part of the program is the use of CopyFileExW to copy some files. Everything works OK and Dandy, however, there are some strange performance problems that I cannot understand where they come fro...

Create MS-Word 2003 in WCF Error???

I built WCF solution about reporting by using MS-Word 2003 API(Microsoft.Office.Interop.Word) but I got this error : 2010-09-17 16:31:39,218 [21] ERROR ERROR [(null)] - Error : Generate 0900000a80395799 System.Runtime.InteropServices.COMException (0x800706BA): The RPC server is unavailable. (Exception from HRESULT: 0x800706BA) at Sys...

Is it possible to an app that listens to the Windows audio input to let the system save power?

From the moment we call Win API's WaveInOpen method the system won't sleep nor hibernate until this stream is closed. Is there any workaround for this? ...