winapi

Python win32 service

Hey guys, I am fairly new to python, and have no experience with writing services for windows. I have tried to hack together a windows service based on afew tutorials i have found out there. I need this service to constantly monitor a directory for changes and when it sees a change it runs a script. Here is what i have so far: import ...

Basic Game DrawEngine question

Hi, i want to create a basic game Draw engine class for my 2D game. i'm not quite sure whether to share main window handle with class or keep it private as it is in the main class. The other way i'm thinking to do is pass the device context itself to draw engine class. which would be the standard way to work with draw engine? ...

How to make a Web Browser toolbar ?

How do I make a Web Browser toolbar in C++. in dev-C++ for I.E with no addon libraries? ...

Does anyone have a FileSystemWatcher-like class in C++/WinAPI?

I need a .Net's FileSystemWatcher analog in raw C++/WinAPI. I almost started to code one myself using FindFirstChangeNotification/FindNextChangeNotification, but then it occurred to me that I am probably not the first one who needs this and maybe someone will be willing to share. Ideally what I need is a class which can be used as follo...

Credential manager for Vista/Windows 7

I have Credential manager implemented in VC++ which captures credentials during login process. It works well in XP/Vista/Windows 7 32 bit env. But is not working in 64 bit. Any idea ? Thanks in advance for any help ...

Problem using MIDI streams in Windows

Hello, I'm writing a Windows program using C++ and the Windows API, and, am trying to queue MIDI messages in a MIDI stream, but am receiving a strange error when I try to do so. If I use midiOutShortMsg to send a non-queued MIDI message to the stream, it works correctly. However, midiStreamOut always returns error code 68, which is #def...

ShellExecuteEx with SEE_MASK_FLAG_NO_UI displays error when starting .NET app on system without .NET

The ShellExecuteEx Win32 function call has a flag SEE_MASK_FLAG_NO_UI in its SHELLEXECUTEINFO structure, which should suppress any error dialogs which could be displayed because of an error when launching an application. The MSDN documentation here is quite explicit about it: SEE_MASK_FLAG_NO_UI 0x00000400. Do not display an error me...

Interfacing a joypad in Windows

How does one interface a joypad under Windows? Is there a WinAPI method, or must DirectX be used? Can anyone provide some pointers as to how to get started? Thanks! ...

Device browsing problem

I’m writing file browsing software and I want it to work correctly with all portable devices, such as cameras, smart phones and so on. My program shows thumbnails, so I need to read the content of each file. Now I’m facing some problems: With both my photo cameras I can open only one ISteam from device. For every additional stream I g...

How to change font of a menu item to regular from bold?

Hello I want to change font of a menu item from bold to regular. I looked few API's like ModifyMenu SetMenuItemInfo but looks like there is no direct API to change the font. Any suggestions whats the easiest and best way to do that. ...

ExtCreatePen and Windows 7 GDI

I created DIBPATTERN pens with ExtCreatePen API for custom pattern pens. It sucessfully draws desired lines on Windows XP, But on Windows 7 (x64 for my case), it does not draw any lines; no changes on screen. (Other simply created pens, for example CreatePen(PS_DOT,1,0), are working.) I found that calling SetROP2(hdc, R2_XORPEN) make...

How do I know if HWND is desktop itself?

I use GetForegroundWindow to get the foreground window handle but if there is no window, then it returns the HWND to the desktop. How do I know if the HWND is the desktop? ...

Inconsistent packet delivery by NIC, NIC performance measurement

One of our customers experiences problem with our streaming application (win32). It seems like UDP (RTP) packets that should be sent by the application with some constant interval (say 20 ms) are actually sent with a greatly variable deltas (say 15ms - 25ms - 10ms - 30 ms). This is the only customer that experiences the problem so netwo...

How do you compare two HWND pointers?

Is it possible to do if(HWND1 == HWND2) or is there a function that I need to use to see if two hwnd point to the same window? ...

Get information about running processes

I need to start a monitor on some machines to find out which processes are locking it. So what I would like is logging about the same information you can find on the Task Manager about each executing process. So far I can have the Processor Time information with the C# Process Class, but I would also like to know how much memory it is u...

How to handle drag event on a maximized window

I have an MFC application running in Win7 with no Titlebar (i.e. My title bar is home-cooked, with custom buttons for restore, maximize and close). In Win7 it responds to the maximize event generated by the Win 7 API when a user drags the window to the top of the screen. However, once it's maximized, I can't capture the restore event tha...

Can I store a IAccessible object for later use in my program?

I have a program that uses MSAA to find a control. Then I want to save that pointer so that later I can get the accessible object again but it never works. Can you store these pointers? ...

I have a wxwidgets that I want to add some cool effects. Using GDI would be impossibly hard. Could I use flash or something else?

I have an application that I want add some cool animations to show state changes. However, wxwidgets would be difficult because I'd have to program these animations in straight gdi. What's the best way to add these effect windows? Should I open a flash window and run a flash sequence or is maybe some other technology? Does .net have some...

Whats the deal with a performance counter Parent?

When I create performance counters in Windows Vista, I see that there is a "parent" column in the performance monitor listview that lists the counters. What is parent? I haven't seen a way to set it using managed code. Is it only available if I use the Winapi? ...

How to write grey text on edit box?

Hi I want to set some text on my edit box, but it should be greyed. Is there some way to do that? I am not able to find the proper API for this. Any suggestions? ...