winapi

Creating a ruler bar in MFC

What's the best way to go about creating a vertical and horizontal ruler bars in an SDI app? Would you make it part of the frame or the view? Derive it from CControlBar, or is there a better method? The vertical ruler must also be docked to a pane and not the frame. To make it a little clearer as to what I'm after, imagine the vertic...

Quickest way to implement a C++ Win32 Splash Screen

What's a simple way to implement a c++ Win32 program to... - display an 800x600x24 uncompressed bitmap image - in a window without borders (the only thing visible is the image) - that closes after ten seconds - and doesn't use MFC Thanks in advance for your help! ...

Convert BSTR to int

Does any one know how can I convert a BSTR to an int in VC++ 2008 Thanks in advance. ...

How can I get the currently logged-in windows user in Access VBA?

I found this via google: http://www.mvps.org/access/api/api0008.htm is this the best way to do it? ...

Memory leak detection while running unit tests

I've got a Win32 C++ app with a suite of unit tests. After the unit tests have finished running, I'd like a human-readable report on any unfreed memory to be automatically generated. Ideally, the report will have a stack with files & line number info for each unfreed allocation. It would be nice to have them generated in a consistent ...

C# & Win32 notify when separate window is closing / closed.

Is there a way to attach an event to a foreign / separate window from an .NET process that when the foreign window is closed or is about to close my application can be notified? I found this http://msdn.microsoft.com/en-us/library/ms229658.aspx But that seems to only be for the .NET compact framework. I am looking for something using t...

Embedding HWND into external process using SetParent

I'm trying to embed a window from my process into the window of an external process using the SetParent function and have encountered a few problems that I'm hoping someone can help me out with. First off, here is an outline of what I am currently doing to embed my window into the application: HWND myWindow; //Handle to my application w...

Any Substitute API for Win32API?

Hello, I need an API that can make menus like Win32API, But something simpler and better than WinAPI. That can make GUI, with text zones, buttons etc...like an average Windows program.(Windows GUI Style) Can anyone recommand on one like it? Thanks. ...

What library should be included to use TransparentBlt?

What library should be included to use TransparentBlt? This is VC98 (Visual Studio 6) linking to the Gdi32.lib. (Other GDI functions such as BitBlt link as expected), and the compilers compiles with out error or warning. Even though the Gdi32.lib is included, yet the linker returns this error: mtcombo.obj : error LNK2001: unresolved ...

Python - Py2exe can't build .exe using the 'email' module

py2exe does not work with the standard email module Hello. I am trying to use py2exe for converting a script into an exe. The build process shows this: The following modules appear to be missing ['email.Encoders', 'email.Generator', 'email.Iterators', 'email.MIMEBase', 'email.MIMEMultipart', 'email.MIMEText', 'email.Utils', 'email.b...

Unlock Windows workstation programatically

I would like to write a small application that unlocks the workstation. To put the specs of what I need very simple: Have an exe that runs and at a defined time (let's say midnight) unlocks the workstation. Of course the application knows the user and password of the logged on account. I know of the LogonUser API and have tried using it...

How can I implement java-like synchronization (monitors) using the Win32 API?

Each Java object (and its class) has an associated monitor. In pthread terms a Java monitor is equivalent to the combination of a reentrant mutex and a condition variable. For locking, the Win32 API provides Mutex objects (which are reentrant but heavyweight) and Critical Sections (which are non-reentrant but lightweight). It also provi...

WS_EX_TOOLWINDOW jumping to background on window destroy

Weird issue: Open a large notepad window create a toolwindow (style WS_EX_TOOLWINDOW) create 2 more windows (normal overlapped) (WS_OVERLAPPED) close those 2 overlapped windows (child of desktop or the toolwindow) the toolwindow jumps behind the notepad window Does anyone know why this is the case? Or what I could be doing wrong? I...

How do I disable and then enable the Retry button in a MessageBox (C++)?

I have the following unmanaged C++ code: MessageBox( NULL, strMessage, "Cool Product", MB_RETRYCANCEL | MB_ICONEXCLAMATION); I want to disable the RETRY button for 10 seconds (for example), then enable it. How can I do this? ...

Way to get the SearchPath API to not look in c:\windows?

Is there a way to get the SearchPath API to not search in c:\windows when using the default search path (passing NULL as the first param)? I can't modify the caller to send in a specific path. I have a system with an application ini file in c:\windows (which I don't want it to use, but for legacy reasons has to remain there). I put my c...

How to determine optimal thread stack size?

Actually, two sizes: initially committed and total reserved. Do you use static or dynamic analysis? Which tools? Which techniques? ...

Getting rid of the evil delay caused by ShellExecute

This is something that's been bothering me a while and there just has to be a solution to this. Every time I call ShellExecute to open an external file (be it a document, executable or a URL) this causes a very long lockup in my program before ShellExecute spawns the new process and returns. Does anyone know how to solve or work around t...

ListView multiple selection behavior

The ListView in Comtl32.dll v6.0 does multiple selection (when using Shift key) as follows (x means selected) 00xxxx xxxxxx xxxx00 Earlier versions of ListView do it as follows : 00xx00 00xx00 00xx00 Is there any way to have it do the first way (the comctl32 v6.0 way)? Thanks John ...

Delphi versus C++ Builder - Which is Better Choice for a Java Programmer Doing Win32

I'm a pretty experienced Java programmer that's been doing quite a bit of Win32 stuff in the last couple of years. Mainly I've been using VB6, but I really need to move to something better. I've spent a month or so playing with Delphi 2009. I like the VCL GUI stuff, Delphi seems more suited to Windows API calls than VB6, I really like...

EnumDisplayDevices vs WMI Win32_DesktopMonitor, how to detect active monitors?

For my current C++ project I need to detect a unique string for every monitor that is connected and active on a large number of computers. Research has pointed to 2 options Use WMI and query the Win32_DesktopMonitor for all active monitors. Use the PNPDeviceID for unique identification of monitors. Use the EnumDisplayDevices API, and...