Welcome to MSDN Blogs Sign in | Join | Help

Browse by Tags

All Tags » Windows API   (RSS)

What is your computer doing with all that memory? Write your own memory browser

What is your computer doing with all that memory? There are various kinds of memory allocated and used in each process. These include: · Managed memory (VB.Net, C#, managed C++) · Heap memory · Stacks · Images (files loaded into a process) VirtualAlloc
Posted by Calvin_Hsia | 1 Comments
Filed under: , , , ,

You can use HWndHost to host a Win32 HWnd window inside a WPF element

Suppose you have some old code lying around that creates a Win32 window with an HWnd (perhaps ATL , MFC , or just C/ C++). For example, if you type some erroneous code into a VB application in Visual Studio: Dim x=4: catch ex As Exception The “Exception”
Posted by Calvin_Hsia | 1 Comments
Filed under: , ,

Dynamically load a DLL from a runtime specified path

When running VB.Net or C# code, often it’s useful to call native code. One way is using PInvoke. (for other ways, see How fast is interop code? ) For example, you can call GetWindowText to get the title of a window. To get it’s managed signature, you
Posted by Calvin_Hsia | 0 Comments
Filed under: ,

Compress and timestamp your pictures to gain disk space

I was running out of space again on my notebook. As years go by, digital cameras can take pictures with more megapixels, but that means they take up more space. Thus my pictures from 10 years ago are much smaller than this year’s. Since I have multiple

Extract TreeView or ListView ImageList icons from a DLL

An ImageList can be used for a ListView or TreeView control to contain many images in a single file, usually embedded as a resource. Visual Studio itself has many icons. If you open Windows Explorer or Internet Explorer, you can see many icons in toolbars,
Posted by Calvin_Hsia | 8 Comments
Filed under: ,

Create a WPF Form to choose a text color

I wanted to choose some nice colors for various kinds of text, so I wrote a simple text color picker using Windows Presentation Foundation (WPF) . The code creates a TextBlock and 4 slider controls: one for Alpha channel (Opacity) and one each for Red,
Posted by Calvin_Hsia | 2 Comments
Filed under: , ,

Resize your pictures for your phone or pocket pc

I have many digital pictures, and I'd like to put some of my favorites on my SmartPhone . However the files are much higher resolution than the device's display. This means the files take a lot more memory on the phone, and they take longer to process.

Generate and run PowerShell scripts dynamically

In my prior post Use new XML Features of VB to generate dynamic scripts and text files , we generated a simple batch file. It’s difficult to modify the registry or manipulate a COM object PowerShell scripts allow you to manipulate files, registry and
Posted by Calvin_Hsia | 3 Comments

Find which DLLs in your system are rebased

You can use CreateToolhelp32Snapshot and its family of functions to enumerate the running processes on your machine, including the modules loaded by each process My prior post ( DLL Image base addresses are the same in XP, different on Vista ) described

DLL Image base addresses are the same in XP, different on Vista

When you start a program on your Windows XP computer, a process is created and several DLLs (Dynamic Link Libraries) are loaded into the process. Some DLLs are “system” DLLs, such as Kernel32.dll, GDI32.dll, User32.dll. These DLLs are loaded early in
Posted by Calvin_Hsia | 5 Comments
Filed under: ,

Help->About->System Info doesn't work on Vista

A customer (thanks Grady!) reported that choosing Help->About->System Info on Vista causes a MessageBox to display “Microsoft System Info cannot be found or run.” Why is that? Simple investigation: run Regedit on WinXP and Vista to inspect this

Allowing Optional parameters in your COM objects

It’s simple to create a VFP object that can be used within other applications. I show how useful it is in Blogs get 300 hits per hour: Visual FoxPro can count. That sample builds the T1.C1 object that uses methods with multiple parameters. T1.C1 is a
Posted by Calvin_Hsia | 3 Comments

How to schedule your computer to run tasks automatically

Our building will have a power failure at a particular time. You may want your computer to stay on til just before the power goes out due to various reasons: It may be a web or file server serving other clients around the world. You may want to access
Posted by Calvin_Hsia | 6 Comments
Filed under:

Create your own Flip Task Bar with live thumbnails using Vista Desktop Window Manager DWM

The sample below uses Desktop Window Manager under Windows Vista with Aero to get dynamic live thumbnails of running applications. If a movie is playing in Windows Media Player, it will play in the thumbnail too! EnumChildWindows or EnumWindows is used

Vista Aero DWM seems to optimize out GDI paint calls

In this post: Foxpro Menu items, combo boxes not refreshing selected item under Aero in Vista I describe a problem in Foxpro where menu and list items that are supposed to be non-selected aren’t painted correctly. I described a workaround: call the GdiSetBatchLimit
More Posts Next page »
 
Page view tracker