winapi

Set System Time Zone from .NET

Does anyone have some code that will take a TimeZoneInfo field from .NET and execute the interop code to set the system time zone via SetTimeZoneInformation? I realize that it's basically mapping the TimeZoneInfo members to the struct members, but it does not appear obvious to me how the fields will map exactly or what I should care abou...

How might I get the hard drive letter?

How would I find the driver letter of the main hard disk on a Windows Operating system. That is, the drive with Program Files, System32, etc. ...

how to "spy " on win32pipe/console ?

hello, i have an application which call another console application and pass to it some parameters (console app is a video/audio coverter app) ... is there a way to programmatically "spy" or catch the passed paramters other than hooking/monitoring shellexecute/CreateThread etc ? ...

Non-client area messages in Win32

I want my window to close as soon as the mouse hovers on the close button on the non client area. I tried to trap wm_ncmousemove but i could not find the hittest for the close button. Any help please? ...

Break out of ATL class into Win32 functions

Bit of a dumbass question... I think I left my brain in the car... I'm trying to call the Win32 version of SetWindowPos from within an ATL class (I need to specify a different first hWnd, which ATL normally handles), but I can't 'break out' of the ATL class and get the following error: error C2661: 'ATL::CWindow::SetWindowPos' : no ove...

Can a window be always on top of just one other window?

In Windows, is it possible to set window A such that it is always on top of window B, yet allow other windows to work as normal and appear over the top of both, when active. In other words, I want a parent-child relationship between two windows. Can this be done without making window A a child of window B, MDI-style? Window B isn't mine...

Get COM object for embedded IE browser with ruby win32api

Alright this is a pretty complicated problem but it looks like the hard work has been done already by the autoit IE.au3 project. So now it just takes someone experienced with ruby and win32api, and possibly autoit as well to figure out how to translate a function written in IE.au3 to ruby. The end result is I want to use Watir with an em...

Wordwrap Win32

Hello all :) I'm trying to wordwrap a block of text for display in a window that would otherwise be too long. The font I'm using is not a fixed width font, so GetSystemMetrics will not return accurate values for my text. Using a static window is not an option here because a static window doesn't tell me one crucial piece of information...

How to draw graphics/text on top of another application

I want to enhance an application, but there is no 3:e party API available. So basically the idea is to draw graphics/text on top of the applications windows. There are problems with z order, clipping, and directing mouse clicks either to my application or the other application. What is an elegant way of doing this? Example image here....

Custom call events in FSP (Fax Service Provider)

Hello, I'm working on a FSP (Fax Service Provider) for the Windows Fax Service. I want to show custom call events in the Fax Monitor, but there is little documentation on how to do it. According to http://msdn.microsoft.com/en-us/library/ms684534(VS.85).aspx : StatusId Specifies a fax status code or value. This can be a predef...

Question about hard drive , 'seek' and 'read' in windows OS

Does anyone know when calling 'seek' and 'read' , how is the hard-drive physicly affected? If i'll be more specific, I know that the harddrive has some kind of a magnetic needle that is used to read the data from the magnetic plates. So my question is , when is the needle actualy moved to the reading location? Is it moved when we are c...

How to draw a selected text in win32 using only gdi call ?

I tried to draw a selected text using two TextOut call and TA_UPDATECP flag but when I move the selected area, the characters are moving a bit. Does someone know the correct way to do that ? ...

Skype Raw API (NOT COM API) send message problem

In converting this CONSOLE example to a full windows dialog implementation I have run into a very "simple problem". SendMessage() (line 283) is returning zero, GetLastError reveals 0x578 - Invalid window handle. http://read.pudn.com/downloads51/sourcecode/windows/multimedia/175678/msgapitest.cpp__.htm (https://developer.skype.com/Downl...

Hide Error Report window

Hello guys! I have a following problem: My ASP.Net application receives a C++ source code of simple console programm, compiles it with cl.exe (command line VC++ compiler) and runs it using System.Diagnostics.Process. ASP.Net application runs on PC, which can be used for other work (it is not a server, just a working machine). I am hide r...

Setting Virtual Key/MouseButton State Without Triggering Events

Is it possible to set the virtual key state / mouse button state for all programs on a computer without triggering the associated events at the same time (like setting the left mouse button to be currently pressed without sending a mouse down event). Could this be achieved by setting up a fake keyboard or mouse driver for a fake keyboar...

memory profiler for c++

Im trying to find a tool that can help me find out where my memory is allocated in a certain stage of my program. Most memory profilers cant do this and just tell you if memory is leaked or not. Does any one know of a tool that can do this? Edit: OS: Win32 Visual studio 2005 ...

Hooking in win32

I want any window to close as soon as the mouse hovers on the close button on its non client area. I tried to trap wm_ncmousemove using WH_GETMESSAGE in SetWindowsHookEx and then using SendMessage to send a WM_DESTROY message to the specified window but window is not closing. Any help???? LRESULT CALLBACK CallWndProc(int code, WPARAM wP...

PostMessage() on Vista64 behaves weird

The scenario is like Process A invokes certain function foo in Process B, that actually does a PostMessage() on Process C. Process A invokes the function foo when then there is a WM_KEYDOWN message. This works just fine on all 32 bit platforms, but on Vista 64 - when there is a single keydown a burst of events is generated and there a...

Is there a WinXP/WinXP Embedded API to change Locale (specifically, IME)?

I am looking for an API on WinXP to switch between installed IME's. The scenario is, to be able to plug in a langauge keyboard (say Spanish) and change the IME by clicking on a UI button (say button named Spanish) e.g. I plug in a Spanish keyboard and click on the UI button named Spanish. This should internally change the IME to Spanis...

Win API for changing input language programatically

Hi, I want to change the input language in WinXP to Spanish, programatically. Is there an API to suport that? Thanks ...