winapi

Fill an ellipse in C++

I'm trying to make a simple drawing app in c++, but i'm having trouble finding a function that fills an ellipse, all i have found is FillRect, could someone lead me in the right direction? Thanks ...

How to print the error message of GetLastError() in a textual form?

Hi, how could the last error message be printed? It gives me an integer instead of a text message. Thanks. ...

How do I get a list of available serial ports in Win32?

I have some legacy code that provides a list of the available COM ports on the PC by calling the EnumPorts() function and then filtering for the port names that start with "COM". For testing purposes it would be very useful if I could use this code with something like com0com, which provides pairs of virtual COM ports looped together as...

Pointers in and out of DLLs

Is it possible to pass a pointer to an object into a DLL, initialize it, and then use the initialized pointer in the main application? If so how? Are there any good articles on the subject, perhaps a tutorial? I have read this article http://msdn.microsoft.com/en-us/library/ms235460.aspx But that did not seem to get me any where. Maybe ...

TabCtrl_SetItemSize and user drawn tab controls

Hello. I have this Win32 user-drawn tab control that is created as: CONTROL "Tab1",IDC_TAB_CONT,"SysTabControl32",TCS_BOTTOM | TCS_OWNERDRAWFIXED | NOT WS_VISIBLE,0,14,185,88 I'd like for this control to have its tabs resize as never to have to see the "sliding arrows": Now, pretty much everything about this contr...

Read a PNG Using Win32 / C++

That there is no simple way to read a PNG file into a memory bitmap in native Windows seemed impossible, but after much googling I'm beginning to believe it. The libpng/zlib combination is just too big. Any third-party libraries Win32 libraries out there for reading a PNG? Edit: The boost::gil::png solution is much more complex than I'...

How to get the cpu usage per thread on windows (win32)

Looking for Win32 API functions, C++ or Delphi sample code that tells me the CPU usage (percent and/or total CPU time) of a thread (not the total for a process). I have the thread ID. I know that Sysinternals Process Explorer can display this information, but I need this information inside my program. ...

Is there any way to speed up COM?

My software makes heavy use of COM. It is very, very slow. Is there some trick to speeding COM communication up? ...

How to add spin control to the dialog box using win32 C ?

just want to know how to add an spin control ( in another name, up/down control ) in the dialog box using C program (win32 / code::block / mingw compiler) ...

How to write a generic alert message using win32?

I just want to expand this following method into something more generic, which should accept any kind of argument and display it using MessageBox(): void alert(char *item) { MessageBox(NULL, item, "Message", MB_OK | MB_ICONINFORMATION); } Can anyone help? ...

VB6 quitting while debugging with active Windows message hook

One of our largest old VB6 apps has some code in it to allow other apps (including some dotNET ones) to pass an ID to it via a Windows message - this ID is then used by the VB6 app to load an entry in a regular Windows form. The message hook is added after the user is logged in and authenticated, and removed once they logout. Public Sub...

Can I Change the Logged-In (Windows) User While an Application is Running?

Let's say we have an application that has a number of features and each feature as a permission set of users that are allowed to use that feature. The application is designed to be always-on, but at different times during the day we want different users to log on and use it. Rather than reinvent the wheel and create yet another user acc...

Browser opening text/xml in external program

Is there a smart way to - from a browser - open hrefs to text files and XML files in an external program. My target platform is Win32 so preferably I'd have the files open in the default editor for it (as set in explorer.exe). The solution must work in Firefox. It's a bonus if it works in IE and Crome. My html is generated from a local...

stop the kernell32 event

hi how can i stop or freeze the kernel32 event? for example stop the copy file?? ...

Win32 Dialog closing on startup

Hey, I recently asked a question here about a dialog problem I had, but i discovered that the problem lies in such a different area i intentionally thought that I will rephrase my question here. The problem is that I've been working on a DirectX10 game engine. When the engine inits there should pop up a dialog box which gives the user ...

How to draw text on the desktop in Windows ?

How Would I go about placing text on the windows desktop? I've been told that GetDesktopWindow() is what I need but I need an example. ...

About multi Flash.ocx verisons in one machine

I have a application using Flash.ocx to get the frame picture from SWF file, after updating adobe flash player to the newest, the frame picture is totally wrong. Is there a way to keep the old Flash.ocx in my running folder and my application will use that instead of the one in the system folder? I tried add the flash.ocx within applicat...

In .NET, how do I Create a Junction in NTFS, as opposed to a Symlink?

I'm trying to create an NTFS Junction. From the cmd line I can do this using the junction.exe tool from sysinternals. The output of a DIR cmd for a junction looks like this: Volume in drive C has no label. Volume Serial Number is C8BC-2EBD Directory of c:\users\cheeso\Documents 03/22/2009 09:45 PM <JUNCTION> My Music [\?...

Detouring DrawText

I've downloaded and compiled the Microsoft detouring library. Inside my project I've included the header file and added the .lib file as a dependency. Everything compiles without errors. Now I've been trying to detour DrawText, but for some reason that detoured function doesn't get called at all. Similiarly I tried detouring the Sleep fu...

How to use a manifest embedded as a resource? (Windows XP/Vista-style controls)

I have a manifest embedded as a Windows resource. But what's the right way to apply it? More specifically: I have my .manifest file. It's the standard one to make an app use controls in the Windows XP/Vista visual style. When applied by being in the same directory as the .exe and suitably named, it works. However, this approach is ...