home · software · code · tutorials · site map

3667
Congressman warns of current GA- Russia conflict in 2002!!!
Ron Paul in an interview with Jim Lehrer says in 2002 interview that by the US adopting a preemptive first Strike Doctrine would eventually lead to Russia invading GA
3543
Girls Get the Anime Look with Extra-Wide Contact Lenses
Girls in Japanese comics, cartoon videos or anime share a common look - big eyes that, by making the rest of the face look small, add the cuteness and sex appeal prized by many Japanese men. Since no amount of cosmetic surgery will make actual human eyes larger, some girls are trying another way to up their cute quotient: extra-wide contact lenses!
1263
'Everyone Will Remember Me as Some Sort of Monster'
A troubled teenager. An assault rifle. Eight slain in a mall. It was national news for a few days. Then it was forgotten.
822
Repurpose Your Nintendo as a Lunchbox (PICS)
I had a broken NES, a rotary tool, two small hinges, some glue and Alpha Flight's Sasquatch. What I ended up with was a lunchbox that gets all kinds of funny looks.
3105
Once You Look, You Can't Look Away (Pic)



Dec
21

Windows - Dynamically Finding the Version of an Executable

2006 @ 03:54 AM

This code snippet will dynamically find the version of a Windows executable.

/*
Name: Dynamic Version Grabber
Copyright: 2006
Author: Tyson Collins
Date: 13/10/06 14:12
Description: Dynamically finds the version of your program (Win32 EXE)
*/

#include <cstdlib>
#include <windows.h>
#include <cstring>
#include <cstdio>

//Link -lversion

using namespace std;

int main(int argc, char *argv[])
{
DWORD buffer[2048];
DWORD size = GetFileVersionInfoSize(argv[0],buffer);
if(GetFileVersionInfo(argv[0],NULL,size,buffer))
{
unsigned int size2;
VS_FIXEDFILEINFO* fInfo;
VerQueryValue(buffer,"\",(LPVOID*)&fInfo,&size2);
if(fInfo)
{
char version[32];
sprintf(version,"%i.%i.%i.%i",HIWORD(fInfo->dwFileVersionMS),LOWORD(fInfo->dwFileVersionMS), HIWORD(fInfo->dwFileVersionLS),LOWORD(fInfo->dwFileVersionLS));
cout << version << endl;
}
}
else {
cout << "Unable to retrieve version information." << endl;
}
system("PAUSE");
return EXIT_SUCCESS;
}


 Del.icio.us  Digg  Furl  Google  Reddit  Slashdot


This article hasn't been commented yet.

CommentsWrite a comment

:

:

:

Blogtastic RSS FEED

Linktastic


TysonC's Profile Page