winapi

NetShareGetInfo and Access Level? (Win32/C++)

I'm wondering if the method NetShareGetInfo requires the same level of access, reguardless of the level you are requesting. For example SHARE_INFO_0 returns just the shi0_netname where SHARE_INFO_2 the shi2_netname, shi2_type, shi2_remark, shi2_permissions, shi2_max_uses, shi2_current_uses, shi2_path and shi2_passwd. Some of these items ...

c# how to determine bios date change

Hello how can i determine with a program (c#) if the Bios Date has Change ? UPDATED i'm looking for the machine date, because I want write program that check if some body change that value, figure this out i hava a transaction file that record some info with date and time, and for the registration of this values i have a due time and i...

Create window on desktop layer

Hi! I want to create a window that always stays on the desktop layer - all other windows should be above it, but it should also always be visible. I'm currently calling SetWindowPos with HWND_BOTTOM when the window is Activated or Loaded. This does keep the window below other windows, but when pressing Win+D or, in newer windows version...

Is there a way to wait for a listening socket on win32?

I have a server and client program on the same machine. The server is part of an application- it can start and stop arbitrarily. When the server is up, I want the client to connect to the server's listening socket. There are win32 functions to wait on file system changes (ReadDirectoryChangesW) and registry changes (RegNotifyChangeKey...

How can I customize "%s has encountered a problem and needs to close"?

Every Windows developer is all too familiar with an alert of the form: Foo.exe has encountered a problem and needs to close. I am resigned to my apps blowing up from time to time (only during development of course), but when they do, I don't want to see "Foo.exe" here. I want to see a "friendly" name such as "FooBrowser™". I've search...

Where is the MSDN documentation on multi-process window ownership for win32? (chrome uses this)

where is the MSDN documentation that describes how multiple processes can control and own other windows in other processes like Google chrome? ...

Why would I use Sleep() with infinite timeout?

According to MSDN, Sleep() can be provided INFINITE value and that "indicates that the suspension should not time out". Why would I want to call Sleep() with INFINITE timeout in my program? ...

Windows programming win32

I am trying to get menu/submenu name on mouse left click.For this i need to get some notification when i click on that particular menu/submenu.Look if somebody has the idea to do that? ...

Marshal.AllocHGlobal VS Marshal.AllocCoTaskMem, Marshal.SizeOf VS sizeof()

Hi. I have the following struct: [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)] public struct WAVEHDR { internal IntPtr lpData; // pointer to locked data buffer internal uint dwBufferLength; // length of data buffer internal uint dwBytesRecorded; // used for input only internal IntPtr dwUser; // for c...

In the ReadDirectoryChangesW Function what does the Overlap parameter mean?

I understand the the ReadDirectoryChangesW Function uses a buffer to store the notifications, but what does overlap mean? I presume there is protection to stop the notification you're reading from being over-written? ...

multithreading: event driven vs message driven

Is there a difference in performance when multi-threading developed with win32 event objects (CreateEvent) or with thread window message queue. Both should use some kind of WaitFor... calls. My own code almost completely based on event, but maybe I lose something when don't use messages. ...

WS_EX_LAYERED colorkey - Vista issues

We place our transparent app window, over the window of another process. Our window contains some child controls. We create a WS_EX_LAYERED window, using colorkey for selective transparency. The main window is completely transparent, so it only functions as a container for the child controls. This works fine on XP and Vista without Aer...

Is there a list of valid parameter combinations for GetThemeColor / Visual Styles API

I am trying to retrieve the background and text color of the taskbar and/or my applications main window. It turned out, that Windows 7 does not return the correct colors. If i i.e. switch to a pink theme, Windows 7 still returns light blue for window caption although thats not true. This happens using GetSysColor(COLOR_ACTIVECAPTION); ...

How to get main window handle from process id?

How to get main window handle from process id? I want to bring this window to the front. It works well in "Process Explorer". ...

Can someone help spot the errors in my low lock list?

Hi all, I've written a low lock list in C++ on windows 32-bit. I'm getting BIG improvements over using critical sections but I'd like someone to sanity check that what I'm doing is correct and there aren't any errors in what I've done: #ifndef __LOW_LOCK_STACK_H_ #define __LOW_LOCK_STACK_H_ template< class T > class LowLockStack { pr...

How can I get the target platform info of a dll with Python 3.1.1?

I have many dll files and I would like to select them into two different folders (PC and PPC). For this I need to know the target platform of the dll file or any other details about its platform. I use Python 3.1.1. I have tried the win32api which does not compatible with this Python version. So, I tried to use the ctypes.windll with tr...

how to hook control closing in an MFC custom control class

I am interested in allocating pointers, storing those in the LPARAM data of a comboboxex control, and making that control responsible for deleting those pointers when it is destroyed. Since I am working in MFC, I can subclass a CComboBoxEx, and add either a message handler or a virtual member function. The question is: Is this pattern ...

how to mouse click on an image on a running IE instance programmatically from windows form app

I want to create a windows app that does the following. When a button is clicked, Find a running instance of IE (which I was able to get a handle using FindWindow api (user32.dll)) Send message to windows OS to mouse click on the image in IE. I already know that there is an image on the page. -- this is where I need help!! thanks. H...

Is there a way to embed windows save dialog

The subject has it all. I want to have the Windows save as dialog as part of my own dialog. Is that even possible ? ...

What is comming in IDataObject?

When you implement IDropTarget you must implement this: virtual HRESULT STDMETHODCALLTYPE Drop( /* [unique][in] */ __RPC__in_opt IDataObject *pDataObj, /* [in] */ DWORD grfKeyState, /* [in] */ POINTL pt, /* [out][in] */ __RPC__inout DWORD *pdwEffect)=0; I want to know what kind of data...