winapi

How to properly setup OpenGL scene for visualizing single objects

I need to write a simple visualizer for my mesh toolkit. The objects I'm working with is always located inside [-1,1]^3 box (inclusive), so I need to ensure that object will be entirely visible by user. I also want to have a possiblity to rotate a camera around object like user is "flying" around object. That's how I'm doing this: stat...

Exposing a class from a c++ dll ?

How do I expose a class from a dll ? The application importing the dll should be able to create the objects of the class and also he should be able to call into the member functions of the class . Is it similar to exposing C type functions using _declspec(dllexport) ? And also when I built the dll ( which only contains class definit...

Is there a book for just Win32 C++ for beginners

I am currently trying to learn C++ win32 with buttons window creation shell procces and im not getting most of this is there a place to learn all of this (place == book) just for beginners ...

Pre-registering an ATL window class

I am using a combination of the ATL and WTL for a project and have derived my own class from CWindowImpl, which looks something like this: class CMyControl : public CWindowImpl<CMyControl> { public: DECLARE_WND_CLASS(_T("MyClassName")) ... BEGIN_MSG_MAP(CMyControl) ... END_MSG_MAP() }; This is all good, and if ...

How to get monitor timeout on vista

In an application I wrote a few years back I use function SystemParametersInfo with SPI_GETPOWEROFFTIMEOUT to get the timeout for monitor off. On Vista this doesn't work anymore. So I decided to make this work on Vista, but after a few hours I feel like I'm no closer to a solution. Most of the functions I am going to mention are descri...

Is Learning the win32 API Worthwhile?

I was certain that somebody would have specifically asked this question, but from what I can see no-one has (there's been a question about learning win32 but that doesn't cover whether it's worthwhile doing so). I am very interested in gaining a deeper understanding of all the systems I use (I mostly program in C#, at least professional...

Is there a known Win32 Tkinter bug with respect to displaying photos on a canvas?

I'm noticing a pretty strange bug with tkinter, and I am wondering if it's because there's something in how the python interacts with the tcl, at least in Win32. Here I have a super simple program that displays a gif image. It works perfectly. from Tkinter import * canvas = Canvas(width=300, height=300, bg='white') canvas.pack() ...

How can I get summary information from images ?

How can I get the summary information for file images in Delphi? ...

How to check that the memory has been freed in visual studio C++?

Hello, I want to check that all my memory was freed ok in Visual Studio 2008 in C++. I heard that I can add few includes and maybe write some code line and that should do it. Does anyone know how I can do it? Thanks in advance, Greg ...

How can I initiate a Remote Assistance session in .NET?

I'm writing a help desk application and would like to allow my users to initiate a Remote Assistance session on a remote PC. This can be done via Help in Windows XP, but I haven't been able to find any code sample in .NET. Thanks! ...

Where should my win32 program keep its files?

Our win32 applications (written in C++) have been around for over 10 years, and haven't been updated to follow "good practices" in terms of where they keep files. The application defaults to installing in the "C:\AppName" folder, and keeps application-generated files, configuration files, downloaded files, and saved user documents in sub...

How do I check if a user has local admin privileges in win32

How do I check if a user has local admin privileges in win32 from c++ ...

How do I get a System.Windows.Form instance from its Win32 handle?

The following code implements a simple singleton that ensures only 1 instance of my application can be run. However, if another instance is started, I need to be able to grab that instance's command-line arguments, pass them to the initial instance, then terminate the second instance. The issue comes in when I'm attempting to get hold o...

Attempted to read or write protected memory when calling native C DLL.

I have a native C dll that exports one function besides DllEntryPoint, FuncX. I'm trying to find out how FuncX communicates with it's caller, because it has a void return type and no parameters. When I call it from a C# harness, I get an AccessViolationException - Attempted to read or write protected memory. I have a hunch that its cl...

Truncate file

I am using fopen fseeko64 ftello64 fclose etc. to operating on a file. How can I truncate a file? I know that there is no standard way to do this in C. All I want is some way that will work on any win32 platform. I'm using mingw gcc to compile. Please note: I meant truncate the size of the file to a specified size, not make it 0 size. ...

Smooth animations using Win32 API - without controlling the message pump

Hi everyone ! I'm currently trying to integrate some animation drawing code of mine into a third party application, under the form of an external plugin. This animation code in realtime 3d, based on OpenGL, and is supposed to render as fast as it can, usually at 60 frames per second. In my base application, where I'm the king of the w...

Count the number of packets sent to a server from a client?

So I'm almost done an assignment involving Win32 programming and sockets, but I have to generate and analyze some statistics about the transfers. The only part I'm having trouble with is how to figure out the number of packets that were sent to the server from the client. The data sent can be variable-length, so I can't just divide the ...

IMAGE_FILE_LARGE_ADDRESS_AWARE and 3GB OS Switch

If a Windows application has the IMAGE_FILE_LARGE_ADDRESS_AWARE set in the image header (via the /LARGEADDRESSAWARE compiler flag), this is typically to allow a 32-bit application to use more than 2GB of memory (only makes sense if the 32-bit Operating System has set the 3GB switch in boot.ini). See MSDN article /3GB for more info. My ...

control monitor for application via C++

I have an application that opens up IE browser windows at certain intervals throughout the day. I would like to control the monitor that the browser window opens up to (for example browser1 opens on monitor1 and browser2 on monitor2 and browser3 on monitor1 and browser4 on monitor2). Is there a way using C++ (app is written in C++) to co...

How to abort shutdown in Windows (XP|Vista) programatically?

I want to be able to detect and abort OS shutdown from my application, preferably by using the Windows API. I know that it is possible to do this manually using the command shutdown -a In the worst case, I could ShellExecute this, but I was wondering if there was a better way. Also, how do I find out programatically that the OS is abou...