winapi

Is there a way to have a process created by CreateProcess open within another window?

Hello, I want to be able to open a GUI application using CreateProcess in a main process and have the GUI display in a window I create from within the main process. Does anyone know how to achive this? Thanks! ...

Running a Cpp/MFC program compiled as Win32 using Visual Studio 2008 on a Windows 7 64 bits?

I compiled a Win32 CPP/MFC program using VS2008 running on a 64 bit Windows 7. All system dll's are linked dynamically. This program reads/writes HKLM\Software\ subkeys. Tested on Windows 7 64 bits ok. All entries were read as expected from the HKLM\Software\Wow6432Node subnode. The problem started when I tried running this exe on a...

Hangs on CreateDialogIndirect in CWinThread derived class.

I'm new to multithreading. I created a class inherit from CWinThread called CMyUIThread, and also a dialog called CMyInfoDlg which has a text and a progress ctrl. I would to show modeless dialog in new created thread. Below is partial code: BOOL CMyUIThread::InitInstance() { // TODO: perform and per-thread initialization here // NOTE:...

How to utilize SECURITY_DESCRIPTOR in InitializeObjectAttributes()

Could someone provide me an example of utilizing SECURITY_DESCRIPTOR in InitializeObjectAttributes()? I plan to use them with NtCreateKey(). I couldn't find any example on the Internet. Thanks in advance. ...

How to access Windows shell context menu items?

Hi, In Windows Explorer, you right click on a file, a context menu shows up which contains built-in items like 'Send to...' and/or 3rd party actions such as 'zip file with Winzip'. My question are: How to obtain the full list of available menu items for a specific file? For each menu item, how to get the caption? How to invoke a speci...

How can I extract text information from an owner-drawn window, given a HWND?

I'm writing a simple automated test application for Win32. It runs as a separate process and accesses the target application via the Windows API. I can read window hierarchies, find labels and textboxes, and click buttons by sending/posting messages etc. All fine. Unfortunately many controls in the target application are composed of not...

Sorting UTF-8 strings in Win32 program

My Win32/MFC program builds up a list of names, sorting them alphabetically as it puts them into the list. When it supported only ASCII strings, this worked by a simple char-by-char string comparison. But now that I want to accept UTF-8 strings, I need a more complex scheme since --for example -- all forms of the letter "a" should be equ...

C++ textbox contents

How do I get the contents of a textbox in C++? ...

Need C Sharp win32, PInvoke API

Hi All, Long time listener, first time caller. Does anyone know of a good interop library for the Win32API? I found pinvok.net which is OK. (FWIW I got the addin to work with MSVS 2010 by following the instructions here: http://www.red-gate.com/supportcenter/GeneralContent.aspx?c=knowledgebase\PInvoke\KB200711000198.htm and using 10.0...

c++ win32: executing a method on ui thread due to an event on background thread

I've got a background thread that is polling a server. When there's data, i want to handle the data on the ui thread. If I store the hwnd of the main window. How can I get a particular method -- static void DataHandler(void* data) to be executed on the ui thread. I think creating a timer passing the hwnd and the function pointer w...

Delphi Using LockFile on windows 7 64.

Hi All. I have found that if you open a file that resides on 32 bit server in a share folder from a 64 bit windows 7 machine, read it, lock it and then open it again. When you close all open handles the file actually remains open. The exact steps are: Place a file that is between 7000 and 10000 bytes long in a shared folder on a 32 ...

CFile::osNoBuffer flag causes exception when writing to file.

(WINAPI create file - WINAPI write file) Flag used in winapi (FILE_FLAG_NO_BUFFERING) works fine, when I use winapi functions to write the file. (WINAPI create file - CFile - write file) In this situation the error also had occured, but it was because of absent file name in CFile object, that was created from the file handle received f...

SHChangeNotifyRegister API - How to know if 'file creation' is caused by file copy or not?

Hi, the Windows API SHChangeNotifyRegister can detect file creation in disk, but how to know if 'file creation' is caused by file copy or not? thank you! [EDITED], I mean SHChangeNotifyRegister, but not SHChangeNotify, sorry! ...

Windows Messages in Library Code

I am porting a library to Windows. In a function I need to block on the arrival of a WM_DEVICECHANGE message. What options are available for doing this? As my code resides in a library I have little-to-no information on the current set-up (so if it is a Console application, a regular GUI application, if my code is being run in a spawn...

Determine Physical Location of a PCI Adapter

We have a Windows application that can use multiple PCI adapters. These adapters all have external physical connections to other hardware or cables. Our software is configured to know what the physical connection on each card is connected to. Imagine audio software that supports multiple sound inputs and outputs. The audio software i...

Problem with using Win32 IPHelper API in python

I'm attempting to create python module for getting network parameters. I'm using ctypes and has some problems. Function __getInterfaces_win2k() works with python 2.5 and 2.6, but doesn't work with python 2.7 (Unhandled exception at 0x1e001759 in python.exe: 0xC0000005: Access violation reading location 0x00000010.) Function __getInterf...

How does one programmatically mount a drive in Windows?

We make and sell a device that our users will sometimes want to connect to their computer in large quantities with multiple USB hubs. It is a USB composite device that has both human interface (HID) and mass storage (MSD) interfaces. Windows automatically mounts the file-system of each device until it runs out of letters at 'Z:'. I can ...

How to make a WCF named pipe address equal to a WinApi one?

I noticed that WCF's named pipe address net.pipe://localhost/mynamedpipe and Windows API's \\.\pipe\mynamedpipe don't collide. Why is that? How can I make them point to the same pipe? ...

How do I make a Win32 API button selected programatically?

I have a button, if i were to say click a checkbox, it should then give one of two buttons focus. I am not sure how to use BM_SETSTATE - if that is the way to do it. // snip... case WM_COMMAND: switch (LOWORD(wParam)) { case IDC_CHECK: if (IsDlgButtonChecked(hDlg, IDC_CHECK)) { EnableWindow...

directx rotation c++

Okay this is a hard question. I'm creating a cube and a pyramid in one vertex array. My problem is to rotate only pyramid vertex not the cube vertex but I don't know any function that can rotate some vertex. If I try to rotate the vertex I'll get pyramid and cube rotated. ...