stargeek
PHP news website logo.
home    PHP scripts    articles    seo tools    links    search    contact    shop    realtors


Easier Dynamic Win32 API







Easier Dynamic Win32 API

Easier Dynamic Win32 API 04/11/2005 05:42 AM

When Win32 API first came out, it wasn't sprawled out like it is now.  As it expanded (exploded) in spurts across versions, architectures, and service packs, Windows developers had to deal increasingly with the headaches from the need to take advantage of latest features without crippling their software with older Windows.

While one could now use deferred library loading creatively to address this problem, I've always handled it with manual LoadLibrary and GetProcAddress calls.  Well, I finally got tired of doing this so I tried the handy LateLoad, a small MFC-style event framework-like macros that creates a C++ class for each library and a C++ method for each procedure.  Very nice.

Here is the LateLoad definitions for a set of Win32 functions one needs to enumerating running processes and modules across Win32 versions.

LATELOAD_BEGIN_CLASS(CPsApi, PSAPI.DLL, FALSE, FALSE)
  LATELOAD_FUNC_3(FALSE, BOOL, STDAPICALLTYPE,
  EnumProcesses,
DWORD*, DWORD, DWORD*)
 
LATELOAD_FUNC_4(FALSE, BOOL, STDAPICALLTYPE,
  EnumProcessModules,
HANDLE, HMODULE*, DWORD, LPDWORD)
 
LATELOAD_FUNC_4(0, DWORD, STDAPICALLTYPE, GetModuleBaseNameA,
 
HANDLE, HMODULE, LPTSTR, DWORD)
 
LATELOAD_FUNC_4(0, DWORD, STDAPICALLTYPE, GetModuleFileNameExA,
 
HANDLE, HMODULE, LPTSTR, DWORD)
LATELOAD_END_CLASS()

LATELOAD_BEGIN_CLASS(CVdmDbg, VDMDBG.DLL, FALSE, FALSE)
 
LATELOAD_FUNC_3(0, INT, STDAPICALLTYPE, VDMEnumTaskWOWEx,
 
DWORD, TASKENUMPROCEX, LPARAM)
LATELOAD_END_CLASS()

LATELOAD_BEGIN_CLASS(CKernel32, Kernel32.DLL, FALSE, FALSE)
 
LATELOAD_FUNC_2(NULL, HANDLE, STDAPICALLTYPE,
  CreateToolhelp32Snapshot,
DWORD, DWORD)
 
LATELOAD_FUNC_2(FALSE, BOOL, STDAPICALLTYPE,
  Process32First,
HANDLE, LPPROCESSENTRY32)
 
LATELOAD_FUNC_2(FALSE, BOOL, STDAPICALLTYPE,
  Process32Next,
HANDLE, LPPROCESSENTRY32)
LATELOAD_END_CLASS()




This is a GrokNews Entry: (what is grok?)





Similar Items

Easier Dynamic Win32 API

Grok Headline matches for Easier Dynamic Win32 API

It's Easier That Way


It's Easier That Way 12/02/2003 01:57 AM
Shark Tank: IT director orders up a new cell phone for on-call support staffers to use after hours, and sets up the voice mail system to page the phone whenever a message is left for the help desk. That lasts three days. ...

Win32-MMF-0.07


Win32-MMF-0.07 02/14/2004 11:39 PM

Win32-Exe-0.03


Win32-Exe-0.03 02/14/2004 11:39 PM

Win32-Exe-0.02


Win32-Exe-0.02 02/14/2004 06:32 PM

Win32-MMF-0.05


Win32-MMF-0.05 02/10/2004 04:50 AM

Win32-MSI-DB-1.05


Win32-MSI-DB-1.05 09/16/2004 09:36 AM

Win32-MMF-0.09e


Win32-MMF-0.09e 05/29/2004 12:22 AM

Win32-MMF-0.06


Win32-MMF-0.06 02/12/2004 11:37 PM

Win32-Exe-0.01


Win32-Exe-0.01 02/13/2004 10:31 PM

Win32-Exe-0.04


Win32-Exe-0.04 02/15/2004 11:45 PM

Win32::API 0.40


Win32::API 0.40 03/13/2003 10:16 AM
dada writes "I've just released version 0.40 of Win32::API, the popular tool to import functions from Win32 DLLs. in a blurb, here's what this version can do: automatically define a Perl sub with the name of the imported API (eg. no more ...

Win32-Exe-0.05


Win32-Exe-0.05 02/16/2004 09:25 AM

Win32-Exe-0.06


Win32-Exe-0.06 02/16/2004 10:46 PM

Win32-MMF-0.08


Win32-MMF-0.08 02/16/2004 10:46 PM

Win32-Die-0.03


Win32-Die-0.03 12/29/2004 01:18 AM

Win32-Die-0.02


Win32-Die-0.02 12/27/2004 01:22 AM

Win32-MSI-DB-1.04


Win32-MSI-DB-1.04 04/13/2004 06:05 AM

Going for Google just got easier


Going for Google just got easier 11/17/2003 03:12 PM
Sydney Morning Herald Nov 17 2003 1:49PM ET

An easier way to shave


An easier way to shave 03/14/2003 11:15 PM
An easier way to shave (2.3 meg Quicktime movie, about 30 seconds, funny)

Making It Easier


Making It Easier 05/17/2004 06:02 PM
Constructech Magazine May 17 2004 9:49PM GMT

Wiretapping the Web Easier Than Ever


Wiretapping the Web Easier Than Ever 08/14/2004 03:12 PM

RSS made even easier


RSS made even easier 07/09/2004 06:26 PM
Yahoo has added a new link to its search results: "Add to My Yahoo." Click and the page's RSS feed is added to the list on your My Yahoo site, the personalized portal from Yahoo. Then, if you're at, say, About.com, you'll see an "Add to My Yahoo" button that does the same thing. Yahoo reports that the pickup of this new feature has been excellent......

Easier to swallow


Easier to swallow 06/21/2004 01:58 PM
USA Today Jun 21 2004 6:29PM GMT

Win32-Symlink-0.03


Win32-Symlink-0.03 09/25/2004 12:19 AM

Win32-AD-User-0.01


Win32-AD-User-0.01 11/05/2003 11:43 PM

Win32-Resources-0.02


Win32-Resources-0.02 04/09/2004 03:59 PM

Win32-GuiTest-1.50.1-ad


Win32-GuiTest-1.50.1-ad 04/09/2004 11:54 PM

Win32-Symlink-0.02


Win32-Symlink-0.02 09/19/2004 12:17 AM

Win32-IE-Mechanize-0.005


Win32-IE-Mechanize-0.005 04/12/2004 04:50 PM

win32-guidgen-0.04


win32-guidgen-0.04 04/12/2004 11:29 PM

Win32-TaskScheduler2.0.2


Win32-TaskScheduler2.0.2 10/30/2003 06:07 PM

Win32-Hardlink-0.02


Win32-Hardlink-0.02 09/25/2004 12:19 AM

Win32-ProcFarm-2.15


Win32-ProcFarm-2.15 01/09/2004 09:54 PM

Win32-MBCS-0.01


Win32-MBCS-0.01 11/14/2003 10:20 AM

Win32-MBCS-0.02


Win32-MBCS-0.02 11/14/2003 10:20 AM

Win32.Novarg.A


Win32.Novarg.A 01/27/2004 08:57 AM
a new virus .. McAafe .. McAfee

us.mcafee.com/virusInfo/default.asp?id=description&virus_k=10 0983
track this site | 5 links


Win32-GUI-DIBitmap-0.13


Win32-GUI-DIBitmap-0.13 12/09/2003 06:06 PM

Win32-Symlink-0.01


Win32-Symlink-0.01 09/18/2004 05:15 PM

libusb-win32


libusb-win32 11/12/2003 05:41 PM
Version 0.1.7.7 released
Grok Description matches for Easier Dynamic Win32 API
GrokA matches for Easier Dynamic Win32 API

Easier Dynamic Win32 API

The following phrases have been identified by the grok system as matching this entry:

















Also check out:


Grok

Ipod Porn on the
Rise

Brief Abstract of
Wikipedia's
Mesothelioma Cancer
page

Get first aid
instructions in your
cell phone

IE is crap
JSPWiki gains
podcasting support

Anomaly Wiki
Spam Becomes
Accepted Part of the
Net

Net users learn to
live with spam

Linux in Government:
Linux Desktop
Reviews, Part IV -
Linspire

End of the Line
Making a plastic
texture with The
GIMP

How to Blog Safely
(About Work or
Anything Else)

New (PNEU) Company
Formed - Pneu
Stainless Motors,
LLC. - The First
Choice for
Pneumatically
Powered Stainless
Steel Motors

Web Marketing
Association to Name
Best Biotechnology
Website of 2005

Comic for 11 Apr
2005

my mistake
Using MySQL in a
federated database
environment

Script Connector
CastleKart, v. 2005,
Build ( 51 ) Beta 2

Script Connector
CastleKart, v. 2005,
Build ( 50 ) Beta 1

Support for MySQL in
the Simple RSS
Service

MySQL Maestro 1.4
released

Amid Duel for MCI,
Shareholder
Resentment

Blogs Incensed Over
Pulitzer Photo Award

Amazon Expands Into
Book Printing

Reviving a Magazine
With Ballast of a
Web Site First

France Detects a
Cultural Threat in
Google

10 Mega Pixel Output
Digital Cameras
Under $200

FullArmor boosting
range of Microsoft
management policy

NetScaler tool aims
to speed apps
traffic

IBM, Net App team on
storage

Trend Micro takes
aim at spyware

SEC launches
financial reporting
XML project

Faster Fibre Channel
products on tap

Be secure: Think
like bad guys

Talkin' trash: One
outfit's story of
e-commerce

Check Point set to
defend security turf

Users find dual
roles for management
tools

Axiomtek Introduces
Fast, Robust And
Powerful Network
Appliance

OHAUS Gets Down to
Basics With New
Adventurer SL
Analytical and
Precision Balances

Tungsten Grinder
With Vacuum For
Automatic Arc
Welding

Tungsten Grinder
Improves Arc
Starting, Stability,
and Tungsten Life

New Low Cost Pure
Sine Backup System
Has Integrated
Charger

Battery
Reconditioning
Company Has
Unprecedented
Success

MyMall247.com
Launches New Online
Super Store

Last Day of Work
Inhabits your Palm
OS with Village Sim
Game - "Little
People Colonize your
Handheld Device and
Live in Real-time.."

AOL, XM Satellite
Announce New
Partnership (AP)

Disney Plans
Broadband Offerings
for Kids (AP)

FastIcon Releases
"PowerToolbar "
Stock Icons.

3G to be on 15% of
phones sold in
S'pore

You could have a 3G
cell phone already

Samsung SCH-B200
T-DMB GPRS Phone at
Milia 2005

Ericsson awarded
managed services
contract for Maxis
3G network

New Milestone in 3G
Development -
specifications for
3GPP Release 6
finalized

T-Mobile Austria and
Siemens Present 3G
HSDPA

KDDI 3G Phone
Subscribers

what is grok?