VirtualAlloc alignment
Will the memory block returned by VirtualAlloc always be aligned with the page size? In other words, will the modulus always be zero of the return value from VirtualAlloc and the page size? ...
Will the memory block returned by VirtualAlloc always be aligned with the page size? In other words, will the modulus always be zero of the return value from VirtualAlloc and the page size? ...
Looking at a Windows tooltips class hint window, i see that it draws its drop-shadow outside the hint window's actual rectangle. Using SpyXX - i can get the tooltip's window rect, and class styles: Rectangle: (440, 229)-(544, 249), 104x20 Restored Rect: (440, 229)-(544, 249), 104x20 Client Rect: (0, 0)-(104, 20), 104x20 You'...
Hello, I have a window with 10 child edit controls in it. I would like to move from one edit control to other by pressing the tab key - how do I do this? I mean, even if I could find out whether I pressed the tab-key, how do I find the next edit control to focus into? I hope I do not have to keep track of the edit controls myself as I ...
I wonder if it's possible to programmaticaly share folders in Windows 7 while running in restricted logon session: 1) NetShareAdd returns ERROR_ACCESS_DENIED. 2) Command line net share says the same. 3) But explorer has no problems creating new shares without invoking UAC. How does it do that? Any help will be greatly appreciated. ...
Hello, I have a window with an edit control as its child. The control is in focus. Every time I switch to some other application the control loses the focus (blurs). Do I have to keep track of the focused control in order to manually focus back when returning to the app back again? Or am I doing something wrong? I would expect Windows k...
Suppose I have a Win32 C++ application that displays a save file dialog. Also suppose that I browse to C:\Windows (or some other protected location) and type a file name. Then suppose I hit save. What happens is I get a message saying I don't have permission to save there and would I like to save to My Documents instead. So here is the ...
Suppose I have a Win32 C++ application that displays a save file dialog. Also suppose that I browse to C:\Windows (or some other protected location) and type a file name. Then suppose I hit save. What happens is I get a message saying I don't have permission to save there and would I like to save to My Documents instead. So here is the ...
I would like to define the application icon of a Win32 window, e.g. through a call to SetClassLong with GCL_HICON and passing in a handle to an icon (see SetClassLong Function on MSDN). This works great, but I have not figured out how I should load an icon (from an ICO file) in order to keep all available sizes (e.g. 16x16, 32x32, 48x48...
Hi, Is there any WINAPI call available to get the status of a particular device. I am able to get a handle to the device using the calls, SetupDiGetClassDevs SetupDiEnumDeviceInfo and SetupDiSetSelectedDevice But I want to uninstall the device only if the status shows error code 28. (Please refer http://support.microsoft.com/kb/125174...
I'm attempting to add in an access rule to a RegistryKey like so: using ( RegistryKey registry = OpenOrCreateMyKey() ) { RegistrySecurity security = registry.GetAccessControl(); security.AddAccessRule( new RegistryAccessRule( new SecurityIdentifier( WellKnownSidType.BuiltinUsersSid, null ), RegistryRights.WriteKe...
Hello, I have a basic Win32 dialog-based application. How do I make it resize? If it was a window this would be possible by default (and it would fire WM_SIZE). I'm new to dialogs and I'm not able to figure out how to: 1. when mouse cursor hovers over the edge, it should change to IDC_SIZEWE or IDC_SIZENS, 2. just resize the dialog, I ...
When using DirectInput, why does the mouse cursor completely disappear when you use DISCL_EXCLUSIVE | DISCL_FOREGROUND as your cooperative level? mouse->SetCooperativeLevel ( hwnd, DISCL_EXCLUSIVE | DISCL_FOREGROUND ) ; Even though DirectInput is deprecated, does the very fact the mouse is not even available to WINDOWS mean that you'...
Hello, I have simple dialog-based application with a status bar: InitCommonControls(); HWND hStatus = CreateWindowEx(...); SendMessage(hStatus, SB_SETPARTS, ...); I would like it to remain always at the bottom of the dialog, even if the dialog gets resized. I tried SendMessage(hStatus, WM_SIZE, 0, 0); in WM_SIZE of the dialog procedu...
Is there an API in C that I can use to check whether file indexing is on or off? Code is appreciated. ...
I have this very simple program: from win32com import client ie=client.Dispatch("InternetExplorer.Application") This used to work (I think I broke something when I re-used 'makepy.py' to try and add in constants for IE). It still works on another machine where I haven't been so slap-dash with 'makepy.py'. Here's what I get in an int...
How to get list of folders in this folder? ...
On some systems running Windows 7 where we've generated a key in a name key container, if we change the user's password, when we call CryptAcquireCertificatePrivateKey() we get an error CRYPT_E_NO_KEY_PROPERTY (0x8009200B). This doesn't happen on all boxes. We orginally thought it was something to w/ a domain machine not on the network...
I have a drawing function that just takes an HDC. But I need to show an EXACT scaled version of what will print. So currently, I use CreateCompatibleDC() with a printer HDC and CreateCompatibleBitmap() with the printer's HDC. I figure this way the DC will have the printer's exact width and height. And when I select fonts into this HDC,...
Hey, I want to make a DNS query to my own DNS server instead the default one. Which api can I use to do that ? I know getaddrinfo (which ping.exe using), but how can i make this function query my dns server, instead the default one ? Thanks! ...
I wrote a function which can yield the text of a tree view item, even if the tree view is in a remote process. The function allocates two chunks of memory in the remote process, populates a TVITEM structure (which is the copied into the remote process), sends a TVM_GETITEM message and finally reads the contents of the second remote memor...