winapi

Hide Title Bar of Program using API

Its possible remove a window console title bar using c# and windows api, if yes howto? Please. ...

SetWorldTransform() and font rotation

I'm trying to display text on a Windows control, rotated by 90 degrees, so that it reads from 'bottom to top' so to speak; basically it's the label on the Y axis of a graph. I got my text to display vertically by changing my coordinate system for the DC by using SetGraphicsMode(GM_ADVANCED) and then using XFORM transform; const double ...

Tips for joining engine and GUI

I have a game playing engine written in C++. I have my own "development" GUI. The program is for sale in Japan and I have a Japanese publisher that has written an commercial GUI to join up with my game playing engine. We have had this arrangement for many years. Both my engine and his GUI are large, complex and undergo regular changes be...

Win32 DDK: Is calling API from driver interrupt wrong?

Note: This is not a problem i'm experiencing, but it is something i'd like to understand (just because i want to be a better person, and to further the horizon of human understanding). In the bonus chapter of Raymond Chen's book, Raymond gives the example of a bug in a sound card driver: The original function, called...

Customized Windows Save Dialog is no Longer Fancy -- Why?

In accordance with this question I am customizing a Win32 Save File dialog with a custom template description. Now I have a problem where the Save File dialog doesn't show the left-hand bar with my computer, recent places, etc. I can confirm that removing the custom template brings the left-hand sidebar back. What am I doing that warrant...

Get memory usage of computer in Windows with Python

How can I tell what the computer's overall memory usage is from Python, running on Windows XP? ...

Get the logged in Windows user name associated with a desktop

Hello I wish to enumerate all desktops in a system and get the logged in user name for that desktop. So far I have the following code snippit as an example of obtaining a HDESK handle and trying to determine the user name associated with it (if any), but the call to LookupAccountSid fails with ERROR_NONE_MAPPED ("No mapping between acco...

Automatic update solutions for a Win32 application?

We've got a desktop product, made up of a Win32 service, a notification icon application and associated DLL files. I've been tasked to look at making it auto-update. We could write our own updater, but before we do that, I'd like to see what else is out there. Are there any commercial systems (similar to Windows Update, I guess) that we...

How to check if window proc is not corrupted in call to CallwindowProc?

I need to call API CallWindowProc((WNDPROC)lpfnOldProc, hWnd, Message, wParam, lParam); Now how can I make sure that lpfnOldProc still valid ? Basically,lpfnOldProc is procedure in another dll and if that dll is unloaded then lpfnOldProc will still be pointing to something but not valid memory? Are there some memory API's through w...

WIN32: Yielding execution to another (given) thread

I am looking for a way to yield the remainder of the thread execution's scheduled time slice to a different thread. There is a SwitchToThread function in WINAPI, but it doesn't let the caller specify the thread it wants to switch to. I browsed MSDN for quite some time and haven't found anything that would offer just that. For an operati...

The legacy device context is too coarse.

Hi. I have a Process Control system. It has a huge 2D workspace where all the logic is laid out. The 2D workspace is a coordinate system. You usually do not see the whole workspace at once, but rather some in-zoomed part of it focusing on some part of the controlled process. Such subsystem views are bookmarked into predefined named ima...

If window spans multiple monitors, I can't draw to it.

If I have a window that spans both monitors on a multimonitor system, I can't seem to erase (paint black) the entire window. Instead, only the primary window is drawn black. The secondary remains the original white color. Has anyone seen this behavior? wxwidgets: wxClientDC dc(this); Erase(dc); void SpriteWindowFrame::Erase(wxDC& d...

Backup configuration files

I need to be able to store configuration files on machines that gets disconnected by plugging off the electricity ;), I'm using basic WinApi to store configuration data (WriteFile), this works unless the machine is plugged off ;), sometimes file isn't saved at all. I was thinking of 2 solutions: 1) Transactional NTFS API (eg. CreateFil...

how to call different Win API based on Windows version?

The specific problem is, the support of condition variable on Windows begins from Vista, for early version of Windows (Windows XP), I have a emulated condition variable code sort of solved the problem. However, I'd like to have the ability to call native condition variable API when the system supported and fallback to my version only on ...

How can I determine programmatically whether the Windows taskbar is hidden or not?

I need to know whether the Windows taskbar is hidden or not. I believe there is no .NET method to do this, and also I have come across a lot of "how to hide and show the taskbar" samples, but I haven't seen anything based on what I am looking for. I am not familiar with the Windows API, so I find it hard to understand traditional Windows...

Writing a console wrapper in C#?

I am trying to write my own Command Line wrapper like 'Console2' in C#. Unfortunately I haven't figured out a good way to do it. Can somebody give me an example of grabbing console input and output and directing it into an Application? NB I am not trying to make a console application, I am trying to make a wrapper for console - A windo...

How can I hook Ctrl-Alt-Tab ?

I am trying to hook the keyboard in my program, but there is something that I can't accomplish. The method below is the most important part in my class where I handle certain key combinations. All of them work, but I also want to hook Ctrl-Alt-Tab. I've spent hours trying to figure out what to do, but I came empty handed. How can I hook ...

How to programmatically create a 'bright' and a 'gray' version of an icon?

In a win32 application, I want to have a button with an icon which looks gray when the button is disabled and 'brighter' when the mouse hovers. I know I can create three bitmaps with an icon editor, but since the icon can be user selected and loaded from the disk, I would like to create the other two versions programmatically. So, star...

Win32 GUI flickering on resize

I have a Win32 GUI program with a tab control, each tab having a list view control. There is massive flickering whenever the window is resized. I've tried the following things: Handling WM_ERASEBKGND in the main wndproc and returning TRUE. No effect. Filtering out all WM_ERASEBKGND messages in the event loop. No effect. Setting the WM_...

How to make a Win 32 App run as a Windows Service?

Hello all, Our company just completed a Win 32 Application project, and we have a executable program and it works fine in Windows. Now we have to run it as a windows service under Network account. I am pretty new to Windows Service, so please advice, what should I do to transform this program to a Windows Service? Thank you! ...