winapi

.NET or Windows Synchronization Primitives Performance Specifications

Hello *, I am currently writing a scientific article, where I need to be very exact with citation. Can someone point me to either MSDN, MSDN article, some published article source or a book, where I can find performance comparison of Windows or .NET Synchronization primitives. I know that these are in the descending performance order: ...

How to monitor Windows Dialog?

I am looking for a way to monitor Windows dialog during a MSI deployment. Here is my situation: we have machines deploying daily MSIs and once in a while, one of them fail and shows a Windows dialog with an error message. I am trying to find a way to write a script (maybe in Powershell) which will run every minutes and look for a Window...

How to detect what window/control is at a specific point onscreen?

Is there a Win32 API call to determine what window and/or control is visible at a certain coordinates and/or under the mouse? ...

How to make OpenGL apps in 64-bits windows

OpenGL experts, My project compiles, link and run in xp32 then I tried to cross compile it to x64 and I came across a lot of questions. There's no native x64 instalable OpenGL SDK so I link against what? I saw someone saying that x64 apps use 32bits opengl dll. I tryied to run my compiled 64-bits app in a xp64 with drivers to my video...

Adding support of Windows to POSIX project... How painful? Is it worth the effort?

Hello, I'm trying/thinking of making CppCMS - C++ Web Framework project little bit more cross platform. Today I can easily support Linux, OpenSolaris, FreeBSD and even Cygwin. But when it comes to Native Windows it becomes really painful: The overview of the situation: I'm POSIX/Linux developer and I'm barely familiar with Native Win...

Design advice for a personal project - "Files Renamer"?

hello, i've just started learning winapis and c++ programming .. i was thinking about starting a personal project (to enhance my coding, and to help me understand the winapis better).. and i've decided to program a "cmd" files renamer, that basically takes : 1)a path 2)a keyword 3)the desiered formate 4)versioned or not (or numbere...

Check whether a shutdown is initiated or not

What is the win32 function to check whether a shutdown is initiated or not? EDIT: I need to check that inside a windows service (COM). How to do that? ...

Under what conditions will a TForm fire OnResize on show?

As an extension of this question: TForm.OnResize is sometimes fired before a form is first shown, but not always. For example, if BorderStyle is either bsDialog or bsNone, then OnResize will not fire. For all other BorderStyle values (and with all other properties at their defaults), OnResize does fire. Are there other things that affe...

Unmanaged C++ Get the current process id? (Console Application)

How can I get the current process id from an unmanaged C++ console application? I see that GetWindowThreadProcessId Works when you have an HWND, but what can I do for a console application? ...

Printing Issues under Terminal Services (Win32)

For our application, we need to be able to print output at a specific location on a page. For example, we need to be able to print some text at exactly (1.00", 1.00") relative to the top left corner of the page. The problem lies in the fact that all coordinates in the various GDI calls are not relative to the upper left corner of the d...

import .reg files using win32 or other libraries

My question is a bit related to this one but it's not what I was aiming for: http://stackoverflow.com/questions/35070/programmatically-merge-reg-file-into-win32-registry What I want to do is to create a program that can import a .reg file using win32 or some other library. I tried looking around but failed at that part. Something like...

How to get the mozilla firefox install directory for registry edit using win32 API

Hi I am using RegOpenKeyEx() and giving registry path Software\\Mozilla\\Mozilla Firefox ,its giving error_sucess.but after that how can i get the instal directory Data of mozilla firefox from that path using RegQueryValueEx(). ...

How to get the mozilla firefox curent version for registry edit using win32 API

Hi I am able to open the registry path i.e "Software\Mozilla\Mozilla Firefox" in RegOpenKeyEx.but i am trying to fetching "CurrentVersion" using RegQueryValueEx().But i am not getting the curent version.can u pls send me some code example. ...

Need a csharp signature for AcquireCredentialsHandle win32 api function

I have somehow come out with a signature for this api call, but the call does not work in the expected fashion. Some vital data structures are not get populated properly hence I am not getting intended output. The signature I've used is: [DllImport("secur32.dll", SetLastError = true)] static extern ulong AcquireCredentialsHandle( ...

How can I control the border thickness and color on Windows Forms?

I know that this can be controlled at the system level, but I want to override the system setting and have a certain appearance for only my application. I'm assuming there must be a Windows API function to control this because I've seen another windows app that does it. (It is not necessary to go into the reasons why I should not do th...

Suspending the execution of a remote process (C, Windows)

I can suspend a thread of another process by using SuspendThread(). Is there any way to also suspend the execution of that process altogether? If yes, please post code. Thanks. PS: Since you will ask "Why do you want to do this" I'll post it here. I am dealing with legacy software that is not maintained anymore. I don't have access to ...

C/C++ call-graph utility for Windows platform

I have a large 95% C, 5% C++ Win32 code base that I am trying to grok. What modern tools are available for generating call-graph diagrams for C or C++ projects? ...

How can an application write text to the screen?

How can an application write text to the screen without using any DrawText type methods, and how can I catch it? I've hooked the following: DrawText DrawTextA DrawTextW DrawTextEx DrawTextExA DrawTextExW TextOut TextOutA TextOutW ExtTextOut ExtTextOutA ExtTextOutW PolyTextOut PolyTextOutA PolyTextOutW None of them yields a thing. ...

Limiting Singleton instance to thread.

What is a good way to implement a singleton that will be restricted only to the thread that seeks its instance? Is there a thread id or something that I can use to do that? I'm using Carbon threading API but will have to implement this on windows and pure POSIX later too, so any technique is appreciated. ...

ReadConsoleOutput, WriteConsoleOutput, ReadConsoleInput functionality in Mono under Linux

I use in .Net version of my program three native WinApi functions through P/Invoke: ReadConsoleOutput, WriteConsoleOutput, ReadConsoleInput. How to implement this functionality in Mono counterpart under Linux? I know about standart System.Console class. But this class for some strange reason does not support functionality of previously ...