winapi

Is it possible to capture a window with windows 7 DWM thumbnail in it?

I am starting to believe that you can do nothing with Windows API. I have two windows. One has a DWM thumbnail in it. What I want to do is, I want to be able to capture the screen of the window with the thumbnail into the other one. When I do this, using bitblt, everything is copied except the thumbnail. It just isn't there in the bitma...

Scrolling ListView with mouse wheel occasionally negates scroll

I'm having some trouble with the Win32 listview, and I hope someone has some wisdom. When scrolling very quickly (via the wheel), occasionally, the listview appears to scroll, only to jump back to the selected item so it is in-view. In other words, the list undoes your wheel scroll to show you the selected item at the top/bottom of the l...

add album art to WMA file

I'm using WMP engine to convert audio to WMA format, but I didn't see any API that I can put a alubm art to WMA file. is there a way to do that? Thanks in advance. ...

Is it necessary to explicitly stop all threads prior to exiting a Win32 application?

I have a Win32 native VC++ application that upon entering WinMain() starts a separate thread, then does some useful job while that other thread is running, then simply exits WinMain() - the other thread is not explicitly stopped. This blog post says that a .NET application will not terminate in this case since the other thread is still ...

Off-screen OpenGL rendering using Mesa3D in a Win32 service

Various questions have been posted on the subject of off-screen rendering, especially as it concerns a Win32 service, such as the following questions in which Mesa3D has been suggested as an option... http://stackoverflow.com/questions/513650/offscreen-rendering-to-a-texture-in-a-win32-service http://stackoverflow.com/questions/883717/c...

GetUserDefaultLocaleName() API is crashing

I have one application which reads user default locale in Windows Vista and above. When i tried calling the API for getting User default Locale API is crashing. Below is the code, It will be helpfull if any points the reason #include <iostream> #include <WinNls.h> #include <Windows.h> int main() { LPWSTR lpLocaleName=NULL; co...

What went wrong with my Declare statement?

I've recently fixed a bug in a VB6 application, but I'm not sure, what exactly went wrong. The offending part was a wrong API declaration of CreateEvent. This is, what API Viewer generated: Declare Function CreateEvent Lib "kernel32" Alias "CreateEventA" (lpEventAttributes As SECURITY_ATTRIBUTES, ...) As Long The next one is the wro...

Is it possible to paint on scrollbars?

Is it possible to paint on the scrollbars of standart controls like TMemo, TListbox, etc..? All I need is to draw some basic shapes on the scrollbars and I'm trying to avoid implementing whole scrolling stuff from stratch. Any pointers? TIA! ...

Why is my MFC DLL deadlocking on a single thread near startup?

Using Visual Studio 2005, the debugger tells me that a deadlock has occurred just after startup of the app I'm writing - I'm well in to WinMain() at this point. The callstack shows that we are in a critical section, while calling AFX_MANAGE_STATE2 (for the 666th time, spookily enough) from within an MFC DLL. This has just started happe...

How to create a resizable window with rounded-corners in win32

I'm trying to create a Win32 window that has rounded corners and is resizable both horizontally and vertically. My first approach was to create BITMAP of a rounded rectangle and draw it to the screen in conjunction with setting the windows style to WS_EX_LAYERED and setting the transparency key to the outside color of the rounded rectang...

Find all files within directory using "FindFirstFileA" - C

I am using the Windows API and would like to be able to search through a specified directory and return the names of any files that reside within it. I've made a start at it however i've hit a brick wall as i'm unsure of how to go any further. Here is my progress so far: #include <stdio.h> #include <windows.h> void main() { HANDLE f...

WIN32 identifying process

Hello, I have a process that is created on windows machine (Lets call it PRS). The amount can be different amount. The processes are created by a nother process (Manager) which is defined as a service. the Manager get instructions and reacts according to the request (for example creating a new PRS, stopping PRS etc'). When creating (usi...

Win32 determine process ID

I want to create a process in Win32 .NET can I determine FOR the OS which PID the application will get ? Update: 1) I am asking it because I have a problem in which I have 2 .NET application (the same ones) that I have each one of them got parameter ID and I want using a script (using the parameter) to decide which is the one and get ...

Legacy exchange MAPI help?

I'm working with some legacy exchange code and I am having trouble finding information about some methods/constants. A google search reveals others using similar code, but with no explanations. Does anyone have any ideas where I can find proper docs? One constant I am looking for is: SYNC_ASSOCIATED. ...

How do I communicate from my global hook to my application?

I installed a global hook using win32 but I need to communicate with my main application. How should I do this? I guess the dll can have a function where I set my apps HWND and then the hook can sendmessage it? or should I search the window titles to find my application from the hook and sendmessage that way? What's the best strategy and...

How to determine whether an LSA session is active in Windows XP

I'm trying to get the list of users currently logged into a machine. On Windows 7, I can call LsaEnumerateLogonSessions, then WTSQuerySessionInformation with WTSConnectState. But on XP, each LSA session has 0 for the TS Session field (unless it's a Remote Desktop session), which always has WTSConnectState of WTSActive, and I end up lis...

How to hardcode a value in a texbox in c++

I am using the below code to popup the authentication dialog. I want to hard-code the password in my code and make it a read-only text box. What should I do? IDD_LOGIN_AUTH_DIALOG DIALOG DISCARDABLE 0, 0, 148, 82 STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "Authentication" FONT 8, "MS Shell Dlg" BEGIN LTEXT ...

WriteProcessMemory

Ok... I want to make win32api WriteProcessMemory works. (*Just for learning winAPI on .Net platforms ! ^_^*) I'm using Nemerle but the syntax is similar C# and I can read C# code sure. So here is my steps : 1) get win api function [DllImport("kernel32.dll",SetLastError = true)] public static extern WriteProcessMemory (hProcess : Int...

How to flush file buffers when using boost::serialization?

I'm saving a file on an USB drive and need to make sure that it's completely written to avoid corruption in case the USB drive is not removed properly. Well I've done some research and it seems this is possible via calling the FlushFileBuffers Win32 function. But the problem is, I'm saving using boost::serialization and thus don't have a...

Create a process with ordinary rights from an administrator process

There is any way to run another process with ordinary rights from a process running as administrator? From a process with elevated rights I want to start a process with ordinary rights like it were started from explorer. I tried impersonation but I didn't work. ...