winapi

Confusion over Win32 CreateProcess

I am confused by the first 2 params, module and command-line. I find unless I populate both it doesn't work right, and it seems the documentation says otherwise. I want to call "testApp.exe param1=123" The only way I found that works is: CreateProcess("testApp.exe","testApp.exe param1=123",... I thought either of these should work, ...

Finding text input control in other application by mouse

I'm trying to write a password storing application (similar to KeePass, for practice purposes), and i would like this application to have a selection mode similar to Spy++'s Find Window function. The goal is to obtain a window handle to a password control the user selects, so that my app can send a stored password to this control, perh...

Symbolic Link - Windows

Hi, I am trying to test the 31 reparse point limit mentioned for Symbolic link in Visa. But I could not reproduce by any of following listed cases. Can someone guide? 1) Created 36 symlinks in a directory c:\temp\testlink for a executable residing in c:\temp\testlink. 2) Created 36 symlinks in a directory c:\temp\testlink to 36 differ...

.NET: Send a text message to all instances of the same application and read it

I need ability to reliably sync some chunks of textual data between all running instances of my application. What's the best way to make it? ...

Crash when calling virtual function

Ok this is a really weird problem. I wanna start off by saying that I'm not a beginner in c++ and I'm certainly not advanced. I'm somewhere in the middle. What I'm trying to do is make a C++ OOP wrapper library (dll) of the Win32 API. Here are the classes of my library. I compiled it with Mingw using the command: g++ -shared -o bin\win3...

What is the difference between Send Message and Post Message and how these relate to C# ,WPF and Pure windows programming?

What is the difference between Send Message and Post Message ( in terms of pure windows programming) and how these relate to C# ,WPF and Pure windows programming? I am new to Threading and all related stuff so please excuse me for obvious quesiton . I need to dig out the externals of Threading .. Please let me know the links that help m...

win32 programming in c++

i have following code in visual c++ #include<Windows.h> LPCTSTR Caption=L"Application programming INTERFACE"; INT WINAPI WinMain(HINSTANCE hInstance,HINSTANCE hPPREVInstance, LPSTR lpCmdLINE,int nCmdShow) { MessageBox(NULL,L" Welcome to win32 Application Develepment\n",Caption,MB_YESNOCANCEL| MB_ICONQUESTIO...

Why are LoadResource/LockResource sometimes returning concatenated resource data?

I'm working with a Visual Studio C++ project that contains a number of HTML resources. They are loaded by a method that looks like this: LPCTSTR loadHTML(HMODULE hModule, LPCTSTR sResourceName) { HRSRC hResource = FindResource(hModule, sResourceName, RT_HTML); if(!hResource) return 0; HGLOBAL hResourceData = LoadRes...

NTP Client using the Windows API

I'm maintaining a legacy system (pre .NET). Is there any way to fetch the time from an NTP server using the Windows API? Failing that, I could probably create a COM object with .NET to do it, but I would rather not go to that effort. ...

MessageBox not displaying on Windows XP

I have two machines: my dev machine has Windows Server 2008 R2 on it, along with Visual Studio 2008. I'm compiling my applciation on there. My other machine is the target machine and it runs Windows XP. The problem is that I have a MessageBox call that works on the dev machine but not on the target machine. I've commented out everythi...

How to create a temporary directory in C++?

I'm writing a function in C++ which creates a temporary directory. Such function should be as most portable as possible, e.g. it should work under linux, mac and win32 environments. How do I achieve that? ...

Getting Extra Information From WinAPI File Change Notifications

The MSDN has a pretty good example of getting notified when a file or directory is changed. However, I can't find any way to get extra information such as the user/machine name associated with the change notification. For example, I've setup a share X:\Foo from my machine. I would like to log the user/machine names that make changes t...

Object oriented c++ win32?

I want to create my own class to handle creating windows and the window procedure but I have noticed that the window procedure has to be static! I'm now wondering whether its possible to make the window procedure object oriented? I have read some tutorials on object oriented windows, but they always make the procedure static -.- whats th...

C - Calling functions from external process without exported functions

Hey guys, I am trying to figure out how I can call a function without having it being exported. Okay so I have an exe file with "add" defined in it, This exe is a win32 console application and loads a DLL. The DLL also aims to use the add function from the exe file ( without exports ) Here is my main win32 console application file: #i...

Third party IPC calls to Chromium to capture/filter traffic

I want to implement a network level AdBlock/NoScript-like tool for Chromium, but Chromium Extension API can not do much about controlling raw request data. So here is the idea: Capture all HTTP queries, and cancel one if URL or MIME matches. Hand craft packets, like insert a header to an HTTP query. Can this be implemented by runnin...

Win32 Device Context without Window

In my application i need to create HBITMAP objects to which I render and from where I copy the result. I use the function "CreateDIBSection" to create these bitmaps, however this function required a DC (Device Context) as first parameter. Currently I get this by calling GetDC(hWnd) on the main windows handle (hWnd). But I would like to...

Best place to hide a key in the Windows Registry?

Hello All! My Delphi program has a built-in protection mechanism to check for banned license keys on the Internet and displays a message to the user if a blacklisted key is found. I'd like to store the blacklisted key in the registry, so if the user tries to re-enter it (and he/she is not connected to the Internet), it's not accepted. ...

Get selected items of folder with WinAPI

Hey guys I try to get the selected files of a folder which the user is using. I have the following code which is already running, but only on desktop files: private String selectedFiles() { // get the handle of the desktop listview IntPtr vHandle = WinApiWrapper.FindWindow("Progman", "Program Manager"); vHand...

OpenGL equivalent of SetROP2(R2_NOT)

Considering QGLWidget (or OpenGL in general), what can be the easiest solution to draw pixels in the inverse color of the screen / frame buffer? In Win32 / MFC environment, I used to use the SetROP2(R2_NOT) with zero pain. ...

Difficulties with p/invoke and EnumDisplaySettingsEx

I am attempting to retrieve information on all the various monitors (and their adapters) present on a system. So far, my attempts at using EnumDisplayDevices to list all the monitors has worked great - it found two, the first being "\\.\DISPLAY1\Monitor0" (the second is just 2 and 1, respectively, but it's irrelevant to this question). A...