#include <windows.h>
#include <stdio.h>
BOOL IsWin7 ()
{
OSVERSIONINFOEX osvi;
DWORDLONG dwlConditionMask = 0;
int op=VER_GREATER;
// Initialize the OSVERSIONINFOEX structure.
ZeroMemory(&osvi, sizeof(OSVERSIONINFOEX));
osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX);
osvi.dwMajorVersion = 6;
osvi.dwMinorVersion = 1;
// Initialize the condition mask.
VER_SET_CONDITION( dwlConditionMask, VER_MAJORVERSION, op );
VER_SET_CONDITION( dwlConditionMask, VER_MINORVERSION, op );
// Perform the test.
return VerifyVersionInfo(
&osvi,
VER_MAJORVERSION | VER_MINORVERSION,
dwlConditionMask);
}
void main()
{
if(IsWin7())
printf("yes.\n");
else{
printf("no.\n");
}
}
posted @
2010-04-27 11:10 小果子 阅读(210) |
评论 (0) |
编辑 收藏
#include <iostream>
#include <windows.h>
#include <iostream>
#include <psapi.h>
#include <sstream>
#include <fstream>
using namespace std;
int _tmain(int argc, _TCHAR* argv[],TCHAR* envp[])
{
//PTSTR pEnvBlock=::GetEnvironmentStrings();
//TCHAR szName[MAX_PATH];
//TCHAR szValue[MAX_PATH];
int current=0;
PTSTR* pElement =(PTSTR*) envp;
PTSTR pCurrent=NULL;
while(pElement!=NULL){
pCurrent=(PTSTR)(*pElement);
if(pCurrent==NULL){
pElement=NULL;
}else{
_tprintf(TEXT("[%u] %s\r\n"),current,pCurrent);
current++;
pElement++;
}
}
}
posted @
2010-04-27 10:47 小果子 阅读(247) |
评论 (0) |
编辑 收藏
roll_over roll_out事件根据范围判定
mouse_down mouse_out 根据对象判定
mouse_down mouse_out 先于单击事件触发
双击事件触发时 mouse_down,mouse_out触发二次,单击事件触发一次,第二次单击时不处罚click
posted @
2010-01-11 10:01 小果子 阅读(1223) |
评论 (0) |
编辑 收藏
try{
OutputStreamWriter out = new OutputStreamWriter(new FileOutputStream(path),"UTF-8");
out.write(common+"\n");
out.write(html);
out.flush();
out.close();
}catch(Exception e){}
posted @
2009-10-27 14:42 小果子 阅读(549) |
评论 (0) |
编辑 收藏
以前自己玩游戏时写的一个网页游戏小辅助,有兴趣的email
posted @
2009-09-02 13:40 小果子 阅读(726) |
评论 (4) |
编辑 收藏