winapi

How to pass uint in Java?

I'm trying to call SendMessage with an uint parameter from Java, but I can't convert int to uint. I can't change the uint parameter in SendMessage because it is a windows function. Is there some way of doing this? Background: I'm actually using Processing, and I'm following the following tutorials to access user32.dll: http://processing...

Displaying a bitmap on a "BUTTON" class window in WIN32

Edit: I think the WM_CREATE message isn't sent during the creation of child windows (namely my button). So by calling SendMessage during WM_CREATE, I'm sending a message to a window that hasn't been created yet. The solution for now is to call SendMessage() during the WM_SHOWWINDOW message. Do child windows send WM_CREATE messages at c...

How can I determine whether a message type is sent or posted?

I'm aware that some messages types are sent directly to window procedures, while others are posted to a thread's message queue, but I haven't found any way to determine if a message will be sent or posted. MSDN is half-helpful; it explained what's going on but the examples it gives are presumably not exhaustive. Is there a definitive l...

Turn Off Message Dispatch within A Handler

I am working on a Windows program which is completely single-threaded and has no protection to any data structure. However, the program use DirectShow API which open their own internal message-dispatching, IVideoWindow::put_Visible for example. So the event-handling function which invokes IVideoWindow::put_Visible Method give other event...

Connecting to SQLCE from windows scripting host on a Win32 platform

Is it possible to connect to SQLCE on a Win32 platform using Windows scripting host? I've tried using the ADODB.Connection activeX object to no avail. ...

An impasse with hooking calls to HeapAlloc for a memory tracking application.

I am writing a memory tracking application that hooks all the calls to HeapAlloc using IAT patching mechanism. The idea is to capture all the calls to HeapAlloc and get a callstack. However I am currently facing a problem with getting the callstack using DBGHELP Apis. I found that the dbghelp dll itself is linking to MSVCRT dll and thi...

How to convert a .NET exe to native Win32 exe?

How can I convert a .NET exe to Win32 exe? (I don't have the code) The purpose is to run the application in Linux using wine. I presume that .NET exe cannot be run in wine and I don't want to use mono. ...

Call another AP with UI in NT server

I have a NT server application running in background on Windows Vista, and I want the server to lanuch Notepad.exe when server received a specific command, BUT it doesn't work, I have tried with shellexec, winexec and createprocess functions, all are failed. Notepad always runs on the server desktop, Vista will show a message to ask me t...

How to hide the exporting functions in DLL

I don't want user to see all the exporting functions through Dependence in my DLL, is there a way to do it? I complie my DLL with C++ and MS Visual Studio. ...

Determine network interface bandwidth/type without transferring data

Is there any way in Win32 to programmatically determine the bandwidth of a given network interface without actually transferring any data? I only want to distinguish between different types of interface (e.g. dialup vs DSL vs LAN), so a rough order of magnitude is fine, I don't need to actually measure the bandwidth. Background to the ...

convert std::string to const BYTE* for RegSetValueEx()

I have a function that gets a std::string. That function calls RegSetValueEx the 5th parameter is the value of the registry value and expects a variable of type const BYTE*. So I have to convert the std::string to const BYTE* and also give the length of the resulting array as the 6th parameter. I have found a way to do it, but it feel...

Can I use svchost.exe to host my own services?

I can't find documentation for how to do it, which makes me think I'm not supposed to do it. ...

TextBox let '\n' be the carriage return

TextBoxes created by "CreateWindowEx(WS_EX_CLIENTEDGE, "EDIT", "", ES_MULTILINE.." require \r\n for a new line. im redirecting my stdoutput into that textbox, which uses just '\n' to indicate a new line. and im not willing to replace all '\n' with '\r\n' isn't there a way to let '\n' beeing a newline in textboxes? thx ...

Determining the network connection link speed

How do I programmatically determine the network connection link speed for an active network connection - like Task Manager shows you in the Networking tab? I'm not really after the bandwidth available, just a figure for the current connection, e.g. 54Mbps, 100Mbps etc. ...

Python multiprocessing on Python 2.6 Win32 (xp)

I tried to copy this example from this Multiprocessing lecture by jesse noller (as recommended in another SO post)[http://pycon.blip.tv/file/1947354?filename=Pycon-IntroductionToMultiprocessingInPython630.mp4] But for some reason I'm getting an error, as though it's ignoring my function definitions: I'm on Windows XP (win32) which I kno...

Button background transparency using Win32 and Visual Styles

Edit: If anyone's tried this in win32 before, am I going in the right direction by using DrawThemeBackground()? I'v recently enabled Visual Styles using a manifest for version 6 of ComCtl32.dll. Example of Visual Styles in Win32: Visual Styles The buttons look great, but I can't figure out how to make the background around the buttons...

How to check that system is in Log off state?

I want to check that whether the system is in log off state or not in VC++, any ideas? ...

win32 api for Process.BeginOutputReadLine

hi, i wanted to know the c++ equivalent of c#'s Process.BeginOutputReadLine, where i aynchronously read from the standardoutput of another process. Is there any API for it? ...

Win32, C++: Creating a popup window without stealing focus

I am creating a program that displays a popup at certain times (just like some chat clients for example) on which the user can click. However, I do not want to take away the focus from the current application. The way I'm doing it now is by using a HWND with WS_POPUPWINDOW and minimizing and then restoring the window. However, this ste...

Win32 API for determining if a path is relative or absolute?

Is there a win32 function that will tell me if a path is relative or absolute? Thanks, ...