winapi

When did my application start running?

What is the function to get date and time an application was executed? I'm using Delphi. ...

AcquireCredentialsHandle returns SEC_E_NO_CREDENTIALS

Hi I have managed to open the certificate store by using CertOpenSystemStore and I can find my self signed certificate (created using OpenSSL) using CertFindCertificateInStore which I installed through the MMC console on Windows Vista Ultimate. However I am not sure what this error really means as I have been unable to spot the answer i...

"window procedure" of a newly created thread without window

Hi, I want to create a thread for some db writes that should not block the ui in case the db is not there. For synchronizing with the main thread, I'd like to use windows messages. The main thread sends the data to be written to the writer thread. Sending is no problem, since CreateThread returns the handle of the newly created thread....

How to know a file has digital signature attribute

Is there any Windows API to know a file has digital signature attribute? Thanks in advance. ...

Can You Use MSVC 6.0's Debugger to 'Step Into' a Macro?

I am using MSVC 6.0 to call a macro in the Win32API and I'm getting an access violation. I know that the pointers I'm passing to the macro contain valid addresses, though they're evidently not pointing to the correct data. The macro accepts multiple pointers, and I'm not sure which pointer is erroneous, so I'd like to use MSVC's debugg...

How do I set the font and color for a group box caption using Win32 and C++

I am stuck with WIN32 and C++ ( no .NET or anything managed ) ...

Get all windows in taskbar

ive been googling for hours but cant find any way to get all windows in the taskbar. I need to minimize/maximize all windows, but with enumthreadwindows all system process-thread windows are being maximized/restored and my pc crashes because of 1000 windows trying to maximize/restore... can someone help? ...

hDC for Excel chart

I'd like to be able to draw directly onto a chart in Excel using WinAPI calls. Clearly I need the hDC to do that. Anybody know how to get hold of it? Thx -- DM ...

How to read exact number of bytes from a stream (tcp) socket?

In winsock, both the sync recv and the async WSARecv complete as soon as there is data available in a stream socket, regardless of the size specified (which is only the upper limit). This means that in order to read a fixed number of bytes from the stream, there should be applied some custom buffering. And unless each read is buffered se...

Windows API: What is the first message a window is guaranteed to receive?

I've been used to thinking that WM_CREATE is the first message a window receives. However, when testing this assumption on a top-level window, it turns out to be false. In my test, WM_MINMAXINFO turned up as the first message. So, what is the first message a window is guaranteed to receive? ...

Registry key for Install update and hotfix information on windows 7

Hi All, I am working on windows 7 support. In my application I want to gather installed updates and patches. Currently I am gathering it from WIn32_QuickFixEngineering. But it is not giving information for InstalledSDate , Description. I need to get this either from registry or API (C++ application). In other operating system like XP,...

How to locate a file in windows explorer

I have a application to list all music files in user machine, a "Explorer" button is using to quickly open Windows Explorer and highlight the file in Windows Explorer. I tried ShellExecute, but it doesn't work, the API will launch associate application. Any Windows API can do that? Thanks in advance. ...

Processing the OK button in a property sheet

I am using Win32 native code So I create a property sheet using the PropertySheet macro IT has three pages ( all created using CreatePropertySheetPage) So when the user presses ok how do I go about collecting data from each page. I get a message PSBTN_OK in the propsheet callback but how do I get the HWND of each individual page so taht ...

How do I run the SWT Win32 extension example program locally?

I am looking into using the SWT Win32 Extension. I downloaded the extension jar files, and the example code. However, I couldn't find how to run the example. When I run the application with their jnlp file, it runs. When I looked into the file, I saw that they specify their main class as org.sf.feeling.swt.win32.extension.example.Exampl...

Vista/Win7 Listview "View Slider"

In Vista and Windows 7 almost any time the system uses a standard Listview (ie: Explorer Windows) it's accompanied by a little split button that shows a slider when the split is clicked that allows you to switch between the different views available for that listview (Tile, Details, List, etc.) as well as sliding smoothly between icon si...

WinCE vs. Win32 dlls

Hello- I have some COM and some native dlls that are compiled for a Win CE device that I have. I would like to take a look at them, so I can create an application that references them and extends the functionality of some programs already on the device. When I open them with the Dependency Walker or Visual Studio 2008, both tell me that...

Turning display off from Windows Service

I have written a Windows service which should turn the display OFF when certain conditions occur. The code I am using is : private const int MONITOR_OFF = 2; SendMessage(GetDesktopWindow().ToInt32(), WM_SYSCOMMAND, SC_MONITORPOWER, MONITOR_OFF); This same code works from a Windows application but when executed from Windows service...

Benefits the Win32 API has over .NET

This is a rephrase of an earlier question, which got chopped down badly by the community. Fair enough, it might have been too argumentative. Since I'm really interested in what people here think about this, hopefully this more specific question will be accepted. Name a benefit which the Win32 API will still have over .NET in 3-5 years...

Sockets vs named pipes for local IPC on Windows?

Are there any reasons for favoring named pipes over sockets for local IPC (both using win-api), effectiveness-wize, resource-wize or otherwise, since both behave very much alike (and likely to be abstracted by a similiar interface anyway), in an application that is likely to already use sockets for network purposes anyway? I can name at...

Numeric values in ComboBox

I have a combo box CBS_DROPDOWNLIST control filled with numeric values. I'd like for the user to be able to type multiple characters to set the value but this only works if I specify the CBS_SORT flag which sorts the value 10 before 2. Is there a way I can get typing working correctly while keeping my values sorted numerically? ...