winapi

Arrow keypress not working

This are my code hope any kind souls will be kind enough to help me. Other Keys like Alphabets or Home or PgUp etc.. is working. Except for all the arrows. void AutoMove (HWND hWnd) { BOOL bWorked = FALSE; int value = 0; LPARAM lparam = (MapVirtualKey(0x025, 0) << 16) + 1; //Send to graphic screen HWND MSHWND = FindWindow ("MapleSto...

How to write a script for organizing my desktop windows? (WinXP)

I would like to write a script that moves the currently open Windows to a certain location. Ideally, my program would look like this: var window = FindWindow("Winamp"); window.setPos(1140, 900, 160, 124); // set x, y, width and height window = FindWindow("Windows Live Messenger"); window.setPos(1140, 0, 900, 124); // etc... I suspe...

Drag and drop files/text to tray icon (C#, WindowsForms)

I'm trying allow drag and drop to the tray icon on my application. I know it's impossible to do this with the higher level C# WindowsForms API, since NotifyIcon doesn't support drag events. So with a little help of a more windows-experienced friend I set out to try this via Win32 API. The idea was registering a hook in the tray window ...

GDI drawing application in win32

does anyone know any good GDI drawing application with source code available which is similar to mspaint? ...

Equivalent of Win32's ________ in .NET

I recently needed to find the .NET equivalent to ShellExecute, and I was happily able to find the answer quickly at StackOverflow. But surely there must be document or a list somewhere which would have given me this answer just a little quicker. Back when I went from ANSI programming to UNICODE, Microsoft had this handy page of routine...

Using p/invoke and win-api to monitor audio line-in (C#)

Hi everyone In the last few days I was trying to write small program to monitor the audio line-in using win-api (winmm.dll). I can pinvoke api functions such as waveInOpen but I can't figure out how to use these functions to achieve my target. the question is - can someone can briefly tell me how can I get the data from the audio line ...

IP packet / timeout / interval control

Without a novel, I'll try to explain and hope it makes sense. We have an app that handles sending data to a server via simple HTTPS, no problem all works fine. HOWEVER, if the packets are sent via a satellite phone, the latency of transmissions is a lot longer than the typical milliseconds handled on land-line high-speed network acce...

Windows Search - IFilter search term highlighting

My development team are having a problem having snippets of text shown for search results in windows 7 for our own custom files (note we are NOT talking about the preview pane that uses the IPreviewHandler interface). An example of what I mean for .txt files is shown below: The text snippet shown here with the highlighted result is no...

WIN32_FIND_DATA Problems - cFileName

hello, i have a problem with my code ;) hFind = FindFirstFileEx( szPath, FindExInfoMaxInfoLevel, &FindData, FindExSearchNameMatch, NULL , 0); strncpy_s( pszFileName, 280, FindData.cFileName, strlen(FindData.cFileName)); everything seems fine but when i copy the executable to another computer (windows 2003) i get But for pszFileName...

How do I call Win32 application functions from a QT DLL ?

i have a Win32 (not MFC-based) application that imports a QT-based DLL. this works great. at this point, i dont need to use the QT_MFC interop library in order to merge the two event loops. however, i would like the QT DLL to be able to call methods in the Win32 application. would anybody have any advice on how i might go about doing t...

Is anyone aware of a visual diagram that shows the composite parts of std. Windows controls?

For example: I would like to know exactly what system metrics to use to know how wide the borders of a window are going to be. With a given set of visual styles, what borders will appear, and how wide will they be (what system metrics can be queried to know exactly and correctly how wide they'll be)? Similarly, for a button, how wide a...

Finding unique path name for a given input

I'm working on a problem where I need to have a way to convert a user inputted filename to a unique path name. Let's say I let the user specify a path name that points to a file that contains some data. I can then do Data* pData=Open(PathName). Now if the user specifies the same path name again, I'd like to be able to have a table of ...

How to read values off a Windows app?

I need to pull values off a Windows application at regular intervals. Since the values do not appear in a field, I am not able to use Win32 API calls to get them (I figured that out using WinID, a tool that will display information on windows and controls and stuff). I tried using the Office MODI OLE object and the Tesseract CLI tool, b...

After using ShowScrollBar() from win32 API, MdiClient scroll-bars disappear when used?

I have a form class called MDIParent that has IsMdiContainer = true. The form load handler enumerates this.Controls to find the MdiClient container window and assign it to the clientWindow class variable. The handler also disables the AutoScroll property in an attempt to preserve the scroll bars once I manually update them with this cod...

Windows API CreateWindow client size mouse position

Hi, Working with OpenGL, I used CreateWindow( "app", "App Window", WS_CAPTION | WS_POPUPWINDOW | WS_VISIBLE | WS_SIZEBOX | WS_MINIMIZEBOX | WS_MAXIMIZEBOX, 0, 0, 1024, 768, NULL, NULL, hInstance, this ); to create a window and now I need to find the mouse position over the client (render) area. However, I noticed that the mouse co...

How to tell *which* member in MIB_IPFORWARDROW structure is invalid?

A call CreateIpForwardEntry returns ERROR_INVALID_PARAMETER. The PSDK documentation describes this error as: The pRoute parameter is NULL, SetIpForwardEntry is unable to read from the memory pointed to by pRoute, or one of the members of the MIB_IPFORWARDROW structure is invalid. I know for certain that pRoute is not NULL a...

How to run a process as current user privilege from an admin process

When a setup program(built by like Inno Setup) does launch a process, the process always be run as administrator privilege. -because setup program had been run as admin. I want to run the child process as current user's privilege. Is there a good way? ...

Foreground Vs Active window

In Windows, what is the difference between foreground and active window? To be specific, under what circumstances can a foreground window not be an active window? If the 2 terms are referring to the same concept why there're 2 terms. The msdn documentation here mentions "clicking a window, or by using the ALT+TAB or ALT+ESC key comb...

Does WaitForMultipleObjects cause problems in a thread creating STA COM objects?

I have a thread which creates COM objects that use the STA model. This thread's Run function puts it in an infinite WaitForMultipleObjects. Is it possible that the infinite WaitForMultipleObjects could prevent other threads from marshaling calls to the COM objects owned by this thread? Basically, I'm asking if WaitForMultipleObjects ...

How to genrate a monochrome bit mask for a 32bit bitmap

Under Win32, it is a common technique to generate a monochrome bitmask from a bitmap for transparency use by doing the following: SetBkColor(hdcSource, clrTransparency); VERIFY(BitBlt(hdcMask, 0, 0, bm.bmWidth, bm.bmHeight, hdcSource, 0, 0, SRCCOPY)); This assumes that hdcSource is a memory DC holding the source image, and hdcMask is ...