winapi

Is this program running Asynchronous or synchrounous?

When I run this program OVERLAPPED o; int main() { .. CreateIoCompletionPort(....); for (int i = 0; i<10; i++) { WriteFile(..,&o); OVERLAPPED* po; GetQueuedCompletionStatus(..,&po); } } it seems that the WriteFile didn't return until the writing job is done. At the same time , GetQueuedC...

Build Process for a Visual C++ 2008 Express Project

I have a VS 2008 C++ project, with one very small and simple code file. I need to write an app to generate this file and build the project into a Win32 DLL. I will need to deliver a free compiler etc. with the app to my client, so I can't automate VS to do this. How would I best go about this? ...

How to get the active ChildWindow of an application that is not focused?

Hello, I need to get the Handler to the child Window of a certain application that is running. I have the main window handler, but I need to know which specific child window is active, in order to use the SendMessage/PostMessage. I finally managed to do this using the following code, using firefox: [DllImport("user32.dll")] st...

Custom Types in/with DLLImport'ed / P/Invoke'd win32 dll?

Good afternoon, i am currently wrestling with an old .dll which functionality I have to re-use in a .Net application & I came so far to import the basic/easy functions/methods that return bool etc, but some do in fact also expect (or return) an type that is declared within the .dll. How would I handle this? How would I map/create that ...

How do I get the active ChildWindow of an application?

Hi guys, I have this problem: I have an handler to the mainWindow of a certain application, and I want to simulate a keypress on that application... I'm using sendMessage/postMessage api calls to do this. The reason why I don't use the .Net SendKeys function or the keybd_event of the win32 api, is that they simulate the keypress at a gl...

Is the Win32 API still "native" in current windows versions?

If my program primarily uses the win32 API, are my API calls being emulated in Windows XP/Vista/7? ...

Pros and Cons of the available Visual Studio 2008 c++ project platforms?

If choosing between: ATL Windows Forms MFC Win32 Specifically the application will be: for completely in-house use. Most users lack basic windows/pc knowledge. (consider simple UI) used for automated testing which entails:-bringing in lots of data from external equipment (can choose VXI, USB, or Ethernet)-very heavy on graphics - l...

How to send files b/w two machines through socket programming?

Hi, I have requirement to send all the files in the directory to a different machines, the directory may internally contain child directories. Is there any help available on this? One more doubt is: I also heard that we can send the files using FTP, if so which is the best between the two. Is there any help available for this? I nee...

How can I delete a Win32 desktop with running programs, and terminate those programs?

I have this code: #define _WIN32_WINNT 0x0500 #include <cstdlib> #include <iostream> #include <windows.h> using namespace std; int main(int argc, char *argv[]) { HDESK hOriginalThread; HDESK hOriginalInput; hOriginalThread = GetThreadDesktop(GetCurrentThreadId()); hOriginalInput = OpenInputDesktop(0, FALSE, DESKTOP_SWI...

grabbing windows forms, pop-ups and menus

Hello guys, I'm developing an application the screen grab a thrid party app. Right now I've no problem in finding all the belonging forms, menus and popups in the 3rd party app I plan to grab, but i don't know how can I findout if the window I'm grabbing is a popup or a menu or whatever. Is there any function that given the window handl...

Stripping Down VS 2008 Win32 DLL to one file.

I have a VS generated C++ Win32 DLL project. It has the following files: stdafx.h targetver.h myProject.h dllmain.cpp myProject.cpp stdafx.cpp I can remove targetver.h, and merge dllmain.cpp into myProject.cpp. What more can I do to get the simplest file structure, preferably one file. I need to dynamically emit this code file and b...

Is there a 64-bit version of Microsoft Common Controls (MSCOMCTL.OCX)?

Did Microsoft port MSCOMCTL.OCX to 64-bit? I don't have it installed and I can't find it for download or find anything saying that it doesn't exist. Thanks, Phil ...

Change settings of a running process

Hi, I noticed that when a process starts for the first time, it statically reads some system parameter info only once and keeps it until terminated which means, that if there is some modification to the system parameters already read by the process, they wouldn'y reflect until the process is restarted. e.g. Launch Notepad and type ';...

How should I create a child window in win32 while programming with C++?

i'm new to C++ as well as for windows programming.. i have created a window using msdn CreateWindow() function which works correctly..now i would like to create a child window...the parent window should control the child window... Any helps sample code regarding this . Thanks in advance ...

VB6: Runtime Error '13': Type Mismatch when setting and int with an int

I'm not new to VB6 programming, but I'm not a master at it either. Hopefully someone can help me out with a question that I have concerning a Type Mismatch error that I'm receiving from trying to set an int variable with a int returned from a function. The integer that I'm trying to set is defined as: Global AICROSSDOCKStatus As Intege...

Using WinDDK test utilities with Visual Studio 2005

I'm currently trying to run the NdisProt driver given by WinDDK 2003. I've build and installed the driver successfully. It comes with a test utility named uiotest When I build the utility with make it runs correctly. When I create a blank win32 application solution with Visual Studio 2005 it cannot connect to the driver during CreateF...

How do I get the active ChildWindow of an application?

Hi, I want to send a pressKey event to a certain application which is not the active application IN Windows so I have to use the sendMessage/postMessage api calls. However, I need to know the exact child window that is active IN the application and send the pressKey message to it... I was using GetTopWindow and GetWindow(GW_CHILD) ap...

Window Hooking Questions

Is am using this: SetWindowsHookEx(WH_CALLWNDPROC, ...); I can see the messages I want to process, but I want to prevent those message from reaching the target window. So I tried this: SetWindowsHookEx(WH_GETMESSAGE, ...); When I do this I can modify the message, and prevent the target window from processing it, but this hook doesn...

Programmatically generate a C Win32 DLL.

I need to repeatedly generate a Win32 DLL with a registration information function. This function uses literals to return customer specific registration information, with a separate DLL being built per customer. I have a test version working correctly, with hard-coded information for one customer. The urgency for some sites dictates I...

GetShortPathName unpredictable results

GetShortPathName() is not working as I expect on XP SP3 http://msdn.microsoft.com/en-us/library/aa364989(VS.85).aspx Is returning the input string for paths like: C:\Test\LongFolderNameToTestWith\BinarySearch.ini exactly as sent? Yet: C:\Documents and Settings\LocalService\NTUSER.DAT Does make short names for the path, so I kn...