I am currently using CreateProcess/WaitForSingleObject from within a win32 GUI app to launch a small GUI app that deals with software licensing issues. This all works fine, but it essentially hangs the "parent" app while it waits for the licensing app to finish its work. During this time, updates to the parent app do not occur and it end...
I posted this answer (more of an idea really) but haven't been able to find out for sure which message triggers a WinForms Form.Load event. From Spy++ and some reading I suggested it might be WM_SHOWWINDOW, but I'd like to be sure.
Also, other than Spy++ is there a better way to see exactly which windows message triggered a .Net event?...
How do I run windows 32bit applications in IIS on Windows XP 64 bit?
Note: This is not running within Visual Studio.
Note: Only 404 errors are logged.
Note: 404 errors caused by IIS disabling CGI scripts
...
Is it possible to retrieve the size of the font used in a menu via the Win32 API? I have found the GetTextMetrics() call, but cannot find a way to specify it getting the font used in a menu. Any suggestions?
...
i'm usually using Win32 API in c#.NET. But not declare all in one application. Sometimes usually using user32, sometimes gdi32 ...
I think when i declare all api function, those use lot of memory.
What is the best way using API in .NET ?
...
Through my automated crash collection for MaxTo I got the following crash report:
V8.12.0.0 - System.ComponentModel.Win32Exception - :Void UpdateLayered():0
Version: MaxTo8.12.0.0
Exception: System.ComponentModel.Win32Exception
Error message: Not enough storage is available to process this command
Stack trace:
at System.Windows.Forms...
This is a simplified version of what I am trying to implement to grab text from a mIRC chat window:
[DllImport("user32.dll", EntryPoint = "SendMessage")]
private static extern int SendMessage(IntPtr hwnd, int msg, int wParam, StringBuilder sb);
public const int WM_GETTEXT = 0x000D;
IntPtr mainHandle = FindWindow("mIRC", null);
IntPtr...
I have a small application, which is free for personal use, but requires a paid license for corporate use.
It is most likely that in a corporate environment my application will run on multiple workstations. If it is the freeware version, I want to show an unobtrusive message. (and continue)
It doesn't have to be bulletproof, if it is n...
I'm unable to restore a window after "minimizing" a window to tray, by doing this in wndproc:
case WM_SIZE:
if (wparam==SIZE_MINIMIZED) {
ShowWindow(hwnd,SW_HIDE);
}
break;
The tray message handler looks like this:
case TRAY_ICON_MESSAGE:
switch(lparam) {
case WM_LBUTTONDOWN:
ShowWindow(hwnd, SW_RESTORE);
BringW...
In C++ on Win32:
Suppose I have a DLL with a header file that declares a class. The DLL exports some means of obtaining a pointer/reference to an instance of that class, such as a factory function.
Am I correct in believing that it is not necessary to mark that class as exported using __declspec if one is only going to call virtual or...
I'm aspiring to work in real-time 3D graphics. I work almost exclusively in C++, with a healthy smattering of win32. Realistically, do I have any sane alternatives?
...
My app can switch between Serial and Socket connections, but neither can be open at the same time. So when I try to switch between a Socket to Serial, I delete the Socket connection.
The socket based object uses a private class called UsesWinsock (a big shout out to Len Holgate here as it is basically his code (it is RAII actually but I...
As a precursor to writing a compiler I'm trying to understand the Windows (32-bit) Portable Executable format. In particular I'd like to see an example of a bare-bones executable which does nothing except load correctly, run and exit.
I've tried writing and compiling a simple C main function which does nothing but the resulting .exe is ...
So I've read that StretchBlt can mirror images horizontally and/or vertically by negating the nWidthSrc/Dest and nHeightSrc/Dest parameters. I'd like this functionality without the performance overhead of a StretchBlt. I tried the same technique with BitBlt but it didn't work.
Is there any way to mirror an image with something as simple...
If I intercept a key press using win32 calls, I now have a key code. Is there a way to convert that to a System.Windows.Forms.Keys value?
...
Can Windows Presentation Foundation read/write WMF/EMF files without having to use WinForms Interop or Win32.
If it does not, what is the reason?
...
I would like to create a top-level (i.e., not WS_CHILD) window with transparency. However, I don't want it to be a simple mask, where a given pixel is either fully transparent or fully opaque. And I don't want it to be such that the entire window has some alpha level to it. Rather, I'd want the window to essentially be entirely transp...
I have a static library that may get linked into either a .exe or a .dll. At runtime I want ony of my library functions to get the HMODULE for whatever thing the static library code has been linked into.
I currently use the following trick (inspired from this forum):
const HMODULE GetCurrentModule()
{
MEMORY_BASIC_INFORMATION mbi ...
I know the drive limit can be gotten around using junction points, but is there a limit to the number of physical devices recognized/mounted in the registry and shown using the MOUNTVOL command or Win32 API?
...
I'm writing a program to enumerate through processes, and I want to find out the SID/user ID and session of which the specified process is running under (i.e. i have a PID/handle to process, I want the SID and session it's running under). Any clues?
...