winapi

Porting a win32 application to Win CE

I have a win32 GUI (MFC) application which I need to port to a WIN CE environment. I keep encountering undefined identifiers. What is the best way to deal with this- is there some site where i can get a mapping of some kind between win32 supported features and corresponding wince features (even if they are not supported, the information ...

Is key 'chord' functionality provided by Win32/.net?

Several MS apps support the concept of chords, like "CTRL+X,Y" which means "holding down CTRL, press X, then Y". Is this a bespoke thing they (and other companies) implement, or is it built into any APIs? It would be nice to be able to set up event handlers or accelerators based on chords rather than write code to do it. ...

API to toggle "Show hidden files, folders and drives"

Is there a function in Windows API to toggle the "Show hidden files, folders and drives" option in Windows Explorer (Tools >> Folder Options... >> View tab). I know of a related registry key, but changing that would not have immediate effect. The key is: HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Windows/CurrentVersion/Explorer/Advanced/Hidd...

Visual Studio Recompiles Project Every Time I Try to Run it

Hello, I have a Visual Studio 2005 solution. Every time I try to run the startup project (C++), the project gets build again, although I did not make any change. How can I get the normal, sane behaviour, where projects get built only when needed? How can I debug the problem further? Thanks, ...

WPF WIN32 hwndhost WM_MOUSEMOVE WM_MOUSEHOVER

I have a WPF app with a usercontrol that contains a HwndHost. The HwndHost is created as follows: hwndHost = CreateWindowEx(0, "static", "", WS_CHILD | WS_VISIBLE, 0, 0, hostHeight, hostWidth, hwndParent.Handle, ...

nedmalloc: where does mem>=fm come from?

While implementing nedmalloc into my application, I am frequently hitting a situation when nedmalloc refuses to free a block of memory, claiming it did not allocate it. I am using v1.06beta1_svn1151 version. While debugging I have come up to the point I see a particular condition which is failing, all other (including magic numbers) su...

WinForms: How to determine if window is no longer active (no child window has focus)?

My application uses multiple windows I want to hide one specific window in case the application loses focus (when the Active Window is not the application window) source I am handling the Deactivate event of my main form. private void MainForm_Deactivate(object sender, EventArgs e) { Console.WriteLine("deactivate"); ...

Windows API Programming Startup

Hello, I want to learn windows API and PInvoke methods just like MesseageBeep in User32.dll. Can you refer a book or a website where I can learn all of those in step by step way. An ebook will also be appreciated. Thanks in advance, Guru. ...

Get the selected file in an Explorer window

I'd like to know how, if possible, to get the path of the selected file in an open Windows Explorer window. If not, would it at least be possible to get the folder path of an open Windows Explorer window? The end reason I'm doing this, is a software tool I'm writing requires a user to select a file. I figure if they're already moving ...

Hook on monitor turning on

I have turned computer monitor off using this command SendMessage(f.Handle, WM_SYSCOMMAND, (IntPtr)SC_MONITORPOWER, (IntPtr)(turnOff ? 2 : -1)); is it possible to hook monitor turning on to prevent it or execute some function? ...

Win32: Link to HtmlHelp() API documentation?

Can anyone find a link to official MSDN documentation on the HtmlHelp() Win32 API call, and parameters? Microsoft, it seems, is going to great lengths to keep the API call a secret. ...

Win32: HtmlHelp doesn't work from a network share. What's the alternative?

Since 2005, when Microsoft prevented HtmlHelp functioning off a network share, e.g.: \\appserver\tos\PointScanner.exe \\appserver\tos\PointScanner.chm What are we supposed to do instead? (Given that the application is not installed locally.) To rephrase: What is Microsoft's intended, supported, out-of-the-box, help solution? ...

C: WinAPI CreateDIBitmap() from byte[] problem

I have been working on this problem for a while now. I am trying to add JPEG support to a program with libjpeg. For the most part, it is working fairly well, But for some JPEGs, they show up like the picture on the left. Original Image It may not be obvious, but the background shows up with alternating red green and blue rows. If any...

Preventing Processes From Spawning Using .NET Code

I remember coming across an article on I think CodeProject quite some time ago regarding an antivirus or antimalware some guy was writing where he hooked into the Windows API to be able to catch whenever a new process was started and was prompting he user before allowing the process to start. I can no longer find the article, and would ...

how to handle click event in win32 API?

I have created a simple win 32 application..in which it has a textbox and a button in a dialog window..first when I created this..it didnt display the dialog window and then what I did is added the code below to handle the close(WM_CLOSE) of the dialog window...but I want to know, how to handle the button click event.. void ValidatePa...

How does GetGuiThreadInfo() work?

Hi, I am trying to get the HWND and ThreadID for currently Focussed Window. Usually GetForegroundWindow() and then then calling GetThreadProcessId() gives me the correct information. But in Case of IE8 the HWnd the GetForegroundwindow() gives me the HWND of the IE Frame but actually the focussed window (the document object or Internet ...

Win32/MFC: How to find free memory (RAM) available?

Any suggestions/hints/links/tutorials would be appreciated! :) ...

MFC: Text-length reported inconsistently when contains carriage-returns

I set a limit text, but when pasting in text containing new-lines, it's possible to get the reported length longer than the set limit. Some limit is still in place, but for instance I can set a limit of 4000, paste in 6000 chars and the control reports the length as 4010. Or I can get the reported length as 3098 and then enter 4 new-lin...

on some Windows machines, skinned applications sometimes loses their skin. any ideas?

Hi we are developing a skinned application, and under vista/windows 7, on some machines, skinned applications sometimes loses their skin. here's an example for the problem, and here's how the application looks when it's good. this happens to us whether we develop with native Win32 API or in QT. It happens spontanously, with no event th...

psapi.dll proccess status api

Could someone provide c++ tutorials/reference/books about PSAPI ? also Did someone know if there are a wrapper to this library on perl? ...