这是两年前写的了:-),现在从CSDN上搬过来.
using System;
using System.Runtime.InteropServices;

class test_BroadcastSystemMessage


{
const short BSF_POSTMESSAGE=0x10;
static short BSM_APPLICATIONS=0x8;
private const Int32 SC_RESTORE =0xF120;
const short WM_SYSCOMMAND = 0x112;

[DllImport("user32.dll")]
public static extern void BroadcastSystemMessage(short i,ref short ii, short iii, Int32 iiii, Int32 z);
static void Main()

{
Console.WriteLine("这个程序具有破坏性,请退出当前所有程序,\"Y\"执行;\"N\"退出当前程序");
string confirm=Console.ReadLine();
switch(confirm)

{
case "Y":
BroadcastSystemMessage(BSF_POSTMESSAGE,ref BSM_APPLICATIONS, WM_SYSCOMMAND, SC_RESTORE, 0);
break;
case "y":
BroadcastSystemMessage(BSF_POSTMESSAGE,ref BSM_APPLICATIONS, WM_SYSCOMMAND, SC_RESTORE, 0);
break;
case "N":
break;
case "n":
break;
default:
Console.WriteLine("请确入有效字符(Y/N),重新起动程序
");
break;
}
}
}
posted @
2007-05-07 18:19 Boon 阅读(633) |
评论 (1) |
编辑 收藏
查看原文
解决方法
A.删除VS2005 B.删除.NET FRAMEWORK 2.0 C.删除%windir%\WinSxS\ 下的 Policies 文件夹 D.安装.NET Framework 2.0 E.安装VS2005 & SP1
posted @
2007-05-07 18:12 Boon 阅读(1368) |
评论 (0) |
编辑 收藏
摘要: Google一下关于利用CHttpFile上传文件,没有找到好用的版本(PUT的版本相对很多,但由于安全问题,实用性不大).仓促中拼揍了一个DEMO.贴出来共勉:-)DEMO1Dlg.h
1// DEMO1Dlg.h : 头文件 2// 3 4#pragma once 5#include "af...
阅读全文
posted @
2007-05-07 18:07 Boon 阅读(4238) |
评论 (8) |
编辑 收藏
注: 前阵时在做一个在线图片处理的ActiveX控件,用到了黎叔的的开源项目"ImageStone",很不错,在这里还要感谢黎叔.
帮我实现了大部份功能
,由于客户需要裁切功能,黎叔在代码中并没有去实现.我又去Google一下也没找到合适的(我的拿来主义还是很重的,MSDN上也没找到关于GDI+关于图片裁切处理的VC版本..NET的到是找了一个).无耐,自已实现吧,现在把部份代码贴出来共享一下.
1
inline void FCObjImage::Cropping(RECT reCropping)
{
2
if (!IsValidImage() || (reCropping.right <= 0) || (reCropping.bottom <= 0))
3
return;
4
if((int)reCropping.right==Width()&&(int)reCropping.bottom==Height())
5
return;
6
int nNewWidth = (int)(reCropping.right - reCropping.left);
7
int nNewHeight = (int)(reCropping.bottom - reCropping.top);
8
9
// first backup image const FCObjImage imgOld(*this) ;
10
if (!Create (nNewWidth, nNewHeight, imgOld.ColorBits()))
{
11
assert(false) ;
12
return ;
13
}
14
15
// duplicate palette
16
if (ColorBits() <= 8)
17
CopyPalette (imgOld) ;
18
19
const int nSpan = ColorBits() / 8 ;
20
21
for (int y=reCropping.top ; y < reCropping.bottom ; y++)
{
22
BYTE * pPixel = GetBits (y-reCropping.top) ;
23
for (int x=reCropping.left ; x < reCropping.right ; x++)
{
24
BYTE * pOld = imgOld.GetBits(x,y);
25
FCColor::CopyPixel (pPixel, pOld, nSpan) ;
26
pPixel += nSpan ;
27
}
28
}
29
}
30
posted @
2007-05-07 17:49 Boon 阅读(1364) |
评论 (3) |
编辑 收藏
摘要: 1/**//*============================================================================== 2 * Name: ChineseLetter 3 * Author: Zhu JianFeng 4 *&...
阅读全文
posted @
2007-05-07 17:15 Boon 阅读(1768) |
评论 (1) |
编辑 收藏
或许不会成文.只是想记录下Symbian学习的点滴.作备忘或自勉.